/* samhussain.dev. Light = cosmic latte, dark = espresso. */
:root {
  --bg: #fff8e7;
  --bg-2: #f8eed6;
  --bg-3: #f0e2c2;
  --card: #fffcf3;
  --line: #ecdfc3;
  --line-2: #dccaa4;
  --text: #2a2117;
  --muted: #6b5c45;
  --faint: #a08b6c;
  --accent: #b45309;
  --accent-2: #d97706;
  --accent-soft: rgba(180, 83, 9, 0.1);
  --bid: #15803d;
  --hot: #dc2626;
  --shadow: 0 1px 2px rgba(87, 62, 22, .06), 0 8px 24px -12px rgba(87, 62, 22, .18);
  --shadow-lg: 0 2px 4px rgba(87, 62, 22, .06), 0 24px 48px -20px rgba(87, 62, 22, .32);

  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --max: 1160px;
  --pad: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
html.dark {
  --bg: #15110e;
  --bg-2: #1e1914;
  --bg-3: #29221b;
  --card: #1b1612;
  --line: #2f271f;
  --line-2: #43382b;
  --text: #f3ead7;
  --muted: #b5a68b;
  --faint: #7d6e58;
  --accent: #e3a857;
  --accent-2: #f2c27f;
  --accent-soft: rgba(227, 168, 87, 0.13);
  --bid: #4ade80;
  --hot: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -20px rgba(0, 0, 0, .7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  font-family: var(--sans); font-size: 16.5px; line-height: 1.65;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background .25s ease, color .25s ease;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; }
img, video, canvas { display: block; max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--text); color: var(--bg); padding: 6px 10px; border-radius: 6px; }
code { font-family: var(--mono); font-size: .86em; background: var(--bg-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 800; letter-spacing: .02em;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { font-size: 14.5px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 8px; transition: color .15s, background .15s; }
.nav a:hover, .nav a.on { color: var(--text); background: var(--bg-2); }
.theme-toggle {
  margin-left: 6px; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.theme-toggle:hover { color: var(--text); background: var(--bg-2); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .sun, html.dark .theme-toggle .moon { display: none; }
html.dark .theme-toggle .sun { display: block; }

/* ---------- Shared bits ---------- */
.eyebrow { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--accent); letter-spacing: .02em; }
.h-section { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 4.2vw, 44px); letter-spacing: -.03em; line-height: 1.1; margin: 8px 0 12px; }
.sub { color: var(--muted); font-size: 17px; max-width: 38em; }
.section { padding: clamp(72px, 10vw, 112px) 0; }
.section-head { margin-bottom: 40px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 11px;
  font: 600 14.5px var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--card); color: var(--text);
  transition: transform .15s var(--ease), box-shadow .15s, border-color .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--faint); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { border-color: var(--text); }
.btn svg { width: 16px; height: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line-2); font-size: 13.5px; font-weight: 500; color: var(--muted);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bid); animation: ping 2.2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bid) 45%, transparent) } 80%, 100% { box-shadow: 0 0 0 8px transparent } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 7px; }

/* ---------- Hero ---------- */
.hero-zone { position: relative; overflow: hidden; }
.hero-zone > .wrap { position: relative; z-index: 1; }
.field {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent); mask-image: linear-gradient(to bottom, #000 60%, transparent);
}
.hero { padding-top: clamp(56px, 9vw, 104px); }
.hero h1 {
  font-family: var(--display); font-weight: 800; letter-spacing: -.045em; line-height: .98;
  font-size: clamp(44px, 8vw, 96px); margin: 22px 0 26px; max-width: 13ch;
}
.hero h1 .hl { position: relative; white-space: nowrap; color: var(--accent); }
.hero h1 .hl::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: .04em; height: .12em; border-radius: 4px;
  background: currentColor; opacity: .25; transform-origin: left; animation: underline 1s .4s var(--ease) both;
}
@keyframes underline { from { transform: scaleX(0) } }
.hero .sub { font-size: clamp(17px, 1.6vw, 19.5px); margin-bottom: 30px; max-width: 36em; }
.hero .sub strong { color: var(--text); font-weight: 600; }

.book {
  margin-top: clamp(48px, 7vw, 72px); position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, transparent, var(--bg-2));
}
.book canvas { width: 100%; height: clamp(220px, 30vw, 320px); cursor: crosshair; touch-action: pan-y; }
.book-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0 14px; font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.book-bar b { color: var(--muted); font-weight: 500; }
.book-bar .legend { display: flex; gap: 16px; }
.book-bar .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Highlights ---------- */
.highlights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding-top: 56px; }
.hl-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.hl-card b { display: block; font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -.03em; line-height: 1.1; }
.hl-card span { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* ---------- Project cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.card:hover, .card.live { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.card .stage { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.card .stage canvas { width: 100%; height: 100%; }
.card .stage .hint {
  position: absolute; right: 12px; bottom: 10px; font-family: var(--mono); font-size: 11px; color: var(--faint);
  transition: opacity .3s;
}
.card:hover .hint, .card.live .hint { opacity: 0; }
.card .body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.card .meta { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.card h3 { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -.025em; margin: 4px 0 8px; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.card p { color: var(--muted); font-size: 15.5px; }
.card .stat { margin: 14px 0 16px; font-size: 14px; color: var(--muted); }
.card .stat b { font-family: var(--mono); font-weight: 600; color: var(--accent); margin-right: 6px; }
.card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card .links { display: flex; gap: 14px; position: relative; z-index: 2; }
.card .links a { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--text); }
.card .links a:hover { color: var(--accent); }
.card .links a.primary { color: var(--accent); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.about .prose p { color: var(--muted); font-size: 17px; }
.about .prose p + p { margin-top: 14px; }
.about .prose strong { color: var(--text); font-weight: 600; }
.skills { display: grid; gap: 20px; }
.skills h4 { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--faint); margin-bottom: 8px; }
.skills .chip { font-size: 13px; padding: 5px 11px; background: var(--card); color: var(--text); }

/* ---------- Experience ---------- */
.xp { display: grid; gap: 12px; }
.xp-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; padding: 20px 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  transition: border-color .2s, transform .25s var(--ease);
}
.xp-item:hover { border-color: var(--line-2); transform: translateX(4px); }
.xp-item h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.xp-item .org { color: var(--accent); font-weight: 500; font-size: 15px; }
.xp-item .date { font-family: var(--mono); font-size: 13px; color: var(--faint); white-space: nowrap; grid-row: 1; grid-column: 2; padding-top: 2px; }
.xp-item p { grid-column: 1 / -1; color: var(--muted); font-size: 15.5px; }
.xp-item p a { color: var(--accent); font-weight: 500; text-decoration: none; }
.xp-item .badge { display: inline-block; margin-left: 8px; font-family: var(--mono); font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); vertical-align: 2px; }
.xp-group { font-family: var(--mono); font-size: 12.5px; color: var(--faint); margin: 36px 0 12px; }
.xp-group:first-child { margin-top: 0; }

/* ---------- Contact ---------- */
.contact {
  text-align: center; background: var(--text); color: var(--bg); border-radius: 28px;
  padding: clamp(48px, 8vw, 88px) var(--pad); position: relative; overflow: hidden;
}
.contact .h-section { font-size: clamp(32px, 5vw, 56px); max-width: 16ch; margin: 10px auto 14px; }
.contact p { color: color-mix(in srgb, var(--bg) 72%, transparent); max-width: 32em; margin: 0 auto 30px; font-size: 17px; }
.contact .eyebrow { color: var(--accent-2); }
html.dark .contact .eyebrow { color: var(--accent); }
.contact .btns { justify-content: center; }
.contact .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
.contact .btn:hover { border-color: var(--bg); box-shadow: none; }
.contact .btn-primary { background: var(--bg); color: var(--text); border-color: var(--bg); }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0 48px; color: var(--faint); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------- Case study pages ---------- */
.crumbs { font-size: 14px; color: var(--faint); padding-top: 40px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.cs-head { padding: 20px 0 36px; max-width: 820px; }
.cs-head h1 { font-family: var(--display); font-weight: 800; font-size: clamp(42px, 7vw, 76px); letter-spacing: -.045em; line-height: 1; margin: 10px 0 18px; }
.cs-head .sub { font-size: clamp(17px, 1.7vw, 20px); margin-bottom: 26px; }
.cs-stage { position: relative; aspect-ratio: 21 / 9; border-radius: 22px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.cs-stage canvas { width: 100%; height: 100%; }
.cs-stage .hint { position: absolute; right: 16px; bottom: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--faint); }

.cs-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 64px; padding: 64px 0 40px; align-items: start; }
.cs-aside { position: sticky; top: 92px; display: grid; gap: 22px; }
.cs-aside dt { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-bottom: 4px; }
.cs-aside dd { font-size: 15px; }
.cs-aside .nums { display: grid; gap: 12px; }
.cs-aside .num { border-left: 3px solid var(--accent); padding-left: 12px; }
.cs-aside .num b { display: block; font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -.02em; line-height: 1.15; }
.cs-aside .num span { font-size: 13.5px; color: var(--muted); line-height: 1.4; display: block; }
.cs-aside .links { display: grid; gap: 6px; }
.cs-aside .links a { font-weight: 600; font-size: 15px; text-decoration: none; color: var(--accent); }

.article h2 { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: -.025em; margin: 56px 0 14px; }
.article h2:first-child { margin-top: 0; }
.article p { color: var(--muted); font-size: 17px; }
.article p + p { margin-top: 14px; }
.article strong { color: var(--text); font-weight: 600; }
.article .lead { font-size: 21px; line-height: 1.5; color: var(--text); letter-spacing: -.01em; }
.points { list-style: none; display: grid; gap: 12px; margin-top: 18px; }
.points li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 16px 22px; position: relative; }
.points li::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--accent); }
.points h3 { font-size: 16.5px; font-weight: 600; margin-bottom: 3px; }
.points p { font-size: 15.5px; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 18px; }
table.data th { text-align: left; font-weight: 500; font-family: var(--mono); font-size: 12px; color: var(--faint); padding: 0 14px 10px 0; border-bottom: 1px solid var(--line-2); }
table.data td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
table.data tr.me td { color: var(--text); font-weight: 600; }
table.data td.ok { color: var(--bid); font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.scroll-x { overflow-x: auto; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.flow .step { background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; }
.flow .step b { display: block; font-size: 14.5px; font-weight: 600; }
.flow .step span { display: block; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.flow .step.key { background: var(--accent-soft); border-color: var(--accent); }
.flow .to { color: var(--faint); font-weight: 600; }
.shot { margin-top: 18px; }
.shot .frame { border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-2); box-shadow: var(--shadow); }
.shot .frame img, .shot .frame video { width: 100%; height: auto; }
.shot figcaption { font-size: 14px; color: var(--faint); margin-top: 8px; }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.next {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 24px 0 72px;
  padding: 28px 32px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); text-decoration: none;
  box-shadow: var(--shadow); transition: transform .3s var(--ease), box-shadow .3s;
}
.next:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.next small { font-family: var(--mono); font-size: 12.5px; color: var(--faint); display: block; }
.next b { font-family: var(--display); font-size: clamp(24px, 3vw, 32px); letter-spacing: -.025em; }
.next .arrow { width: 52px; height: 52px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; font-size: 22px; flex: none; transition: transform .3s var(--ease); }
.next:hover .arrow { transform: translateX(4px) rotate(-45deg); }

/* ---------- Motion ---------- */
.rise { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; transition: none; }
  .pill .dot, .hero h1 .hl::after { animation: none; }
  .card, .btn, .xp-item, .next { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 36px; }
  .cs-body { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; }
  .cs-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-aside .nums { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-stage { aspect-ratio: 16 / 10; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav a.opt { display: none; }
  .nav a { padding: 6px 8px; font-size: 14px; }
  .logo .name { display: none; }
  .highlights { gap: 10px; }
  .hl-card { padding: 16px; }
  .hl-card b { font-size: 22px; }
  .xp-item { grid-template-columns: 1fr; }
  .xp-item .date { grid-column: 1; grid-row: auto; }
  .cs-aside .nums { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
  .next { padding: 22px; }
  .card .body { padding: 18px 18px 20px; }
}

/* ======================================================================
   Home layout: full-screen intro, centred titles, alternating project rows
   ====================================================================== */
.intro { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; overflow: hidden; text-align: center; padding: 40px var(--pad); }
.intro .field { -webkit-mask-image: radial-gradient(ellipse at center, #000 55%, transparent 85%); mask-image: radial-gradient(ellipse at center, #000 55%, transparent 85%); }
.intro-inner { position: relative; z-index: 1; }
.intro h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 5.4vw, 66px); letter-spacing: -.03em; line-height: 1.18; }
.intro h1 .accent { color: var(--accent); font-weight: 600; }
.intro h1 em { font-style: normal; font-weight: 600; }
.intro-sub { margin: 18px auto 34px; color: var(--muted); font-size: clamp(15px, 1.5vw, 18px); }
.btn-line {
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 24px; border: 2px solid var(--accent); color: var(--accent);
  font: 600 16px var(--sans); text-decoration: none; transition: background .2s, color .2s;
}
.btn-line:hover { background: var(--accent); color: var(--bg); }
.btn-line svg { width: 17px; height: 17px; transition: transform .25s var(--ease); }
.btn-line:hover svg { transform: translateY(3px); }

.wrap.narrow { max-width: 860px; }
.title { text-align: center; margin-bottom: 56px; }
.title h2 { display: inline-block; position: relative; isolation: isolate; font-family: var(--display); font-weight: 800; font-size: clamp(38px, 5vw, 54px); letter-spacing: -.035em; line-height: 1.1; }
.title h2::after { content: ''; position: absolute; z-index: -1; left: 18%; right: -8%; bottom: .08em; height: .32em; background: var(--accent); opacity: .85; transform-origin: left; transform: scaleX(0); transition: transform .8s .2s var(--ease); }
.title.in h2::after { transform: scaleX(1); }
.title p { color: var(--muted); max-width: 34em; margin: 14px auto 0; font-size: 17px; }

#about .highlights { padding-top: 64px; }

.proj { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding: 48px 0; }
.proj.flip .visual { order: 2; }
.visual { position: relative; padding: clamp(28px, 4vw, 48px) 0; }
.visual::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -100vw; right: 22%; background: var(--accent); z-index: 0;
  transform: scaleX(0); transform-origin: right; transition: transform 1s var(--ease);
}
.proj.flip .visual::before { left: 22%; right: -100vw; transform-origin: left; }
.proj.in .visual::before { transform: scaleX(1); }
.screen { position: relative; z-index: 1; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); transition: transform .4s var(--ease); }
.card-row:hover .screen, .card-row.live .screen { transform: translateY(-4px); }
.screen canvas { width: 100%; height: 100%; }
.screen.interactive canvas { cursor: crosshair; touch-action: pan-y; }
.screen .hint { position: absolute; right: 12px; bottom: 9px; font-family: var(--mono); font-size: 11px; color: var(--faint); transition: opacity .3s; pointer-events: none; }
.proj .meta { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.proj h3 { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 3.4vw, 42px); letter-spacing: -.035em; line-height: 1.05; margin: 8px 0 16px; }
.proj h3 span { color: var(--accent); }
.proj p { color: var(--muted); font-size: 16.5px; }
.proj p strong { color: var(--text); font-weight: 600; }
.proj .links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; }
.proj .links a {
  font-size: 13.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  padding: 4px 2px; border-bottom: 2px solid var(--accent); transition: color .2s, padding .2s;
}
.proj .links a:hover { color: var(--accent); padding-left: 8px; padding-right: 8px; }

.contact-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.site-footer { text-align: center; border-top: 1px solid var(--line); margin-top: 40px; }
.site-footer .wrap { flex-direction: column; align-items: center; gap: 14px; }
.to-top { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); font-size: 18px; text-decoration: none; transition: transform .2s var(--ease), border-color .2s; }
.to-top:hover { transform: translateY(-3px); border-color: var(--accent); }

@media (max-width: 900px) {
  .proj { grid-template-columns: 1fr; gap: 24px; padding: 32px 0; }
  .proj.flip .visual { order: 0; }
  .visual::before, .proj.flip .visual::before { left: -100vw; right: 12%; }
  .about .mark { margin-left: auto; margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .visual::before, .title h2::after { transform: none !important; transition: none; }
}
#projects { overflow-x: clip; }
@supports not (overflow: clip) { #projects { overflow-x: hidden; } }
.screen.interactive .hint { top: 9px; left: 12px; right: auto; bottom: auto; }

/* Real project media in the alternating rows */
.screen.media { aspect-ratio: 16 / 9; background: #0f0d0b; }
.screen.media img, .screen.media video { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.screen.media.top img { object-position: left top; }
.inset {
  position: absolute; z-index: 2; width: 36%; right: -3%; bottom: 6%; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); background: #0f0d0b;
  transition: transform .4s var(--ease);
}
.inset.light { background: #fff; width: 26%; }
.inset img, .inset video { width: 100%; height: auto; }
.proj.flip .inset { right: auto; left: -3%; }
.card-row:hover .inset { transform: translateY(-8px) rotate(-1deg); }
@media (max-width: 900px) { .inset { right: 2%; } .proj.flip .inset { left: 2%; } }
.cs-stage.media { aspect-ratio: 16 / 9; background: #0f0d0b; }
.cs-stage.media img, .cs-stage.media video { width: 100%; height: 100%; object-fit: cover; }
.cs-stage.media.top img { object-position: left top; }
.cs-caption { font-size: 14px; color: var(--faint); margin-top: 10px; }

/* Full-width nav bar: links on the right, active section in the accent colour */
.site-header {
  background: var(--bg-2); border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18); backdrop-filter: none; -webkit-backdrop-filter: none;
}
.site-header .wrap { max-width: none; height: 60px; justify-content: flex-end; padding: 0 clamp(16px, 5vw, 100px); }
.site-header .logo { display: none; }
.nav { gap: 8px; }
.nav a { font-size: 17px; font-weight: 500; letter-spacing: .02em; color: var(--text); padding: 6px 12px; transition: color .2s; }
.nav a:hover, .nav a.on { color: var(--accent); background: none; }
@media (max-width: 600px) {
  .nav { gap: 2px; }
  .nav a { font-size: 15px; padding: 6px 7px; }
}

/* About: "S" mark and logo tiles */
.mark {
  width: 132px; height: 132px; border-radius: 30px; display: grid; place-items: center; margin-bottom: 28px;
  background: #2a2117; color: #e3a857; font-family: var(--display); font-weight: 800; font-size: 82px; line-height: 1;
  border: 3px solid var(--accent); box-shadow: var(--shadow-lg);
}
.skills-wrap { align-self: center; }
.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 500px; margin: 36px auto 0; }
.skill-grid .col { display: grid; gap: 18px; align-content: start; }
.skill-grid .col:nth-child(2) { transform: translateY(-36px); }
.tech {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 14px 6px 11px;
  border-radius: 10px; border: 2px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(135deg, var(--accent-2), var(--hot)) border-box;
  transition: transform .25s var(--ease), box-shadow .25s;
}
.tech:hover { transform: translateY(-5px); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--hot) 55%, transparent); }
.tech img { width: 44px; height: 44px; }
html.dark .tech img.inv { filter: invert(1) hue-rotate(180deg) brightness(1.3); }
.tech span { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.skill-also { text-align: center; font-family: var(--mono); font-size: 12.5px; color: var(--faint); margin-top: 18px; }
@media (max-width: 600px) {
  .skill-grid, .skill-grid .col { gap: 12px; }
  .skill-grid .col:nth-child(2) { transform: translateY(-20px); }
  .tech img { width: 36px; height: 36px; }
  .tech span { font-size: 10px; letter-spacing: .04em; }
}
@media (prefers-reduced-motion: reduce) { .tech { transition: none; } }

html.dark .tech img.lift { background: #fff8e7; border-radius: 8px; padding: 4px; }

/* Profile photo sits over the S mark; if the file is missing the S shows */
.mark { position: relative; overflow: hidden; }
.mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
