/* ── TOKENS ── */
:root {
  --accent: #CFB991;
  --accent-dim: rgba(207,185,145,0.12);
  --accent-glow: rgba(207,185,145,0.25);

  --bg:       #F7F9FC;
  --bg-card:  #FFFFFF;
  --bg-subtle:#EEF2F8;
  --border:   rgba(0,0,0,0.08);
  --text:     #0D1117;
  --text-mid: #4A5568;
  --text-dim: #8A97AB;
  --shadow:   0 2px 24px rgba(0,0,0,0.07);
  --shadow-lg:0 8px 48px rgba(0,0,0,0.10);

  --radius: 16px;
  --radius-sm: 8px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'DM Mono', monospace;

  --max-width: 1100px;
  --pad-x: 48px;
}

@media (min-width: 1600px) {
  :root {
    --max-width: 1400px;
    --pad-x: 64px;
    font-size: 18px;
  }
}

@media (min-width: 2000px) {
  :root {
    --max-width: 1700px;
    --pad-x: 80px;
    font-size: 20px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #080E1A;
    --bg-card:  #0F1825;
    --bg-subtle:#141E2E;
    --border:   rgba(255,255,255,0.07);
    --text:     #E8EDF5;
    --text-mid: #8A97AB;
    --text-dim: #4A5568;
    --shadow:   0 2px 24px rgba(0,0,0,0.4);
    --shadow-lg:0 8px 48px rgba(0,0,0,0.5);
  }
}

/* Force overrides from toggle */
[data-theme="dark"] {
  --bg:       #080E1A;
  --bg-card:  #0F1825;
  --bg-subtle:#141E2E;
  --border:   rgba(255,255,255,0.07);
  --text:     #E8EDF5;
  --text-mid: #8A97AB;
  --text-dim: #4A5568;
  --shadow:   0 2px 24px rgba(0,0,0,0.4);
  --shadow-lg:0 8px 48px rgba(0,0,0,0.5);
}
[data-theme="light"] {
  --bg:       #F7F9FC;
  --bg-card:  #FFFFFF;
  --bg-subtle:#EEF2F8;
  --border:   rgba(0,0,0,0.08);
  --text:     #0D1117;
  --text-mid: #4A5568;
  --text-dim: #8A97AB;
  --shadow:   0 2px 24px rgba(0,0,0,0.07);
  --shadow-lg:0 8px 48px rgba(0,0,0,0.10);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px var(--pad-x);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(247,249,252,0.75);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
@media (prefers-color-scheme: dark) {
  nav { background: rgba(8,14,26,0.75); }
}
[data-theme="dark"] nav { background: rgba(8,14,26,0.75); }
[data-theme="light"] nav { background: rgba(247,249,252,0.75); }
.nav-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-mid);
  transition: color 0.2s;
  letter-spacing: 0.02em;
}
.nav-links a:hover { color: var(--text); }

/* ── THEME TOGGLE ── */
.theme-toggle {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-mid);
  transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .ti { font-size: 0.95rem; }

/* ── HERO ── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--pad-x) 80px;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
  opacity: 0.5;
}
.hero-glow {
  position: absolute;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}
.hero-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 10px;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s forwards;
}
h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-mid);
  max-width: 560px;
  line-height: 1.7;
  font-weight: 300;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s forwards;
}
.hero-cta {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s forwards;
}
.hero-photo-col {
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: fadeUp 1s 0.5s forwards;
}
.hero-photo-frame {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}
.hero-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.hero-photo-label {
  margin-top: 16px;
  text-align: center;
}
.hero-photo-label .name-large {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  display: block;
}
.hero-photo-label .name-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 4px;
  display: block;
}
.hero-photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: var(--pad-x);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  opacity: 0;
  animation: fadeUp 1s 1.2s forwards;
}
.scroll-line {
  width: 1px;
  height: 32px;
  background: var(--accent);
  animation: scrollPulse 2s 2s infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@supports (animation-timeline: view()) {
  .tl-entry, .work-card, .stat-card, .skill-group, .chain-node {
    animation: fadeUp linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
}
@supports not (animation-timeline: view()) {
  .tl-entry, .work-card, .stat-card, .skill-group, .chain-node {
    opacity: 1;
    transform: none;
  }
}

/* ── SECTION LABEL ── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent);
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
h2 em { font-style: italic; color: var(--accent); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #1a1200;
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ── ABOUT ── */
section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px var(--pad-x);
}
#about .about-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 64px;
  align-items: start;
  margin-top: 48px;
}
.about-text p {
  color: var(--text-mid);
  font-size: 1rem;
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 20px;
}
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: var(--text); font-weight: 600; }
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.stat-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-mid);
  font-weight: 400;
  line-height: 1.4;
}

/* ── WORK CARDS ── */
#work { max-width: var(--max-width); }
.work-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  position: relative;
  overflow: hidden;
}
.work-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s;
  transform-origin: left;
}
.work-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.work-card:hover::before { transform: scaleX(1); }
.work-card.upcoming { border-style: dashed; opacity: 0.8; }
.work-card-icon { font-size: 1.4rem; }
.work-card-org {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.work-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-top: 4px;
}
.work-card-desc {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.7;
  font-weight: 300;
  flex: 1;
}
.work-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.work-card-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-top: auto;
}
.work-card-link:hover { text-decoration: underline; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(207,185,145,0.2);
}

/* ── TIMELINE ── */
#timeline {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px var(--pad-x);
}
.tl-intro {
  max-width: 560px;
  color: var(--text-mid);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 64px;
}
.tl-entry {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 0 48px;
  margin-bottom: 72px;
  position: relative;
}
.tl-entry::before {
  content: '';
  position: absolute;
  left: 74px;
  top: 0; bottom: -72px;
  width: 1px;
  background: var(--border);
}
.tl-entry:last-child::before { display: none; }
.tl-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  padding-top: 5px;
  text-align: right;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.tl-dot {
  position: absolute;
  left: 68px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px var(--accent-dim);
  z-index: 1;
}
.tl-body {
  padding-left: 28px;
}
.tl-org {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.tl-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}
.tl-desc {
  font-size: 0.92rem;
  color: var(--text-mid);
  line-height: 1.75;
  font-weight: 300;
  margin-bottom: 16px;
  max-width: 640px;
}
.tl-photo {
  width: 100%;
  max-width: 580px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 16px;
  background: var(--bg-subtle);
}
.tl-photo img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}
.tl-photo-placeholder {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}
.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* ── ORG LINKS ── */
a.org-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
a.org-link:hover {
  color: var(--accent);
}

/* ── CREDITS ── */
.credits-group-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.credit-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.credit-row:last-child { border-bottom: none; }
.credit-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.credit-show {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.credit-role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-mid);
  letter-spacing: 0.03em;
}
.credit-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.credit-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
}
.credit-location {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ── SKILLS ── */
#signal {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px var(--pad-x);
}
#signal .inner {
  width: 100%;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 40px;
}
.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.skill-group h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.skill-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.skill-group ul li {
  font-size: 0.85rem;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 8px;
}
.skill-group ul li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── GALLERY ── */
.tl-gallery {
  margin-top: 20px;
  max-width: 580px;
}
.gallery-main {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  margin-bottom: 10px;
}
.gallery-main img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}
.gallery-thumbs {
  display: flex;
  gap: 8px;
}
.gallery-thumb {
  width: 72px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-thumb.active,
.gallery-thumb:hover {
  border-color: var(--accent);
}

/* ── CONTACT ── */
#contact {
  text-align: center;
  padding: 120px var(--pad-x);
}
#contact h2 { margin-bottom: 16px; }
#contact p {
  color: var(--text-mid);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 40px;
  font-weight: 300;
  line-height: 1.7;
}
.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  color: var(--text-dim);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  nav { padding: 16px 24px; }
  .nav-links { display: none; }
  section { padding: 80px 24px; }
  #hero { padding: 100px 24px 80px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo-col { max-width: 260px; margin: 0 auto; }
  .work-cards { grid-template-columns: 1fr !important; }
  #about .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  footer { flex-direction: column; gap: 12px; text-align: center; }
  #signal { padding: 80px 24px; }
}
@media (max-width: 700px) {
  .tl-entry { grid-template-columns: 52px 1fr; gap: 0 24px; }
  .tl-entry::before { left: 60px; }
  .tl-dot { left: 54px; }
  #timeline { padding: 80px 24px; }
}
@media (max-width: 600px) {
  .credit-row { flex-direction: column; gap: 6px; }
  .credit-meta { align-items: flex-start; }
}

/* ── LARGE SCREEN ── */
@media (min-width: 1600px) {
  .hero-inner { grid-template-columns: 1fr 440px; }
  .work-cards { grid-template-columns: repeat(3, 1fr) !important; }
  .skills-grid { grid-template-columns: repeat(4, 1fr); }
  .tl-entry { grid-template-columns: 80px 1fr; gap: 0 64px; }
  .tl-entry::before { left: 96px; }
  .tl-dot { left: 90px; }
}
