:root {
  --bg: #FAFAF7;
  --fg: #0A0A0A;
  --fg-muted: #6B6B68;
  --fg-faint: #A8A8A4;
  --rule: #1f1f1f;
  --rule-faint: rgba(10, 10, 10, 0.12);
  --hover: rgba(10, 10, 10, 0.04);
  --font-display: "Inter Tight", "Neue Haas Grotesk Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --max: 1320px;
  --gutter: 40px;
  --transition: 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0A0A0A;
  --fg: #F2F2EE;
  --fg-muted: #8A8A86;
  --fg-faint: #4A4A47;
  --rule: #F2F2EE;
  --rule-faint: rgba(242, 242, 238, 0.14);
  --hover: rgba(242, 242, 238, 0.05);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms ease, background 300ms ease;
}
.site-header.scrolled { border-bottom-color: var(--rule-faint); }

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 24px;
  height: 24px;
  display: inline-block;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg-muted);
  border-radius: 999px;
  transition: color 200ms ease;
}
.nav-link:hover { color: var(--fg); }
.nav-link.active { color: var(--fg); }
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 6px; top: 50%;
  width: 4px; height: 4px;
  background: var(--fg);
  border-radius: 50%;
  transform: translateY(-50%);
}
.nav-link.active { padding-left: 18px; }

.header-end { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 999px;
  color: var(--fg-muted);
  transition: color 200ms ease, background 200ms ease;
}
.theme-toggle:hover { color: var(--fg); background: var(--hover); }
.theme-toggle svg { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .nav { display: none; }
  .header-inner { height: 56px; }
}

/* ---------- Layout ---------- */
main { padding-top: 64px; }
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px var(--gutter);
  position: relative;
}
@media (max-width: 760px) {
  .section { padding: 80px 24px; }
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}
.section-label::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--fg-muted);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  font-size: clamp(36px, 5vw, 64px);
  margin-bottom: 56px;
  max-width: 14ch;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px var(--gutter) 80px;
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
@media (max-width: 760px) {
  .hero { padding: 60px 24px 40px; min-height: calc(100vh - 56px); }
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: flex;
  gap: 18px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}
.hero-eyebrow span { display: flex; gap: 8px; }
.hero-eyebrow b { color: var(--fg); font-weight: 500; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-size: clamp(56px, 10vw, 156px);
  margin-bottom: 60px;
}
.hero-title.hero-name {
  font-size: clamp(52px, 9vw, 140px);
  margin-bottom: 20px;
}
.hero-role {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg-muted);
  margin-bottom: 60px;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .word {
  display: inline-block;
  transform: translateY(110%);
  animation: rise 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.hero-title .word:nth-child(2) { animation-delay: 80ms; }
.hero-title .word:nth-child(3) { animation-delay: 160ms; }
.hero-title .word:nth-child(4) { animation-delay: 240ms; }

@keyframes rise {
  to { transform: translateY(0); }
}

.hero-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  align-items: end;
  border-top: 1px solid var(--rule-faint);
  padding-top: 28px;
}
@media (max-width: 760px) {
  .hero-bottom { grid-template-columns: 1fr; gap: 20px; }
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.hero-meta-value {
  display: block;
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg);
  margin-top: 6px;
  font-weight: 500;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--fg);
  max-width: 38ch;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  border-bottom: 1px solid var(--fg);
  padding-bottom: 4px;
  transition: gap 200ms ease;
}
.hero-cta:hover { gap: 14px; }
.hero-cta svg { width: 14px; height: 14px; }

/* Hero variant: numbered grid */
.hero.variant-grid .hero-title { font-size: clamp(40px, 6.5vw, 92px); }
.hero.variant-grid .hero-role { margin-bottom: 40px; }
.hero.variant-grid .hero-grid {
  display: grid;
  grid-template-columns: 60px 1fr 2fr;
  gap: 0;
  border-top: 1px solid var(--rule-faint);
  margin-bottom: 60px;
}
.hero.variant-grid .hero-grid-row {
  display: contents;
}
.hero.variant-grid .hero-grid-row > * {
  padding: 22px 16px;
  border-bottom: 1px solid var(--rule-faint);
  font-size: 15px;
}
.hero.variant-grid .grid-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.08em;
}
.hero.variant-grid .grid-key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.hero.variant-grid .grid-val { color: var(--fg); }

/* Hero variant: marquee */
.hero.variant-marquee { overflow: hidden; }
.hero.variant-marquee .marquee {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  font-size: clamp(80px, 18vw, 240px);
  line-height: 0.9;
  white-space: nowrap;
  display: flex;
  gap: 60px;
  animation: marquee 40s linear infinite;
}
.hero.variant-marquee .marquee span { display: inline-block; }
.hero.variant-marquee .marquee .dot {
  width: 0.4em; height: 0.4em;
  background: var(--fg);
  border-radius: 50%;
  align-self: center;
  flex-shrink: 0;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  align-items: start;
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

.about-prose {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--fg);
  font-weight: 400;
  text-wrap: pretty;
}
.about-prose .muted { color: var(--fg-muted); }

.about-side {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.about-side-block { border-top: 1px solid var(--rule-faint); padding-top: 16px; }
.about-side-block .label { color: var(--fg-faint); margin-bottom: 8px; display: block; }
.about-side-block .value {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg);
  font-weight: 500;
}

/* ---------- Stack ---------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule-faint);
  border-left: 1px solid var(--rule-faint);
}
@media (max-width: 760px) { .stack-grid { grid-template-columns: repeat(2, 1fr); } }

.stack-cell {
  border-right: 1px solid var(--rule-faint);
  border-bottom: 1px solid var(--rule-faint);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 200ms ease;
  min-height: 120px;
  justify-content: space-between;
}
.stack-cell:hover { background: var(--hover); }
.stack-cell .num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
}
.stack-cell .name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.stack-cell .kind {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ---------- Projects ---------- */
.projects-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 56px;
  gap: 40px;
}
.projects-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px 40px;
}
@media (max-width: 760px) {
  .projects-grid { grid-template-columns: 1fr; gap: 56px; }
}

.project { display: flex; flex-direction: column; gap: 20px; }

.project-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  border: 1px solid var(--rule-faint);
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: border-color 300ms ease;
}
.project:hover .project-media { border-color: var(--fg); }
.project-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      135deg,
      transparent 0,
      transparent 9px,
      var(--rule-faint) 9px,
      var(--rule-faint) 10px
    );
  opacity: 0.7;
}
.project-media .placeholder-label {
  position: relative;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--bg);
  padding: 6px 10px;
  border: 1px solid var(--rule-faint);
}

.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--rule-faint);
  padding-top: 16px;
}
.project-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
}
.project-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  flex: 1;
}
.project-link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 200ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.project:hover .project-link { color: var(--fg); }

.project-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 56ch;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 4px 8px;
  border: 1px solid var(--rule-faint);
  border-radius: 2px;
}

/* ---------- Experience ---------- */
.exp-list { 
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 48px;
}

.exp-card {
  border: 1px solid var(--rule-faint);
  border-radius: 8px;
  padding: 32px;
  transition: border-color 300ms ease, background 300ms ease;
}
.exp-card:hover { 
  border-color: var(--rule); 
  background: var(--hover);
}

.exp-card-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.exp-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.exp-card-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exp-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  text-transform: uppercase;
}

.exp-role {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0;
}

.exp-org {
  font-size: 14px;
  color: var(--fg-muted);
  font-weight: 500;
}

.exp-period {
  font-size: 13px;
  color: var(--fg-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
}

.exp-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-muted);
  margin: 0;
}

.exp-desc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exp-desc-list li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-muted);
  padding-left: 20px;
  position: relative;
}

.exp-desc-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--fg-faint);
  font-weight: bold;
}

@media (max-width: 760px) {
  .exp-card {
    padding: 24px;
  }
  
  .exp-card-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .exp-logo {
    width: 40px;
    height: 40px;
  }
  
  .exp-role {
    font-size: 16px;
  }
  
  .exp-period {
    font-size: 12px;
  }
  
  .exp-desc {
    font-size: 14px;
  }
}

/* ---------- Contact ---------- */
.contact {
  border-top: 1px solid var(--rule-faint);
}
.contact-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px var(--gutter) 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: end;
}
@media (max-width: 900px) {
  .contact-inner { grid-template-columns: 1fr; gap: 56px; padding: 80px 24px 60px; }
}

.contact-headline {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  font-size: clamp(48px, 8vw, 120px);
}
.contact-headline a {
  position: relative;
  display: inline-block;
}
.contact-headline a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.08em;
  height: 2px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.contact-headline a:hover::after { transform: scaleX(1); }

.contact-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-faint);
  font-size: 15px;
  font-weight: 500;
  transition: padding 200ms ease;
}
.contact-link:hover { padding-left: 8px; }
.contact-link .platform {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  width: 80px;
}
.contact-link .handle { flex: 1; }
.contact-link .arrow {
  width: 14px; height: 14px;
  color: var(--fg-faint);
  transition: transform 200ms ease, color 200ms ease;
}
.contact-link:hover .arrow { transform: translate(2px, -2px); color: var(--fg); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule-faint);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  gap: 16px;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .footer-inner { padding: 24px; }
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 800ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Type variants ---------- */
[data-type="editorial"] {
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
[data-type="editorial"] .hero-title,
[data-type="editorial"] .section-title,
[data-type="editorial"] .contact-headline {
  font-weight: 400;
  letter-spacing: -0.025em;
}
[data-type="editorial"] .hero-title { font-style: italic; }

[data-type="mono"] {
  --font-display: "JetBrains Mono", ui-monospace, monospace;
}
[data-type="mono"] .hero-title,
[data-type="mono"] .section-title,
[data-type="mono"] .contact-headline {
  letter-spacing: -0.04em;
  font-weight: 500;
}

/* ---------- Color variants ---------- */
[data-color="warm"] { --bg: #F4F1EA; --fg: #1A1815; --rule-faint: rgba(26,24,21,0.14); --hover: rgba(26,24,21,0.04); --fg-muted: #6B665C; --fg-faint: #A8A498; }
[data-color="warm"][data-theme="dark"] { --bg: #16140F; --fg: #EFEAE0; --rule-faint: rgba(239,234,224,0.14); --hover: rgba(239,234,224,0.05); --fg-muted: #8A8478; --fg-faint: #4A463E; }

[data-color="cool"] { --bg: #F4F6F8; --fg: #0E1216; --rule-faint: rgba(14,18,22,0.14); --hover: rgba(14,18,22,0.04); --fg-muted: #5F6770; --fg-faint: #A0A6AD; }
[data-color="cool"][data-theme="dark"] { --bg: #0B0E12; --fg: #EBEEF2; --rule-faint: rgba(235,238,242,0.14); --hover: rgba(235,238,242,0.05); --fg-muted: #7C848D; --fg-faint: #424850; }
