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

/* ── Apple Design Tokens ────────────────────────── */
:root {
  /* Exact Apple dark palette */
  --black:    #000000;
  --bg-1:     #111111;   /* slight elevation */
  --bg-2:     #1c1c1e;   /* card surface */
  --bg-3:     #2c2c2e;   /* elevated card */
  --text:     #f5f5f7;   /* Apple primary text */
  --text-2:   #86868b;   /* Apple secondary text */
  --text-3:   #6e6e73;   /* Apple tertiary */
  --blue:     #0071e3;   /* Apple blue */
  --blue-h:   #0077ed;
  --border:   rgba(255,255,255,0.1);
  --border-s: rgba(255,255,255,0.06);

  /* Work chapter accents */
  --ink-from:    #0d0820;
  --ink-to:      #1a1248;
  --noise-from:  #051515;
  --noise-to:    #0a2828;
  --senior-from: #130c00;
  --senior-to:   #271600;
  --yt-from:      #050810;
  --yt-to:        #0b1428;
  --ekkorn-from:  #0f0812;
  --ekkorn-to:    #1e0e26;

  /* Typography */
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --section-py: 128px;
  --max-w: 980px;
}

/* ── Base ───────────────────────────────────────── */
html { scroll-behavior: smooth; font-size: 17px; }

body {
  font-family: var(--sans);
  background: var(--black);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.mono { font-family: var(--mono); }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 3px; }

/* ── Nav ────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 200;
  height: 48px;
  background: rgba(0,0,0,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-s);
  transition: background 0.3s;
}

.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem;
  height: 100%; display: flex; align-items: center; gap: 2rem;
}

.nav-logo {
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  text-decoration: none; letter-spacing: -0.01em; flex-shrink: 0;
}

.nav-links {
  display: flex; gap: 2rem; list-style: none; flex: 1; justify-content: center;
}

.nav-links a {
  color: var(--text-2); text-decoration: none;
  font-size: 0.76rem; font-weight: 400; transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.lang-btn {
  font-size: 0.72rem; font-weight: 500; font-family: var(--mono);
  letter-spacing: 0.06em; padding: 0.2rem 0.65rem;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 980px;
  background: transparent; color: var(--text-2); cursor: pointer;
  transition: all 0.2s; flex-shrink: 0;
}
.lang-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.35); }

/* ── Container ──────────────────────────────────── */
.ap-container {
  max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem;
}

/* ── Hero ───────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  text-align: center; padding: 80px 1.5rem 8vh;
  position: relative; overflow: hidden;
}

.hero-parallax-bg {
  position: absolute; inset: 0 0 -60% 0;
  background: url('bg1.jpg') top center / cover no-repeat;
  z-index: 0; will-change: transform;
}

.hero-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 80% at 50% 50%, rgba(0,0,0,0.2) 20%, rgba(0,0,0,0.97) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.65) 100%);
}

.hero-inner {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0;
}

.hero-eyebrow {
  font-size: 0.8rem; color: var(--text-2);
  letter-spacing: 0.02em; margin-bottom: 1.5rem;
  animation: apFadeUp 0.9s cubic-bezier(0.16,1,0.3,1) both;
}

.hero-name {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.1;
  color: var(--text); margin-bottom: 1.75rem;
}

.hero-cursor {
  display: inline-block; margin-left: 1px;
  animation: heroBlink 0.8s step-end infinite;
}
@keyframes heroBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-dot { color: var(--blue); }

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 300; color: var(--text-2);
  letter-spacing: -0.01em; margin-bottom: 2.5rem; max-width: 500px;
  animation: apFadeUp 0.9s cubic-bezier(0.16,1,0.3,1) 0.25s both;
}

.hero-ctas {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; justify-content: center;
  animation: apFadeUp 0.9s cubic-bezier(0.16,1,0.3,1) 0.38s both;
}

.cta-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--blue); color: #fff; font-size: 0.94rem; font-weight: 500;
  text-decoration: none; padding: 0.7rem 1.4rem;
  border-radius: 980px; transition: background 0.2s, transform 0.2s;
  letter-spacing: -0.01em;
}
.cta-primary:hover { background: var(--blue-h); transform: scale(1.02); }

.cta-text {
  display: inline-flex; align-items: center; gap: 0.25rem;
  color: var(--blue); font-size: 0.94rem; font-weight: 400;
  text-decoration: none; transition: opacity 0.2s; letter-spacing: -0.01em;
}
.cta-text:hover { opacity: 0.75; }

/* Scroll indicator */
.hero-scroll {
  position: absolute; bottom: 2.5rem; left: 50%; transform: translateX(-50%); z-index: 2;
  animation: apFadeUp 1s cubic-bezier(0.16,1,0.3,1) 0.6s both;
}
.scroll-line {
  display: block; width: 1px; height: 48px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
  margin: 0 auto; animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100%{opacity:0.4; transform:scaleY(1)} 50%{opacity:1; transform:scaleY(1.1)} }

/* ── Hero animations ────────────────────────────── */
@keyframes apReveal {
  from { opacity:0; transform:scale(1.06) translateY(24px); filter:blur(12px); }
  to   { opacity:1; transform:scale(1)    translateY(0);    filter:blur(0);    }
}
@keyframes apFadeUp {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0);    }
}

/* ── Stats ──────────────────────────────────────── */
.stats-section {
  padding: var(--section-py) 0;
  background: var(--black);
  border-top: 1px solid var(--border-s);
}

.stats-row {
  display: flex; align-items: center; justify-content: center;
  gap: 0;
}

.stat-item {
  flex: 1; text-align: center; padding: 1.5rem;
}

.stat-number {
  display: block;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700; letter-spacing: -0.04em; color: var(--text);
  line-height: 1; margin-bottom: 0.5rem;
}
.stat-number.npdp { font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: 0.04em; }
.stat-sup { font-size: 0.6em; color: var(--blue); vertical-align: super; }

.stat-label {
  display: block; font-size: 0.76rem; color: var(--text-2);
  letter-spacing: 0.01em;
}

.stat-sep {
  width: 1px; height: 60px; background: var(--border); flex-shrink: 0;
}

/* ── Statement ──────────────────────────────────── */
.statement-section {
  padding: var(--section-py) 0;
  background: var(--bg-1);
  text-align: center;
}

.statement {
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  font-weight: 300; letter-spacing: -0.025em; line-height: 1.35;
  color: var(--text); font-style: italic;
  margin-bottom: 3rem;
}
.statement-open, .statement-close {
  color: var(--blue); font-style: normal; font-weight: 200;
}

.statement-bio {
  font-size: 1.05rem; font-weight: 300; color: var(--text-2);
  max-width: 600px; margin: 0 auto; line-height: 1.8;
}

/* ── Work Chapters ──────────────────────────────── */
.work-chapter {
  padding: var(--section-py) 0;
  position: relative; overflow: hidden;
}

.chapter-ink   { background: linear-gradient(160deg, var(--ink-from)   0%, var(--ink-to)   55%, var(--ink-from)   100%); }
.chapter-noise { background: linear-gradient(160deg, var(--noise-from) 0%, var(--noise-to) 55%, var(--noise-from) 100%); }

/* Subtle vignette */
.work-chapter::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 50%, rgba(0,0,0,0.4) 100%);
}

.chapter-inner {
  position: relative; z-index: 1;
  max-width: 680px;
}
.chapter-right { margin-left: auto; text-align: right; }

/* Split layout: text + image */
.chapter-split {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.chapter-split .chapter-inner { max-width: none; }

.chapter-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chapter-img {
  width: 100%;
  max-width: 540px;
  border-radius: 18px;
  animation: imgFloat 6s ease-in-out infinite;
}
@keyframes imgFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.chapter-meta {
  display: flex; align-items: center; gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.chapter-right .chapter-meta { justify-content: flex-end; }

.chapter-tag {
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-2); padding: 0.3rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 980px;
}
.chapter-ink   .chapter-tag { color: #a89cf8; border-color: rgba(168,156,248,0.3); }
.chapter-noise .chapter-tag { color: #5fe3d4; border-color: rgba(95,227,212,0.3);  }

.chapter-link {
  font-size: 0.75rem; color: var(--text-3); text-decoration: none;
  font-family: var(--mono); transition: color 0.2s;
}
.chapter-link:hover { color: var(--text); }

.chapter-name {
  font-size: clamp(4rem, 10vw, 7.5rem);
  font-weight: 700; letter-spacing: -0.045em; line-height: 0.92;
  color: var(--text); margin-bottom: 2rem;
}

.chapter-desc {
  font-size: 1.05rem; font-weight: 300; color: var(--text-2);
  line-height: 1.75; margin-bottom: 2.5rem; max-width: 520px;
}
.chapter-right .chapter-desc { margin-left: auto; }

.chapter-metrics {
  display: flex; gap: 2.5rem;
}
.chapter-right .chapter-metrics { justify-content: flex-end; }

.cm-item { display: flex; flex-direction: column; gap: 0.3rem; }

.cm-val {
  font-size: 1.3rem; font-weight: 700;
  letter-spacing: -0.03em; color: var(--text);
}
.cm-key {
  font-size: 0.72rem; color: var(--text-3); letter-spacing: 0.01em;
}
.cm-highlight .cm-val      { color: #5fe3d4; }
.cm-highlight-warm .cm-val { color: #fbbf24; }

.chapter-senior {
  background: linear-gradient(160deg, var(--senior-from) 0%, var(--senior-to) 55%, var(--senior-from) 100%);
}
.chapter-senior .chapter-tag {
  color: #fbbf24;
  border-color: rgba(251,191,36,0.3);
  background: rgba(251,191,36,0.08);
}

.cm-highlight-blue .cm-val { color: #60a5fa; }

.chapter-yt {
  background: linear-gradient(160deg, var(--yt-from) 0%, var(--yt-to) 55%, var(--yt-from) 100%);
}
.chapter-yt .chapter-tag {
  color: #60a5fa;
  border-color: rgba(96,165,250,0.3);
  background: rgba(96,165,250,0.08);
}

.cm-highlight-rose .cm-val { color: #e879f9; }

.chapter-ekkorn {
  background: linear-gradient(160deg, var(--ekkorn-from) 0%, var(--ekkorn-to) 55%, var(--ekkorn-from) 100%);
}
.chapter-ekkorn .chapter-tag {
  color: #e879f9;
  border-color: rgba(232,121,249,0.3);
  background: rgba(232,121,249,0.08);
}

/* ── Career ─────────────────────────────────────── */
.career-section {
  padding: var(--section-py) 0;
  background: var(--black);
}

.ap-section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700; letter-spacing: -0.035em; color: var(--text);
  margin-bottom: 3.5rem;
}

.career-list { display: flex; flex-direction: column; }

.career-row {
  display: grid; grid-template-columns: 240px 1fr 200px;
  gap: 2rem; align-items: start;
  padding: 2rem 0;
  border-top: 1px solid var(--border-s);
  transition: background 0.2s;
}
.career-row:last-child { border-bottom: 1px solid var(--border-s); }
.career-row:hover { background: rgba(255,255,255,0.02); border-radius: 12px; }

.cr-logo {
  display: block; height: 44px; width: auto; max-width: 120px;
  object-fit: contain; margin-bottom: 0.6rem;
  border-radius: 8px; opacity: 0.9;
}

.cr-company {
  display: block; font-size: 0.95rem; font-weight: 600;
  color: var(--text); letter-spacing: -0.015em; margin-bottom: 0.25rem;
}
.cr-role {
  display: block; font-size: 0.8rem; color: var(--blue); font-weight: 400;
}

.cr-detail {
  font-size: 0.88rem; color: var(--text-2); line-height: 1.7;
}

.cr-period {
  display: block; font-size: 0.72rem; color: var(--text-3);
  margin-bottom: 0.75rem; letter-spacing: 0.02em;
}
.cr-wins { display: flex; flex-direction: column; gap: 0.3rem; }
.cr-win {
  font-size: 0.8rem; color: var(--text-2); font-weight: 500;
}

/* ── Side Projects ──────────────────────────────── */
.side-section {
  padding: var(--section-py) 0;
  position: relative; overflow: hidden;
}

.side-parallax-bg {
  position: absolute; inset: -30% 0;
  background: url('imgs/IMG_8664.jpg') center center / cover no-repeat;
  z-index: 0; will-change: transform;
}

.side-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 80% at 50% 50%, rgba(14,12,26,0.2) 20%, rgba(14,12,26,0.97) 100%),
    linear-gradient(160deg, rgba(14,12,26,0.75) 0%, rgba(19,16,31,0.7) 60%, rgba(15,14,24,0.75) 100%);
}

.side-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem;
  margin-top: 2.5rem;
}

.side-card {
  background: var(--bg-card);
  border: 1px solid var(--border-s);
  border-radius: 20px; padding: 2rem;
  transition: border-color 0.2s, background 0.2s;
}
.side-card:hover {
  border-color: var(--border-a);
  background: var(--bg-card-h);
}

.side-card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}

.side-tag {
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em;
  color: var(--blue); text-transform: uppercase;
}

.side-link {
  font-size: 0.75rem; color: var(--text-3);
  text-decoration: none; font-family: var(--mono);
  transition: color 0.2s;
}
.side-link:hover { color: var(--text); }

.side-name {
  font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em;
  color: var(--text); margin-bottom: 0.75rem;
}

.side-desc {
  font-size: 0.9rem; color: var(--text-2); line-height: 1.7;
}

@media (max-width: 600px) {
  .side-grid { grid-template-columns: 1fr; }
}

/* ── Skills ─────────────────────────────────────── */
.skills-section {
  padding: var(--section-py) 0;
  background: var(--bg-1);
}

.skills-table {
  display: flex; flex-direction: column;
  margin-bottom: 4rem;
}

.sk-row {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 2rem; padding: 1.75rem 0;
  border-top: 1px solid var(--border-s);
  align-items: start;
}
.sk-row:last-child { border-bottom: 1px solid var(--border-s); }

.sk-cat {
  font-size: 0.76rem; font-weight: 500; color: var(--text-3);
  letter-spacing: 0.06em; text-transform: uppercase; padding-top: 0.15rem;
}

.sk-items {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
}
.sk-items span {
  font-size: 0.88rem; color: var(--text-2);
}

/* Cert strip */
.certs-strip {
  display: flex; gap: 0; align-items: center;
  background: var(--bg-2); border: 1px solid var(--border-s);
  border-radius: 18px; padding: 1.5rem 2rem; overflow: hidden;
}

.cert-item {
  flex: 1; display: flex; flex-direction: column; gap: 0.3rem; text-align: center;
}
.cert-name {
  font-size: 0.9rem; font-weight: 700; color: var(--text);
  letter-spacing: 0.04em;
}
.cert-info {
  font-size: 0.72rem; color: var(--text-3);
}

.cert-div {
  width: 1px; height: 36px; background: var(--border); flex-shrink: 0; margin: 0 1rem;
}

/* ── Contact ─────────────────────────────────────── */
.contact-section {
  padding: var(--section-py) 0;
  background: var(--black);
  text-align: center;
}

.contact-center { max-width: 680px; margin: 0 auto; }

.contact-heading {
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 700; letter-spacing: -0.04em; line-height: 0.95;
  color: var(--text); margin-bottom: 1.5rem;
}

.contact-sub {
  font-size: 1.05rem; font-weight: 300; color: var(--text-2);
  margin-bottom: 2.5rem; line-height: 1.7;
}

.contact-links {
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
}

.contact-row {
  display: flex; gap: 2rem; justify-content: center;
}

/* ── Footer ─────────────────────────────────────── */
.footer {
  padding: 1.75rem 0;
  border-top: 1px solid var(--border-s);
}
.footer-inner {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--text-3);
}

/* ── Scroll Reveal (Apple spring) ───────────────── */
.ap-rise {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity  0.8s cubic-bezier(0.16,1,0.3,1) var(--d, 0s),
    transform 0.8s cubic-bezier(0.16,1,0.3,1) var(--d, 0s);
}
.ap-rise.visible { opacity: 1; transform: translateY(0); }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 860px) {
  .career-row { grid-template-columns: 1fr 1fr; }
  .cr-center  { grid-column: 1 / -1; grid-row: 2; }
  .cr-right   { text-align: right; }
  .stats-row  { flex-wrap: wrap; }
  .stat-item  { min-width: 40%; }
  .stat-sep   { display: none; }
}

@media (max-width: 860px) {
  .chapter-split {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .chapter-img { max-width: 420px; animation: none; }
}

@media (max-width: 640px) {
  :root { --section-py: 80px; }
  .nav-links { display: none; }
  .career-row { grid-template-columns: 1fr; }
  .cr-right   { text-align: left; }
  .chapter-inner, .chapter-right { max-width: 100%; text-align: left; margin-left: 0; }
  .chapter-right .chapter-meta { justify-content: flex-start; }
  .chapter-right .chapter-metrics { justify-content: flex-start; }
  .chapter-right .chapter-desc { margin-left: 0; }
  .certs-strip { flex-direction: column; gap: 1.25rem; padding: 1.5rem; }
  .cert-div { width: 100%; height: 1px; margin: 0; }
  .sk-row { grid-template-columns: 1fr; gap: 0.75rem; }
  .footer-inner { flex-direction: column; gap: 0.4rem; text-align: center; }
  .contact-row { flex-direction: column; gap: 0.75rem; }
  .stats-row { flex-direction: column; align-items: stretch; }
  .stat-item { padding: 1rem 0; border-bottom: 1px solid var(--border-s); }
  .stat-item:last-child { border: none; }
}
