/* ==========================================================================
   Osama Abutaha — Portfolio
   Plain CSS, no build step. Colours live in tokens below; dark mode swaps them.
   ========================================================================== */

:root {
  --bg: #f6f3ed;
  --bg-2: #efeae1;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #17140f;
  --ink-2: #2d2820;
  --muted: #5d5549;
  --faint: #6b6256;
  --line: rgba(23, 20, 15, 0.10);
  --line-strong: rgba(23, 20, 15, 0.18);
  --accent: #b8361c;
  --accent-ink: #ffffff;
  --accent-soft: rgba(184, 54, 28, 0.10);
  --green: #1e6b57;
  --green-soft: rgba(30, 107, 87, 0.10);
  --shadow-sm: 0 1px 2px rgba(23, 20, 15, 0.06), 0 2px 8px rgba(23, 20, 15, 0.04);
  --shadow-md: 0 10px 30px -10px rgba(23, 20, 15, 0.18), 0 2px 6px rgba(23, 20, 15, 0.05);
  --shadow-lg: 0 30px 80px -24px rgba(23, 20, 15, 0.28), 0 8px 20px -8px rgba(23, 20, 15, 0.10);
  --frame-bar: #ece7de;
  --code-bg: #14120f;

  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e0d0b;
  --bg-2: #151310;
  --surface: #191714;
  --surface-2: #1f1c18;
  --ink: #f4efe7;
  --ink-2: #e2dbd0;
  --muted: #b0a698;
  --faint: #958b7e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #ff7556;
  --accent-ink: #1a0d08;
  --accent-soft: rgba(255, 117, 86, 0.12);
  --green: #5fc7a8;
  --green-soft: rgba(95, 199, 168, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --frame-bar: #24211d;
  --code-bg: #0b0a09;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { fill: currentColor; stroke: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mono { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .6; }
.serif { font-family: var(--font-display); }
.accent { color: var(--accent); }
em.accent, .hero h1 em { font-style: italic; }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .82rem 1.25rem; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-weight: 600; font-size: .95rem; line-height: 1;
  transition: transform .25s var(--ease), background-color .25s, border-color .25s, color .25s, box-shadow .25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); border-color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -10px var(--accent); }
.btn-ghost { background: transparent; }
.btn-sm { padding: .62rem 1rem; font-size: .88rem; }
.btn .icon { transition: transform .25s var(--ease); }
.btn:hover .icon-arrow { transform: translateX(3px); }
.btn[aria-disabled="true"] {
  cursor: default; color: var(--faint); border-style: dashed; transform: none; background: transparent;
}

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  transition: border-color .2s, background-color .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--ink); transform: translateY(-1px); }

.tag {
  display: inline-flex; align-items: center;
  padding: .32rem .7rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .78rem; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; }

.status {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 600; color: var(--green);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px var(--green-soft); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background-color .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { display: block; width: auto; height: 40px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .18)); transition: transform .3s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }
.nav-links { display: flex; align-items: center; gap: .25rem; list-style: none; }
.nav-links a {
  position: relative; display: block; padding: .5rem .85rem; border-radius: 999px;
  font-size: .92rem; font-weight: 500; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active { background: var(--surface); box-shadow: var(--shadow-sm); }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
.menu-toggle { display: none; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding: clamp(80px, 11vw, 140px) 0; }
.section-head { display: grid; gap: 1.1rem; max-width: 760px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head h2 { font-family: var(--font-display); font-size: clamp(2.4rem, 5.4vw, 4rem); }
.section-head p { color: var(--muted); font-size: 1.08rem; max-width: 620px; }
.section-head.split { max-width: none; grid-template-columns: 1fr auto; align-items: end; }

/* ---------- Hero ---------- */
.hero { padding: clamp(120px, 15vw, 168px) 0 clamp(64px, 8vw, 96px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(40rem 26rem at -10% 30%, var(--green-soft), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy { display: grid; gap: 1.6rem; justify-items: start; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 7.6vw, 6.4rem);
  line-height: .95; letter-spacing: -0.025em;
}
.hero h1 .line { display: block; }
.hero-lede { font-size: clamp(1.06rem, 1.5vw, 1.22rem); color: var(--muted); max-width: 33rem; }
.hero-lede strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.hero-socials { display: flex; gap: .5rem; }
.hero-facts {
  display: grid; grid-template-columns: repeat(3, auto); gap: 0; margin-top: .6rem;
  border-top: 1px solid var(--line); padding-top: 1.4rem; width: 100%;
}
.fact { padding-right: 1.6rem; }
.fact + .fact { padding-left: 1.6rem; border-left: 1px solid var(--line); }
.fact strong { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 400; line-height: 1; }
.fact span { display: block; margin-top: .4rem; font-size: .82rem; color: var(--muted); line-height: 1.35; }

.hero-stage { position: relative; aspect-ratio: 1 / .86; perspective: 1600px; }
.hero-stage .frame { position: absolute; transition: transform .6s var(--ease); will-change: transform; }
.stage-main { inset: 4% 0 auto 6%; width: 94%; transform: rotate(1.2deg); }
.stage-phone { left: -2%; bottom: -2%; width: 27%; transform: rotate(-4deg); }
.stage-chip {
  position: absolute; right: -2%; bottom: 10%;
  display: grid; gap: .25rem; padding: .9rem 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-size: .82rem; color: var(--muted); max-width: 240px;
  transition: transform .6s var(--ease);
}
.stage-chip strong { color: var(--ink); font-size: .95rem; }
.stage-chip .status { font-size: .74rem; }

/* ---------- Device frames ---------- */
.frame { border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.frame img { width: 100%; height: auto; }
.frame-bar {
  display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  background: var(--frame-bar); border-bottom: 1px solid var(--line);
}
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.frame-bar i:nth-child(1) { background: #ff5f57; }
.frame-bar i:nth-child(2) { background: #febc2e; }
.frame-bar i:nth-child(3) { background: #28c840; }
.frame-bar .url {
  flex: 1; margin-left: 10px; height: 18px; border-radius: 6px; max-width: 60%;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-family: var(--font-mono); font-size: 10px; line-height: 18px; padding: 0 8px; color: var(--faint);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.frame-window .frame-bar { justify-content: flex-start; }
.frame-window .frame-bar .title { margin-left: 8px; font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.frame-phone {
  border-radius: 30px; padding: 7px; background: #111; border: 1px solid #000;
}
.frame-phone img { border-radius: 24px; }
.frame-terminal { background: #0c0c0c; border-color: #000; }
.frame-terminal .frame-bar { background: #1c1c1c; border-color: #000; }
.frame-none { box-shadow: var(--shadow-md); background: #fff; }

/* ---------- Featured work ---------- */
.featured-list { display: grid; gap: clamp(72px, 10vw, 128px); }
.feature { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.feature:nth-child(even) .feature-media { order: 2; }
.feature-media { position: relative; display: block; }
.feature-media .frame { transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
.feature-media:hover .frame { transform: translateY(-6px); }
.feature-media .media-phone { position: absolute; right: -4%; bottom: -10%; width: 26%; transform: rotate(3deg); }
.feature-media.poster { display: grid; place-items: center; padding: clamp(16px, 4vw, 36px); border-radius: var(--radius-lg); background: var(--bg-2); border: 1px solid var(--line); }
.feature-media.poster .frame { width: min(64%, 360px); transform: rotate(-2deg); }
.feature-media.poster:hover .frame { transform: rotate(0) translateY(-6px); }
.feature-media.poster::after {
  content: ""; position: absolute; width: min(56%, 320px); aspect-ratio: .7; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md);
  transform: rotate(5deg) translate(12%, 2%); z-index: 0;
}
.feature-media.poster .frame { position: relative; z-index: 1; }

.feature-body { display: grid; gap: 1.25rem; justify-items: start; }
.feature-index { display: flex; align-items: center; gap: .9rem; }
.feature-index .num { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--accent); }
.feature h3 { font-family: var(--font-display); font-size: clamp(2rem, 3.6vw, 3rem); }
.feature h3 a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .4s var(--ease); }
.feature h3 a:hover { background-size: 100% 1px; }
.feature-tagline { font-size: 1.1rem; color: var(--ink-2); }
.feature-summary { color: var(--muted); }
.feature-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .86rem; color: var(--muted); }
.feature-meta span { display: inline-flex; gap: .4rem; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; border-block: 1px solid var(--line); }
.stat { padding: 1rem 1rem 1rem 0; }
.stat + .stat { padding-left: 1rem; border-left: 1px solid var(--line); }
.stat strong { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 400; line-height: 1; }
.stat span { display: block; margin-top: .35rem; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- Project grid ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.filter {
  padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  font-size: .88rem; font-weight: 500; color: var(--muted); transition: all .2s;
}
.filter:hover { color: var(--ink); border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter .count { margin-left: .35rem; font-family: var(--font-mono); font-size: .72rem; opacity: .85; }
.search { position: relative; }
.search input {
  width: min(280px, 100%); padding: .62rem 1rem .62rem 2.4rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem;
}
.search input::placeholder { color: var(--faint); }
.search .icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--faint); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.card {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .8s var(--ease); }
.card:hover .card-thumb img { transform: scale(1.04); }
.card-thumb.fit-contain { display: grid; place-items: center; padding: 14px; background: #fff; }
.card-thumb.fit-contain img { object-fit: contain; }
.card-body { display: grid; gap: .7rem; padding: 1.3rem 1.4rem 1.5rem; flex: 1; align-content: start; }
.card-kicker { display: flex; justify-content: space-between; gap: .5rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.card h3 { font-family: var(--font-display); font-size: 1.65rem; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card p { color: var(--muted); font-size: .95rem; }
.card .tags { margin-top: .3rem; }
.card .tag { font-size: .72rem; padding: .25rem .6rem; }
.card-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: .3rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 600;
  background: var(--ink); color: var(--bg);
}
.empty { grid-column: 1 / -1; padding: 3rem; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.portrait { position: relative; margin: 0; }
.portrait figcaption { margin-top: .9rem; font-size: .82rem; color: var(--faint); }
.about-copy { display: grid; gap: 1.4rem; }
.about-copy .lead { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.2; }
.about-copy p { color: var(--muted); }
.about-copy p strong { color: var(--ink); font-weight: 600; }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); margin-top: .6rem; }
.info { padding: 1.1rem 1rem 1.1rem 0; border-bottom: 1px solid var(--line); }
.info:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--line); }
.info dt { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.info dd { margin: .3rem 0 0; font-weight: 600; font-size: .98rem; }
.now { padding: 1.3rem 1.4rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.now h3 { font-family: var(--font-body); font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.now ul { list-style: none; display: grid; gap: .4rem; color: var(--muted); font-size: .94rem; }
.now li::before { content: "→ "; color: var(--accent); }

/* ---------- Experience ---------- */
.exp-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
.col-title { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.timeline { list-style: none; border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 1.2rem; padding: 1.35rem 0; border-bottom: 1px solid var(--line); }
.timeline .when { font-family: var(--font-mono); font-size: .76rem; color: var(--faint); padding-top: .2rem; }
.timeline h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; line-height: 1.35; }
.timeline .org { color: var(--muted); font-size: .92rem; margin-top: .15rem; }
.timeline p { color: var(--muted); font-size: .92rem; margin-top: .45rem; }
.awards { list-style: none; display: grid; gap: .8rem; }
.award {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 1rem; align-items: start;
  padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.award .badge { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.award .badge .icon { width: 1.3rem; height: 1.3rem; }
.award h3 { font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1.35; }
.award p { color: var(--muted); font-size: .88rem; margin-top: .2rem; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.skill-group { padding: 1.6rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.skill-group h3 { font-family: var(--font-display); font-size: 1.7rem; margin-bottom: .3rem; }
.skill-group > p { color: var(--muted); font-size: .9rem; margin-bottom: 1.1rem; }
.skill-list { list-style: none; display: grid; gap: 0; }
.skill-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); font-size: .95rem; }
.skill-list li span:first-child { font-weight: 600; }
.skill-list li span:last-child { color: var(--faint); font-size: .82rem; text-align: right; }

/* ---------- Education ---------- */
.edu-card {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(28px, 5vw, 64px);
  padding: clamp(24px, 4vw, 48px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line);
}
.edu-main h3 { font-family: var(--font-display); font-size: clamp(2rem, 3.4vw, 2.7rem); }
.edu-main .org { color: var(--muted); margin-top: .4rem; }
.gpa { display: flex; align-items: baseline; gap: .6rem; margin-top: 1.6rem; }
.gpa strong { font-family: var(--font-display); font-size: 4.2rem; line-height: 1; font-weight: 400; }
.gpa span { color: var(--muted); font-size: .9rem; }
.edu-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.course-groups { display: grid; gap: 1.3rem; }
.course-group h4 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: .6rem; }
.course-group .tag.now-tag { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.legend { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); display: inline-block; }

/* ---------- Contact ---------- */
.contact { padding-top: clamp(24px, 4vw, 48px); padding-bottom: clamp(48px, 6vw, 72px); }
.contact-card {
  position: relative; overflow: hidden;
  padding: clamp(32px, 6vw, 80px); border-radius: calc(var(--radius-lg) + 8px);
  background: var(--ink); color: var(--bg);
}
.contact-card::before {
  content: ""; position: absolute; inset: auto -10% -60% auto; width: 60%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 65%);
  opacity: .55; pointer-events: none;
}
.contact-card .eyebrow { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.contact-card h2 { font-family: var(--font-display); font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: .95; margin: 1rem 0 1.2rem; max-width: 14ch; }
.contact-card > p { color: color-mix(in srgb, var(--bg) 72%, transparent); max-width: 34rem; font-size: 1.08rem; }
.contact-links { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: 2.4rem; max-width: 760px; }
.contact-link {
  display: flex; align-items: center; gap: .9rem; padding: 1rem 1.2rem; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--bg) 18%, transparent);
  transition: background-color .25s, border-color .25s, transform .25s var(--ease);
}
.contact-link:hover { background: color-mix(in srgb, var(--bg) 8%, transparent); border-color: color-mix(in srgb, var(--bg) 40%, transparent); transform: translateY(-2px); }
.contact-link .icon { width: 1.3rem; height: 1.3rem; color: var(--accent); }
.contact-link small { display: block; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .07em; text-transform: uppercase; opacity: .6; }
.contact-link span { font-weight: 600; overflow-wrap: anywhere; }

.footer { padding: 2rem 0 2.6rem; color: var(--faint); font-size: .86rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-links { display: flex; gap: .4rem; }

/* ---------- Case study page ---------- */
.cs-hero { padding: clamp(112px, 14vw, 150px) 0 clamp(36px, 5vw, 56px); }
.cs-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(50rem 26rem at 90% -10%, var(--accent-soft), transparent 60%);
}
.back-link { display: flex; width: max-content; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); margin-bottom: 2rem; }
.back-link:hover { color: var(--ink); }
.back-link .icon { transform: rotate(180deg); }
.cs-hero h1 { font-family: var(--font-display); font-size: clamp(2.8rem, 7vw, 5.6rem); line-height: .98; letter-spacing: -0.02em; margin: 1.1rem 0 1.3rem; max-width: 16ch; }
.cs-tagline { font-size: clamp(1.1rem, 1.8vw, 1.35rem); color: var(--muted); max-width: 46rem; }
.cs-meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 2.6rem;
  border-top: 1px solid var(--line);
}
.cs-meta div { padding: 1.1rem 1.2rem 1.1rem 0; border-bottom: 1px solid var(--line); }
.cs-meta div + div { padding-left: 1.2rem; border-left: 1px solid var(--line); }
.cs-meta dt { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.cs-meta dd { margin: .35rem 0 0; font-weight: 600; font-size: .95rem; line-height: 1.4; }
.cs-actions { margin-top: 1.8rem; }
.cs-cover { margin-top: clamp(28px, 4vw, 48px); }
.cs-cover .frame { max-width: 1100px; margin-inline: auto; }
.cs-cover.poster .frame { max-width: 520px; }
.cs-cover-pair { position: relative; max-width: 1100px; margin-inline: auto; }
.cs-cover-pair .frame-phone { position: absolute; right: -2%; bottom: -8%; width: 22%; }

.cs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); padding: clamp(56px, 8vw, 96px) 0; }
.toc { position: sticky; top: 100px; align-self: start; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; border-left: 1px solid var(--line); }
.toc a { display: block; padding: .38rem 0 .38rem 1rem; margin-left: -1px; border-left: 1px solid transparent; font-size: .88rem; color: var(--muted); transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
.cs-article { display: grid; gap: clamp(48px, 7vw, 80px); min-width: 0; }
.cs-section { display: grid; gap: 1.2rem; scroll-margin-top: 100px; }
.cs-section h2 { font-family: var(--font-display); font-size: clamp(2rem, 3.6vw, 2.8rem); }
.cs-section > p { color: var(--ink-2); font-size: 1.06rem; max-width: 46rem; }
.cs-section .kicker { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.ps-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.ps-card { padding: 1.6rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: .7rem; align-content: start; }
.ps-card h3 { font-family: var(--font-body); font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: .55rem; }
.ps-card p { color: var(--muted); }
.feature-list { list-style: none; display: grid; gap: 0; counter-reset: f; border-top: 1px solid var(--line); }
.feature-list li { counter-increment: f; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: .6rem; padding: 1rem 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.feature-list li::before { content: counter(f, decimal-leading-zero); font-family: var(--font-mono); font-size: .78rem; color: var(--faint); padding-top: .2rem; }
.arch { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.arch-item { padding: 1.3rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); position: relative; }
.arch-item h3 { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: .5rem; }
.arch-item p { color: var(--muted); font-size: .93rem; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 500; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td:last-child { font-weight: 700; color: var(--green); }
.table-caption { font-size: .85rem; color: var(--faint); }
.bullets { list-style: none; display: grid; gap: .8rem; }
.bullets li { position: relative; padding-left: 1.6rem; color: var(--ink-2); }
.bullets li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.role-card { padding: clamp(22px, 3vw, 32px); border-radius: var(--radius-lg); background: var(--ink); color: var(--bg); }
.role-card p { color: color-mix(in srgb, var(--bg) 82%, transparent); font-size: 1.04rem; }
.role-card .team { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid color-mix(in srgb, var(--bg) 16%, transparent); font-size: .9rem; color: color-mix(in srgb, var(--bg) 65%, transparent); }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.gallery figure { margin: 0; display: grid; gap: .7rem; align-content: start; }
.gallery figure.wide { grid-column: 1 / -1; }
.gallery button.zoom { padding: 0; border: 0; background: none; display: block; width: 100%; text-align: left; cursor: zoom-in; border-radius: 14px; }
.gallery .frame { transition: transform .4s var(--ease); }
.gallery button.zoom:hover .frame { transform: translateY(-4px); }
.gallery .frame-phone { max-width: 300px; margin-inline: auto; }
.gallery .tall img { max-height: 640px; object-fit: cover; object-position: top; }
.gallery figcaption { font-size: .86rem; color: var(--muted); }
.links-list { display: flex; flex-wrap: wrap; gap: .6rem; }
.pending-note { font-size: .88rem; color: var(--muted); }

.cs-next { border-top: 1px solid var(--line); padding: clamp(40px, 6vw, 64px) 0; }
.cs-next-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cs-next a { display: grid; gap: .4rem; padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--line); transition: border-color .2s, transform .3s var(--ease), background-color .2s; }
.cs-next a:hover { border-color: var(--ink); transform: translateY(-3px); background: var(--surface); }
.cs-next a.next { text-align: right; }
.cs-next small { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.cs-next strong { font-family: var(--font-display); font-weight: 400; font-size: 1.8rem; line-height: 1.1; }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(10, 9, 8, .88); backdrop-filter: blur(6px); }
.lightbox img { max-width: 96vw; max-height: 86vh; width: auto; height: auto; border-radius: 10px; background: #fff; }
.lightbox p { color: #e9e3d9; text-align: center; font-size: .9rem; margin-top: .8rem; }
.lightbox .close { position: fixed; top: 16px; right: 16px; color: #fff; border-color: rgba(255,255,255,.35); background: rgba(0,0,0,.4); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-meta div:nth-child(3) { padding-left: 0; border-left: 0; }
}

@media (max-width: 900px) {
  .nav-links {
    position: fixed; inset: 72px 12px auto 12px; flex-direction: column; align-items: stretch; gap: .2rem;
    padding: .7rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .25s, transform .25s var(--ease);
  }
  .nav-links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: .8rem 1rem; font-size: 1rem; }
  .nav-links a.active { box-shadow: none; background: var(--surface-2); }
  .menu-toggle { display: inline-grid; }
  .hero-grid, .about-grid, .exp-grid, .edu-card { grid-template-columns: 1fr; }
  .hero-stage { max-width: 640px; width: 100%; margin-inline: auto; }
  .feature, .feature:nth-child(even) { grid-template-columns: 1fr; }
  .feature:nth-child(even) .feature-media { order: 0; }
  .portrait { max-width: 420px; }
  .cs-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .section-head.split { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .grid, .skills-grid, .ps-grid, .gallery, .contact-links, .cs-next-grid { grid-template-columns: 1fr; }
  .hero-facts { grid-template-columns: 1fr 1fr 1fr; }
  .fact { padding-right: .8rem; }
  .fact + .fact { padding-left: .8rem; }
  .fact strong { font-size: 1.6rem; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat strong { font-size: 1.5rem; }
  .stat + .stat { padding-left: .7rem; }
  .info-list { grid-template-columns: 1fr; }
  .info:nth-child(even) { padding-left: 0; border-left: 0; }
  .timeline li { grid-template-columns: 1fr; gap: .3rem; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .search, .search input { width: 100%; }
  .stage-chip { display: none; }
  .cs-next a.next { text-align: left; }
  .feature-media .media-phone { right: 2%; width: 28%; }
  .cs-cover-pair .frame-phone { right: 2%; }
  th, td { padding: .75rem .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Portrait flip (photo <-> Bitmoji) ---------- */
.portrait { max-width: 340px; }
.flip { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1400px; border-radius: var(--radius-lg); }
.flip-inner { position: relative; display: block; aspect-ratio: 4 / 5; transform-style: preserve-3d; transition: transform .8s var(--ease); }
.flip[aria-pressed="true"] .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; display: block; overflow: hidden; border-radius: var(--radius-lg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); background: var(--surface);
}
.flip-face img { width: 100%; height: 100%; object-fit: cover; }
.flip-front img { object-position: center 30%; }
.flip-back { transform: rotateY(180deg); background: transparent; border: 0; box-shadow: none; overflow: visible; }
.flip-back img { object-fit: contain; object-position: center bottom; }
.flip:hover .flip-inner { box-shadow: none; }
.flip:hover .flip-front { box-shadow: var(--shadow-lg), 0 0 0 1px var(--line-strong); }
.flip:focus-visible { outline-offset: 6px; }
.portrait figcaption { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.flip-hint { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); }
.flip-hint::before { content: "↻"; color: var(--accent); font-size: 1rem; line-height: 1; }

/* ---------- Bitmoji on the contact card (free-standing, centred) ---------- */
.contact-card { display: grid; grid-template-columns: minmax(0, 1fr) clamp(200px, 20vw, 250px); column-gap: clamp(24px, 4vw, 56px); align-items: center; }
.contact-card > :not(.contact-bitmoji) { grid-column: 1; position: relative; z-index: 2; }
.contact-card .contact-links { max-width: none; }
.contact-bitmoji {
  grid-column: 2; grid-row: 1 / span 4; align-self: center; justify-self: center;
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .18));
}

/* ---------- Certificates ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.cert {
  display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.cert:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.cert-thumb { position: relative; display: block; width: 100%; padding: 0; border: 0; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); cursor: zoom-in; border-bottom: 1px solid var(--line); }
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .6s var(--ease); }
.cert:hover .cert-thumb img { transform: scale(1.04); }
.cert-thumb.noimg { cursor: default; display: grid; place-items: center; background: linear-gradient(135deg, var(--bg-2), var(--surface-2)); }
.cert-thumb.noimg span { font-family: var(--font-display); font-style: italic; font-size: 2.6rem; color: var(--accent); opacity: .7; }
.cert-body { display: grid; gap: .45rem; padding: 1rem 1.1rem 1.15rem; align-content: start; }
.cert-meta { display: flex; justify-content: space-between; gap: .5rem; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.cert h3 { font-family: var(--font-body); font-weight: 600; font-size: .98rem; line-height: 1.35; }
.cert .issuer { color: var(--muted); font-size: .88rem; }
.cert .verify { display: inline-flex; align-items: center; gap: .35rem; margin-top: .2rem; font-size: .82rem; font-weight: 600; color: var(--green); width: max-content; }
.cert .verify:hover { text-decoration: underline; }
.cert-more { grid-column: 1 / -1; justify-self: center; margin-top: .6rem; }

@media (max-width: 1080px) { .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .contact-card { grid-template-columns: 1fr; } .contact-bitmoji { grid-column: 1; grid-row: auto; order: -1; width: 170px; margin-bottom: 1.5rem; } }
@media (max-width: 640px) {
  .cert-grid { grid-template-columns: 1fr; }
  .contact-card { grid-template-columns: 1fr; }
  .contact-bitmoji { grid-column: 1; grid-row: auto; width: 150px; justify-self: center; margin-bottom: 1.5rem; order: -1; }
  .portrait { max-width: 300px; margin-inline: auto; }
}
main:focus { outline: none; }
/* Swap faces at the midpoint of the flip so the photo card's shadow never shows behind the Bitmoji */
.flip-front, .flip-back { transition: visibility 0s linear .38s, box-shadow .3s; }
.flip-back { visibility: hidden; }
.flip[aria-pressed="true"] .flip-front { visibility: hidden; }
.flip[aria-pressed="true"] .flip-back { visibility: visible; }
.contact-card .contact-links { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
