/* ========================================
   ROHAN CODEKAGE — DIGITAL WORKSPACE
   Editorial / Swiss / Asymmetric
   ======================================== */

:root {
  --bg: #0a0a0a;
  --bg-alt: #0f0f0f;
  --bg-surface: #141414;
  --bg-elevated: #1a1a1a;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #e8e8e8;
  --text-sec: #888;
  --text-dim: #555;
  --accent: #2dd4a8;
  --accent-dim: rgba(45,212,168,0.08);
  --accent-glow: rgba(45,212,168,0.15);
  --green-dark: #0d3320;
  --offwhite: #f0f0f0;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --ease: cubic-bezier(0.16,1,0.3,1);
  --container: 1200px;
  --pad: 24px;
  --section: 140px;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
input, textarea { font-family: inherit; border: none; outline: none; background: none; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad); }

.mono {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-sec);
}

.serif { font-family: var(--serif); font-weight: 400; }

/* ---- CURSOR ---- */
.cursor {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 10000;
  mix-blend-mode: difference;
  transition: transform 0.1s var(--ease);
}

.cursor-ring {
  width: 28px; height: 28px;
  border: 1px solid rgba(45,212,168,0.25);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), border-color 0.3s;
}

.cursor-ring.expand { width: 48px; height: 48px; border-color: var(--accent); }

@media (hover: none) { .cursor, .cursor-ring { display: none; } }

/* ---- TAGS ---- */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-sec);
  background: transparent;
  transition: border-color 0.2s, color 0.2s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag--small { font-size: 0.55rem; padding: 3px 8px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 14px 32px; border-radius: 3px;
  transition: all 0.2s var(--ease); white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--bg); font-weight: 500; }
.btn--primary:hover { background: #3ce8ba; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(45,212,168,0.2); }

/* ---- SECTION NUMBERS ---- */
.section-num {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  letter-spacing: 0.1em;
}

.section-heading {
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--offwhite);
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-sec);
  margin-bottom: 48px;
  max-width: 520px;
}

/* ---- LOADER ---- */
.loader {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__inner { text-align: center; }
.loader__mark {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--accent);
  display: block;
  margin-bottom: 20px;
}
.loader__line {
  width: 60px; height: 1px;
  background: var(--accent);
  animation: loaderPulse 1s ease-in-out infinite;
}
@keyframes loaderPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ========================================
   NAVIGATION
   ======================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(10,10,10,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  transition: transform 0.4s var(--ease);
}
.nav--hidden { transform: translateY(-100%); }

.nav > .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}

.nav__left {
  display: flex; align-items: center; gap: 16px;
  flex-shrink: 0;
}

.nav__mark {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent);
  transition: opacity 0.2s;
}
.nav__mark:hover { opacity: 0.7; }

.nav__divider {
  width: 1px; height: 16px;
  background: var(--border);
  flex-shrink: 0;
}

.nav__location { font-size: 0.6rem; color: var(--text-dim); white-space: nowrap; }

.nav__center {
  display: flex; align-items: center; gap: 28px;
  margin-left: auto;
  margin-right: 32px;
}

.nav__link {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.2s;
  position: relative;
  white-space: nowrap;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.2s var(--ease);
}
.nav__link:hover { color: var(--text); }
.nav__link:hover::after { width: 100%; }
.nav__link.active { color: var(--accent); }
.nav__link.active::after { width: 100%; }

.nav__right {
  display: flex; align-items: center; gap: 20px;
  flex-shrink: 0;
}

.nav__toggle {
  display: none;
  flex-direction: column; gap: 6px;
  width: 28px; height: 28px;
  align-items: flex-end; justify-content: center;
  position: relative;
}
.nav__toggle span {
  display: block; height: 1px;
  background: var(--text);
  transition: all 0.3s var(--ease);
  transform-origin: center;
}
.nav__toggle span:first-child { width: 28px; }
.nav__toggle span:last-child { width: 18px; }
.nav__toggle.active span:first-child {
  width: 28px;
  transform: rotate(45deg) translate(2px, 2px);
}
.nav__toggle.active span:last-child {
  width: 28px;
  transform: rotate(-45deg) translate(2px, -2px);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: rgba(10,10,10,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.mobile-menu.active { opacity: 1; pointer-events: all; }
.mobile-menu__inner {
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.mobile-menu__link {
  font-family: var(--serif);
  font-size: 1.8rem;
  color: var(--text-sec);
  padding: 14px 0;
  transition: color 0.2s, transform 0.2s;
  opacity: 0;
  transform: translateY(16px);
}
.mobile-menu.active .mobile-menu__link {
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu__link:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu__link:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu__link:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu__link:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu__link:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu__link:nth-child(6) { transition-delay: 0.3s; }
.mobile-menu__link:nth-child(7) { transition-delay: 0.35s; }
.mobile-menu__link:hover { color: var(--accent); }

/* ========================================
   HERO — EDITORIAL SPLIT
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 100px var(--pad) 60px;
  position: relative;
}

.hero__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}

.hero__left { padding-right: 40px; }

.hero__name {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: var(--offwhite);
  margin-bottom: 16px;
}

.hero__realname {
  font-size: 0.65rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 32px;
}

.hero__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.hero__role {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-sec);
}

.hero__role-sep {
  color: var(--text-dim);
  font-size: 0.7rem;
}

.hero__right { padding-left: 40px; }

.hero__statement {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.35;
  color: var(--offwhite);
  margin-bottom: 32px;
}

.hero__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero__meta .mono { font-size: 0.6rem; color: var(--text-dim); }

.hero__bottom {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero__scroll-text { font-size: 0.6rem; color: var(--text-dim); }

.hero__scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ========================================
   ABOUT — IMMERSIVE
   ======================================== */
.about {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.about__layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 80px;
  align-items: start;
}

.about__title {
  font-size: clamp(2.2rem, 4vw, 3rem);
  color: var(--offwhite);
  line-height: 1.15;
  margin-bottom: 40px;
}

.about__portrait { position: relative; }

.about__img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  filter: contrast(1.05);
  transition: filter 0.4s, border-color 0.3s;
  border: 1px solid var(--border);
}
.about__img:hover { filter: contrast(1.1); border-color: var(--accent); }

.about__img-annotations {
  position: absolute;
  top: 16px; right: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.about__img-annotations .mono {
  font-size: 0.6rem;
  color: var(--offwhite);
  background: rgba(10,10,10,0.75);
  padding: 4px 10px;
  border-radius: 2px;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255,255,255,0.08);
}

.about__big-quote {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.35;
  color: var(--offwhite);
  margin-bottom: 48px;
  padding-left: 24px;
  border-left: 2px solid var(--accent);
  font-style: italic;
}

.about__story p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-sec);
  margin-bottom: 24px;
}
.about__story strong { color: var(--text); font-weight: 600; }
.about__story em { color: var(--accent); font-style: italic; }

.about__margin-note {
  font-size: 0.6rem;
  color: var(--accent);
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 32px 0;
  position: relative;
  cursor: default;
  letter-spacing: 0.06em;
}
.about__margin-note::before {
  content: attr(data-note);
  position: absolute;
  right: 0;
  font-size: 0.55rem;
  color: var(--text-sec);
}

.about__closing {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text);
  margin-top: 16px;
  font-family: var(--serif);
  font-style: italic;
}

/* ========================================
   BUILDER MAP
   ======================================== */
.builder-map {
  padding: var(--section) 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.builder-map__layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

.builder-map__center { text-align: center; }

.builder-map__node {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 28px;
  text-align: center;
  transition: border-color 0.2s;
}
.builder-map__node--root {
  border-color: var(--accent);
  background: var(--accent-dim);
  padding: 18px 40px;
}
.builder-map__node--root .mono { font-size: 0.9rem; color: var(--accent); letter-spacing: 0.15em; }

.builder-map__branches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  width: 100%;
}

.builder-map__branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.builder-map__connector {
  width: 1px; height: 24px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

.builder-map__node--area {
  cursor: pointer;
  padding: 12px 16px;
  width: 100%;
}
.builder-map__node--area .mono { font-size: 0.65rem; letter-spacing: 0.08em; }
.builder-map__node--area:hover { border-color: var(--accent); }

.builder-map__detail {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s var(--ease);
}
.builder-map__branch:hover .builder-map__detail,
.builder-map__branch.active .builder-map__detail {
  opacity: 1;
  max-height: 100px;
}
.builder-map__detail p {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ========================================
   TOOLS
   ======================================== */
.tools {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.tools__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tools__category {
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.2s;
}
.tools__category:hover { border-color: var(--border-hover); }

.tools__cat-title {
  color: var(--accent);
  margin-bottom: 16px;
  font-size: 0.7rem;
}

.tools__items { display: flex; flex-direction: column; gap: 0; }

.tools__item {
  font-size: 0.9rem;
  color: var(--text-sec);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.tools__item:last-child { border-bottom: none; }
.tools__item:hover { color: var(--text); }

/* ========================================
   WORK — LARGE ALTERNATING
   ======================================== */
.work {
  padding: var(--section) 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.project {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.project:last-child { border-bottom: none; }

.project__number {
  position: absolute;
  top: 80px;
  font-size: 4rem;
  font-weight: 300;
  color: rgba(255,255,255,0.03);
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}
.project--left .project__number { right: 0; }
.project--right .project__number { left: 0; }

.project__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}
.project__split--reverse { direction: rtl; }
.project__split--reverse > * { direction: ltr; }

.project__year {
  display: block;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-size: 0.6rem;
}

.project__name {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--offwhite);
  line-height: 1.2;
  margin-bottom: 12px;
}

.project__tagline {
  font-size: 1rem;
  color: var(--text-sec);
  margin-bottom: 24px;
  max-width: 400px;
}

.project__meta-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project__meta-item { display: flex; flex-direction: column; gap: 4px; }
.project__meta-label { font-size: 0.6rem; color: var(--text-dim); }
.project__meta-value { font-size: 0.9rem; color: var(--text-sec); }

.project__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.project__detail-block { }
.project__detail-label { display: block; margin-bottom: 8px; font-size: 0.6rem; }
.project__detail-block p { font-size: 0.9rem; line-height: 1.7; color: var(--text-sec); }

.project__stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.project__stack .mono { margin-right: 8px; }

/* Project Visuals */
.project__arch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 32px;
}
.project__arch-center {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 12px 24px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
}
.project__arch-ring {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.project__arch-node {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-align: center;
  color: var(--text-sec);
  transition: border-color 0.2s;
}
.project__arch-node:hover { border-color: var(--accent); }

.project__ecosystem {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.project__eco-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-sec);
  transition: border-color 0.2s, color 0.2s;
}
.project__eco-item:hover { border-color: var(--accent); color: var(--accent); }

.project__axis {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project__axis-ring {
  width: 140px; height: 140px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  position: absolute;
  opacity: 0.25;
  animation: ringSpin 12s linear infinite;
}
.project__axis-ring::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 100px; height: 100px;
  border: 1px solid var(--text-dim);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  opacity: 0.3;
}
@keyframes ringSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.project__axis-core {
  display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: 1;
}
.project__axis-core .mono { font-size: 1rem; color: var(--accent); letter-spacing: 0.2em; }
.project__axis-label {
  position: absolute; bottom: 0;
  font-size: 0.55rem; color: var(--text-dim);
}

.project__shop-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.project__shop-bar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.project__shop-bar .mono { font-size: 0.6rem; color: var(--text-dim); }
.project__shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
}
.project__shop-item { text-align: center; }
.project__shop-img {
  aspect-ratio: 1;
  background: var(--bg-elevated);
  border-radius: 4px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
}
.project__shop-item .mono { font-size: 0.55rem; }

.project__gps {
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project__gps-pulse {
  position: absolute;
  width: 100px; height: 100px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0.2;
  animation: gpsPulse 3s ease-out infinite;
}
.project__gps-pulse--2 { animation-delay: 1.5s; }
@keyframes gpsPulse { 0% { transform: scale(0.8); opacity: 0.3; } 100% { transform: scale(2.2); opacity: 0; } }
.project__gps-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  position: relative; z-index: 1;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ========================================
   COMPANIES
   ======================================== */
.companies {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.company {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}
.company:last-child { border-bottom: none; }

.company__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.company__role {
  display: block;
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 0.65rem;
}

.company__name {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--offwhite);
  margin-bottom: 12px;
}

.company__headline {
  font-size: 1.2rem;
  color: var(--text-sec);
  margin-bottom: 24px;
  line-height: 1.4;
}

.company__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.company__role-list .mono {
  font-size: 0.6rem;
  color: var(--text-dim);
}

.company__section {
  margin-bottom: 28px;
}

.company__section-title {
  color: var(--accent);
  margin-bottom: 10px;
  font-size: 0.65rem;
}

.company__section p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-sec);
}

.company__product-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.company__flow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.company__flow .mono { font-size: 0.65rem; color: var(--text); }
.company__flow-arrow { color: var(--text-dim); font-size: 0.8rem; }

/* ========================================
   FOUNDER MODE — MODE SWITCH
   ======================================== */
.founder-mode {
  padding: var(--section) 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.founder-mode__switch {
  display: flex;
  gap: 0;
  margin-bottom: 40px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: inline-flex;
}

.founder-mode__btn {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 24px;
  color: var(--text-dim);
  transition: all 0.2s;
  border-right: 1px solid var(--border);
}
.founder-mode__btn:last-child { border-right: none; }
.founder-mode__btn:hover { color: var(--text); }
.founder-mode__btn.active { background: var(--accent); color: var(--bg); }

.founder-mode__panel { display: none; }
.founder-mode__panel.active { display: block; animation: fadeUp 0.4s var(--ease); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.founder-mode__panel-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.founder-mode__panel-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
  transition: border-color 0.2s;
}
.founder-mode__panel-item:hover { border-color: var(--accent); }

.founder-mode__panel-label {
  display: block;
  color: var(--accent);
  margin-bottom: 10px;
  font-size: 0.65rem;
}

.founder-mode__panel-item p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-sec);
}

/* ========================================
   FROM CODE TO COMPANY
   ======================================== */
.codetocompany {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.codetocompany__content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.codetocompany__line {
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  line-height: 1.5;
  color: var(--text-sec);
}

.codetocompany__line--accent {
  color: var(--accent);
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ========================================
   AI LAB — RESEARCH NOTEBOOK
   ======================================== */
.lab {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.lab__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.lab__entry {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px;
  transition: border-color 0.2s;
  display: flex;
  flex-direction: column;
}
.lab__entry:hover { border-color: var(--accent); }

.lab__entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.lab__entry-num { color: var(--text-dim); font-size: 0.6rem; }

.lab__entry-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--offwhite);
  margin-bottom: 8px;
}

.lab__entry-status {
  display: inline-block;
  font-size: 0.55rem;
  color: var(--accent);
  margin-bottom: 12px;
  padding: 2px 8px;
  border: 1px solid rgba(45,212,168,0.2);
  border-radius: 2px;
  width: fit-content;
}

.lab__entry p {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-dim);
  flex: 1;
  margin-bottom: 16px;
}

.lab__entry-stack { display: flex; gap: 6px; flex-wrap: wrap; }

/* ========================================
   JOURNEY / TIMELINE
   ======================================== */
.journey {
  padding: var(--section) 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.timeline {
  position: relative;
  padding-left: 36px;
}

.timeline__line {
  position: absolute;
  top: 0; bottom: 0;
  left: 6px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border), transparent);
}

.timeline__item {
  position: relative;
  padding-bottom: 40px;
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__marker {
  position: absolute;
  left: -36px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  z-index: 1;
  transition: background 0.2s;
}
.timeline__item:hover .timeline__marker { background: var(--accent); }

.timeline__phase {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.65rem;
}

.timeline__title {
  font-size: 1.2rem;
  color: var(--offwhite);
  margin-bottom: 8px;
}

.timeline__content p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-sec);
  max-width: 560px;
}

/* ========================================
   BUILD LOG
   ======================================== */
.buildlog {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.buildlog__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.buildlog__entry {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.buildlog__entry:last-child { border-bottom: none; }

.buildlog__date {
  font-size: 0.6rem;
  color: var(--text-dim);
  padding-top: 2px;
}

.buildlog__label {
  display: block;
  font-size: 0.6rem;
  color: var(--accent);
  margin-bottom: 6px;
}

.buildlog__content p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-sec);
}

/* ========================================
   NOTES
   ======================================== */
.notes {
  padding: var(--section) 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.notes__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.notes__card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px;
  transition: border-color 0.2s;
}
.notes__card:hover { border-color: var(--accent); }

.notes__card-label {
  display: block;
  font-size: 0.55rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.notes__card-title {
  font-size: 1.05rem;
  color: var(--offwhite);
  margin-bottom: 10px;
}

.notes__card p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-dim);
}

/* ========================================
   NOW
   ======================================== */
.now {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.now__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.now__item {
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.2s;
}
.now__item:hover { border-color: var(--accent); }

.now__label {
  display: block;
  font-size: 0.6rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.now__item p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-sec);
}

/* ========================================
   MILESTONES
   ======================================== */
.milestones {
  padding: var(--section) 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.milestones__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 64px;
}

.milestone {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.milestone:last-child { border-bottom: none; }

.milestone__year {
  font-size: 0.6rem;
  color: var(--accent);
  padding-top: 2px;
}

.milestone__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--offwhite);
  margin-bottom: 4px;
}

.milestone__content p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-sec);
}

/* Certificates */
.certificates { margin-top: 48px; }

.certificates__title {
  font-size: 1.4rem;
  color: var(--offwhite);
  margin-bottom: 24px;
}

.certificates__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.certificate {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.certificate:hover { border-color: var(--accent); }

.certificate__img-wrap {
  padding: 10px;
  background: var(--bg-elevated);
}
.certificate__img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
}

.certificate__info { padding: 16px 20px; }

.certificate__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--offwhite);
  margin-bottom: 2px;
}

.certificate__issuer { font-size: 0.55rem; color: var(--text-dim); }

/* ========================================
   CONTACT
   ======================================== */
.contact {
  padding: var(--section) 0;
  border-top: 1px solid var(--border);
}

.contact__title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--offwhite);
  line-height: 1.15;
  margin-bottom: 16px;
}

.contact__subtitle {
  font-size: 1rem;
  color: var(--text-sec);
  margin-bottom: 48px;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.contact__links {
  display: flex;
  flex-direction: column;
}

.contact__link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.2s var(--ease);
  color: var(--text-dim);
}
.contact__link:first-child { padding-top: 0; }
.contact__link:hover { padding-left: 8px; color: var(--text); }
.contact__link:hover .contact__link-value { color: var(--accent); }

.contact__link-label {
  font-size: 0.55rem;
  color: var(--text-dim);
  display: block;
}

.contact__link-value {
  font-size: 0.9rem;
  color: var(--text);
  transition: color 0.2s;
  display: block;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact__form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact__form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact__form-label { font-size: 0.6rem; color: var(--text-dim); }

.contact__form input,
.contact__form textarea {
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s;
}
.contact__form input:focus,
.contact__form textarea:focus { border-color: var(--accent); }
.contact__form textarea { resize: vertical; min-height: 100px; }

/* ========================================
   FOOTER
   ======================================== */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.footer__logo {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text);
}

.footer__name { font-size: 0.85rem; color: var(--text-sec); }
.footer__role { font-size: 0.6rem; color: var(--text-dim); }

.footer__social {
  display: flex;
  gap: 16px;
}

.footer__social-link {
  color: var(--text-dim);
  transition: color 0.2s, transform 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.footer__social-link:hover { color: var(--accent); transform: translateY(-2px); }

.footer__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.footer__bottom .mono { font-size: 0.55rem; }
.footer__tagline { font-size: 0.8rem; color: var(--text-dim); font-style: italic; }

.footer__rotate {
  font-size: 0.55rem;
  color: var(--text-dim);
  animation: rotatePhrase 4s ease-in-out infinite;
}
@keyframes rotatePhrase {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; color: var(--accent); }
}

/* ========================================
   REVEAL ANIMATIONS
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  :root { --section: 100px; }
  .nav__center { display: none; margin-right: 0; }
  .nav__toggle { display: flex; }
  .hero__split { grid-template-columns: 1fr; gap: 40px; }
  .hero__left, .hero__right { padding: 0; }
  .about__layout { grid-template-columns: 1fr; gap: 48px; }
  .about__portrait { max-width: 320px; }
  .builder-map__branches { grid-template-columns: repeat(3, 1fr); }
  .tools__grid { grid-template-columns: repeat(2, 1fr); }
  .project__split { grid-template-columns: 1fr; gap: 32px; }
  .project__split--reverse { direction: ltr; }
  .project__details { grid-template-columns: 1fr; }
  .company__split { grid-template-columns: 1fr; gap: 40px; }
  .founder-mode__panel-grid { grid-template-columns: repeat(3, 1fr); }
  .lab__grid { grid-template-columns: repeat(2, 1fr); }
  .notes__grid { grid-template-columns: repeat(2, 1fr); }
  .now__grid { grid-template-columns: repeat(3, 1fr); }
  .certificates__grid { grid-template-columns: repeat(2, 1fr); }
  .contact__grid { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 640px) {
  :root { --section: 80px; --pad: 20px; --nav-h: 56px; }
  .nav__divider, .nav__location { display: none; }
  .nav__left { gap: 0; }
  .nav__mark { font-size: 0.9rem; }
  .hero { padding: 80px 20px 60px; }
  .hero__name { font-size: 2rem; }
  .hero__roles { gap: 4px; }
  .hero__statement { font-size: 1.2rem; }
  .hero__bottom { display: none; }
  .section-heading { font-size: 1.8rem; }
  .about__title { font-size: 2rem; }
  .about__big-quote { font-size: 1.3rem; }
  .builder-map__branches { grid-template-columns: repeat(2, 1fr); }
  .tools__grid { grid-template-columns: 1fr; }
  .project__name { font-size: 1.4rem; }
  .project__number { font-size: 2.5rem; }
  .founder-mode__panel-grid { grid-template-columns: 1fr; }
  .lab__grid { grid-template-columns: 1fr; }
  .notes__grid { grid-template-columns: 1fr; }
  .now__grid { grid-template-columns: 1fr; }
  .certificates__grid { grid-template-columns: 1fr; }
  .contact__form-row { grid-template-columns: 1fr; }
  .milestone { grid-template-columns: 80px 1fr; gap: 16px; }
  .buildlog__entry { grid-template-columns: 80px 1fr; gap: 16px; }
  .mobile-menu__link { font-size: 1.5rem; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .mobile-menu__link { opacity: 1; transform: none; }
}
/* ========================================
   MOBILE / TOUCH RESPONSIVENESS
   ======================================== */

@media (max-width: 1024px) {
  /* WCAG 2.5.5 / iOS HIG: minimum 44px touch targets */
  .nav__toggle {
    width: 44px;
    height: 44px;
    padding: 8px 0;
  }
  .nav__mark,
  .nav__logo {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .mobile-menu__link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 12px 0;
  }
  .footer__social-link {
    width: 44px;
    height: 44px;
  }
  .work__filter-btn,
  .founder-mode__btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .contact__link { min-height: 44px; }
}

@media (max-width: 640px) {
  /* Stop iOS/Android from scaling text back up */
  html { -webkit-text-size-adjust: 100%; }

  /* iOS auto-zooms the viewport when a focused field is under 16px */
  input,
  textarea,
  select {
    font-size: 16px;
  }

  /* Lift the smallest labels above the ~9px "unreadable" range */
  .tag { font-size: 0.66rem; }
  .tag--small { font-size: 0.6rem; }
  .section-num { font-size: 0.72rem; }
  .about__margin-note { font-size: 0.7rem; }

  /* Long emails/URLs must not push the layout sideways */
  .contact__link-value,
  .footer__tagline,
  address {
    overflow-wrap: anywhere;
  }

  .btn { min-height: 44px; }
}

/* Legibility + form fixes for tablets and phones */
@media (max-width: 1024px) {
  .contact__form input,
  .contact__form textarea {
    font-size: 16px;
  }

  .tag--small,
  .project__year,
  .project__meta-label,
  .project__detail-label,
  .project__axis-label,
  .project__shop-item .mono,
  .project__shop-bar .mono,
  .lab__entry-num,
  .lab__entry-status,
  .notes__card-label,
  .buildlog__date,
  .buildlog__label,
  .now__label,
  .milestone__year,
  .certificate__issuer,
  .contact__link-label,
  .contact__form-label,
  .footer__role,
  .footer__rotate,
  .footer__bottom .mono,
  .hero__meta .mono,
  .hero__scroll-text,
  .nav__location,
  .about__margin-note,
  .about__img-annotations .mono,
  .company__role-list .mono {
    font-size: 0.68rem;
  }
}

/* Founder-mode segmented control must not overflow 320px screens */
@media (max-width: 640px) {
  .founder-mode__switch {
    display: flex;
    width: 100%;
  }

  .founder-mode__btn {
    flex: 1;
    padding: 12px 8px;
    font-size: 0.64rem;
    letter-spacing: 0.04em;
    text-align: center;
  }
}
