/* League Spartan is self-hosted as fixed 700/800 files, not Google's variable font,
   so the heavy weight shows the same in every browser */
@font-face { font-family: "League Spartan"; src: url("../fonts/league-spartan-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "League Spartan"; src: url("../fonts/league-spartan-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

/* Dark, cinematic. The opening screen is Earl's own game scenes drifting slowly behind the intro;
   the rest is a quiet dark page where the screenshots carry the colour.
   Type: League Spartan for the name (from his CV), Roboto for everything else, at reading sizes. */
:root {
  --max: 1240px;
  --m: max(20px, calc((100vw - var(--max)) / 2));   /* outer margin; wider screens centre the column */
  --g: 20px;                                        /* gap between columns */
  color-scheme: dark;
  --bg: #0b0b0c;
  --bg-rgb: 11, 11, 12;
  --bg-2: #141416;
  --ink: #ececea;
  --text-2: #cfcfcc;         /* secondary body text */
  --muted: #8d8d8a;
  --hair: #242426;
  --line: #3a3a3d;
  --shadow: rgba(0, 0, 0, .5);
  --accent: #f2b544;         /* the warm dusk light from the Blind Cargo cab, used sparingly */
  --display: "League Spartan", "Helvetica Neue", Arial, sans-serif;
  --text: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 56px; overflow-x: clip; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 var(--text); -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums; overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line); }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 6px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 6px; }
[hidden] { display: none !important; }

/* ---------- Top bar: floats over the hero, turns solid once you scroll ---------- */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  /* three columns: an empty left side balances the toggle, so the links sit at the true centre */
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--g);
  padding: 14px var(--m); font-size: 14px; line-height: 1.3;
  /* over the hero: clear, light text, darkening as you start to scroll (--bar 0 -> 1) */
  --bar: 0;
  color: #ececea;
  background: rgba(11, 11, 12, calc(var(--bar) * .7));
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: blur(calc(var(--bar) * 12px));
  backdrop-filter: blur(calc(var(--bar) * 12px));
  transition: background-color .3s, color .3s, border-color .3s;
}
.bar:not(.is-solid) .bar-links a { color: #b9b9b5; }
.bar:not(.is-solid) .bar-links a:hover, .bar:not(.is-solid) .bar-links a.is-current { color: #fff; }
/* past the hero: the page's own background and text, in either theme */
.bar.is-solid { color: var(--ink); background: var(--bg); border-bottom-color: var(--hair); -webkit-backdrop-filter: none; backdrop-filter: none; }
.theme-toggle {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%;
  background: none; border: 1px solid currentColor; color: inherit; opacity: .75; cursor: pointer; transition: opacity .2s;
}
.theme-toggle:hover { opacity: 1; }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }
[data-theme="light"] .theme-toggle .i-moon { display: none; }
.bar-mark { grid-column: 1; justify-self: start; font: 700 16px/1 var(--display); letter-spacing: -.01em; color: inherit; text-decoration: none; }
.bar-links { grid-column: 2; display: flex; gap: 28px; }
.theme-toggle { grid-column: 3; justify-self: end; }
.bar-links a { text-decoration: none; color: var(--muted); transition: color .2s; padding: 12px 0; margin: -12px 0; } /* taller tap area, same look */
.bar-mark { padding: 12px 0; margin: -12px 0; }
.bar-links a:hover, .bar-links a.is-current { color: var(--ink); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(242, 181, 68, .18); }

/* ---------- Hero ---------- */
.hero { --bg: #0b0b0c; --ink: #ececea; --muted: #8d8d8a; color: var(--ink); background: #000; position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; background: #000; }
.hero-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.01); transition: opacity 1.6s ease;
}
.hero-slide.is-on { opacity: 1; animation: drift 14s linear both; }
@keyframes drift { from { transform: scale(1.01) translate3d(0, 0, 0); } to { transform: scale(1.06) translate3d(-1%, -.5%, 0); } }
/* darken from the bottom-left, where the text sits, and add a faint film grain */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(11, 11, 12, .55) 18%, rgba(11, 11, 12, 0) 45%),
    linear-gradient(to right, rgba(11, 11, 12, .6) 0%, rgba(11, 11, 12, .25) 35%, rgba(11, 11, 12, 0) 60%),
    linear-gradient(to bottom, rgba(11, 11, 12, .45) 0%, rgba(11, 11, 12, 0) 14%);
}
.hero::after {
  content: ""; position: absolute; inset: -50%; z-index: -1; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -2%); } }

.hero-content { width: 100%; padding: 0 var(--m) clamp(72px, 12vh, 140px); max-width: calc(var(--max) * .62 + 2 * var(--m)); }
.hero-status {
  display: inline-flex; align-items: center; gap: 2px; margin-bottom: 16px; padding: 7px 12px 7px 10px; border-radius: 999px;
  font-size: 13px; color: var(--ink); background: rgba(11, 11, 12, .45); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(6px);
}
.hero-time { color: var(--muted); }
.hero-kicker { font-size: 14px; color: #c4c4c0; text-shadow: 0 1px 10px rgba(0, 0, 0, .6); margin-bottom: 14px; }
.hero-name { font: 800 clamp(44px, 6.4vw, 92px)/.92 var(--display); letter-spacing: -.035em; text-shadow: 0 2px 30px rgba(0, 0, 0, .45); }
.hero-lede { text-shadow: 0 1px 14px rgba(0, 0, 0, .6); margin-top: 18px; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.45; color: #d5d5d2; max-width: 30em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px;
  font: 500 14px/1 var(--text); text-decoration: none; cursor: pointer;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink);
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #111; }
.btn-ghost { background: rgba(255, 255, 255, .04); color: var(--ink); border-color: rgba(255, 255, 255, .28); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: var(--ink); color: var(--ink); }
.btn.play::before { content: "\25B6"; font-size: 9px; }

.hero-caption {
  position: absolute; right: var(--m); bottom: clamp(72px, 12vh, 140px); font-size: 13px; text-decoration: none;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right;
}
.hero-caption-text { transition: opacity .6s; }
.hero-caption:hover .hero-caption-text { text-decoration: underline; }
.hero-ticks { position: absolute; right: var(--m); bottom: calc(clamp(72px, 12vh, 140px) - 22px); display: flex; gap: 6px; }
.hero-ticks i { width: 22px; height: 2px; background: rgba(255, 255, 255, .25); overflow: hidden; position: relative; }
.hero-ticks i.is-on::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: 0 50%; animation: tick var(--slide, 7s) linear both; }
@keyframes tick { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 8vw, 120px) var(--m) 0; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--g);
  border-top: 1px solid var(--line); padding: 12px 0 22px; font-size: 14px;
}
.section-head h2 { font: 500 14px/1.3 var(--text); color: var(--ink); }
.muted-link { color: var(--muted); }
.filters { display: flex; gap: 16px; }
.filter { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); transition: color .2s; }
.filter sup { font-size: 9px; margin-left: 1px; }
.filter:hover, .filter.is-active { color: var(--ink); }
.filter.is-active { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent); }

/* ---------- Work index ---------- */
.rows { border-bottom: 1px solid var(--line); }
.row + .row { border-top: 1px solid var(--hair); }
.row-head {
  width: 100%; display: grid; align-items: baseline; gap: var(--g);
  grid-template-columns: 36px minmax(0, 1.1fr) minmax(0, 1fr) 90px 18px;
  padding: 16px 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background-color .2s, padding .3s var(--ease);
}
.row-head > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-n, .c-k, .c-y { font-size: 14px; color: var(--muted); }
.c-k .sep { margin: 0 4px; }
.c-y { text-align: right; }
.c-t { font: 500 19px/1.25 var(--text); letter-spacing: -.005em; }
.c-x { position: relative; justify-self: end; width: 11px; height: 11px; align-self: center; color: var(--muted); }
.c-x::before, .c-x::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: currentColor; transition: transform .3s var(--ease); }
.c-x::after { transform: rotate(90deg); }
.row.is-open .c-x::after { transform: rotate(0deg); }
.row.is-open .c-t { color: var(--accent); }
@media (hover: hover) {
  .row-head:hover { background: var(--bg-2); padding-left: 12px; padding-right: 12px; }
  .row-head:hover .c-t { color: var(--accent); }
}

/* open row grows smoothly; without JS every row stays open */
.row-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.row.is-open .row-body, .no-js .row-body { grid-template-rows: 1fr; }
.row-inner {
  min-height: 0; overflow: hidden; display: grid; column-gap: var(--g); align-items: start;
  grid-template-columns: 36px minmax(0, 1.15fr) minmax(0, 1fr);
}
.row-inner > img { grid-column: 2; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; background: var(--bg-2); margin: 4px 0 28px; border-radius: 4px; }
.row-inner > .row-text { grid-column: 3; }
.row-text { max-width: 560px; color: var(--text-2); }
.row-text > :first-child { margin-top: 4px; }
.row-text > :last-child { margin-bottom: 28px; }
.row-text p { margin-bottom: 12px; }
.row-text ul { margin: 0 0 14px; }
.row-text li { padding-left: 16px; position: relative; margin-bottom: 4px; }
.row-text li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 14px; }
.links .play {
  font: 500 14px/1 var(--text); background: var(--ink); color: var(--bg); border: 0; padding: 10px 14px; border-radius: 999px; cursor: pointer;
}
.links .play::before { content: "\25B6"; font-size: 9px; margin-right: 8px; vertical-align: 1px; }
.links .play:hover { background: var(--accent); }

/* floating screenshot that trails the cursor (mouse only, closed rows only) */
.preview {
  position: fixed; left: 0; top: 0; z-index: 30; width: 320px; aspect-ratio: 16 / 10; border-radius: 4px; overflow: hidden;
  pointer-events: none; opacity: 0; transform: translate3d(-999px, -999px, 0);
  transition: opacity .2s; background: var(--bg-2); box-shadow: 0 20px 50px var(--shadow);
}
.preview img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.preview.is-on { opacity: 1; }

/* ---------- Experience ---------- */
.cv { border-bottom: 1px solid var(--line); }
.cv li {
  display: grid; gap: var(--g); align-items: baseline;
  grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1.3fr);
  padding: 16px 0; border-top: 1px solid var(--hair);
}
.cv li:first-child { border-top: 0; }
.cv-ro { display: flex; flex-direction: column; }
.cv-y { font-size: 14px; color: var(--muted); white-space: nowrap; }
.cv-r { font-weight: 500; }
.cv-o { color: var(--muted); font-size: 14px; }
.cv-d { font-size: 14px; color: var(--text-2); }
.cv-d strong { color: var(--ink); font-weight: 500; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cv-tags span { font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }


/* ---------- Experience: heading on top, current roles side by side, earlier roles below ---------- */
.xp-grid { display: grid; gap: clamp(24px, 3vw, 40px); border-top: 1px solid var(--line); padding-top: 28px; }
.xp-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: var(--g); }
.xp-intro h2 { grid-column: 1 / -1; }
.xp-intro .btn { margin-bottom: 20px; }
.xp-intro h2 { font: 800 clamp(30px, 3.2vw, 44px)/1 var(--display); letter-spacing: -.02em; margin-bottom: 14px; }
.xp-intro p { color: var(--text-2); margin-bottom: 20px; max-width: 26em; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-line:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.xp-list { display: grid; gap: 14px; }
.xp-now { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); }
/* current roles sit straight on the page: no card, no border, aligned with the heading and the Earlier list */
.role { padding: 0; }
.role-top { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
/* plain label: just a gold dot and the word, no pill */
.now { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink); }
.now::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.role h3 { font: 700 clamp(18px, 1.6vw, 21px)/1.2 var(--display); letter-spacing: -.01em; }
.role-org { color: var(--muted); font-size: 14px; margin: 3px 0 10px; }
.role-text { font-size: 15px; color: var(--text-2); }
.role-text strong { color: var(--ink); font-weight: 500; }
.role-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.role-tags span { font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.xp-earlier { font: 500 13px/1.3 var(--text); color: var(--muted); margin: 18px 0 0; }

/* ---------- Skills & education: three cards ---------- */
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g); }
.card { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.card-kicker { font: 700 18px/1.2 var(--display); margin-bottom: 14px; }
.card-list { display: grid; gap: 8px; font-size: 14px; color: var(--text-2); }
.card-list li { padding-left: 16px; position: relative; }
.card-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .85; }
.edu { display: grid; gap: 14px; font-size: 14px; }
.edu dt { color: var(--ink); font-weight: 500; }
.edu dd { color: var(--muted); }
.card-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair); font-size: 13px; color: var(--muted); }

/* ---------- Certificates: cards with room for the real certificate image ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g); }
.cert { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-2); transition: border-color .25s, box-shadow .25s var(--ease); }
/* cards stay put on hover (a lift made them jitter under a resting cursor); shadow + border instead */
.cert:hover { border-color: var(--accent); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .55); }
.cert-img { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--hair);
  background: radial-gradient(circle at 30% 20%, rgba(242, 181, 68, .14), transparent 55%), var(--bg); }
/* badges are square: show them whole, centred, with room around them */
.cert-img img { width: 100%; height: 100%; object-fit: contain; padding: 18px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .25)); transition: transform .4s var(--ease); }
@media (hover: hover) and (pointer: fine) { .cert:hover .cert-img img { transform: scale(1.04); } }
/* a certificate document (no badge) fills the frame instead */
.cert-doc .cert-img img { object-fit: cover; object-position: top; padding: 0; filter: none; }
.cert-img > span { font: 800 clamp(20px, 2vw, 28px)/1 var(--display); letter-spacing: -.02em; color: var(--muted); opacity: .7; }
.cert-img button { position: absolute; inset: 0; border: 0; padding: 0; background: none; cursor: zoom-in; }
.cert-body { padding: 16px 18px 18px; }
.cert-body h3 { font: 600 15px/1.35 var(--text); color: var(--ink); }
.cert-body p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.cert-body a { font-size: 13px; color: var(--ink); }

/* ---------- Recontech studio band ---------- */
.studio { margin-top: clamp(64px, 8vw, 120px); background: var(--bg-2); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.studio-inner {
  padding: clamp(56px, 7vw, 100px) var(--m);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center;
}
.studio-brand { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
/* the logo is a stencil filled with the text colour, so it follows the theme */
.studio-logo {
  flex: none; width: 54px; height: 90px; background: var(--ink);
  -webkit-mask: url("../img/recon-tech-logo-light.png") center / contain no-repeat;
  mask: url("../img/recon-tech-logo-light.png") center / contain no-repeat;
}
.studio-brand h2 { font: 800 clamp(30px, 3.2vw, 44px)/1 var(--display); letter-spacing: -.02em; }
.studio-brand p { font-size: 14px; margin-top: 6px; }
.studio-lede { font-size: clamp(17px, 1.4vw, 19px); line-height: 1.5; color: var(--text-2); margin-bottom: 30px; }
.studio h3 { font: 500 13px/1.3 var(--text); color: var(--muted); margin: 0 0 6px; }
.studio-list { margin-bottom: 26px; border-top: 1px solid var(--line); }
.studio-list:last-of-type { margin-bottom: 0; }
.studio-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--hair); font-size: 14px; }
.studio-list li > :last-child { color: var(--muted); }
.studio-list a { font-weight: 500; text-decoration: none; }
.studio-list a:hover { color: var(--accent); }
.soon { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.soon::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* About: the same band as RECONTECH, mirrored, with the portrait on the left */
.about-inner { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.about-photo { margin: 0; border-radius: 6px; overflow: hidden; max-width: 440px; width: 100%; }
.about-photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 18%; filter: grayscale(1) contrast(1.05); }
.about-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.about-links a { color: var(--ink); }
/* the two bands sit back to back, divided by a single hairline */
.about + .studio { margin-top: 0; border-top: 1px solid var(--line); }

/* photo mosaic: two columns of portrait and landscape shots, staggered */
.studio-photos { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: clamp(44px, 4.6vw, 70px); gap: 10px; max-width: 560px; justify-self: end; width: 100%; }
.ph { position: relative; margin: 0; overflow: hidden; border-radius: 6px; background: var(--bg); }
/* left: tall then short; right: short then tall, so both columns end level */
.ph-a { grid-column: 1; grid-row: 1 / 5; }
.ph-c { grid-column: 1; grid-row: 5 / 8; }
.ph-b { grid-column: 2; grid-row: 1 / 4; }
.ph-d { grid-column: 2; grid-row: 4 / 8; }
.ph img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8); transition: filter .4s, transform .8s var(--ease); }
@media (hover: hover) and (pointer: fine) { .ph:hover img { filter: none; transform: scale(1.03); } }
.ph figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; font-size: 12.5px; color: #f2f2ef;
  background: linear-gradient(to top, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0));
}

/* ---------- Footer: two clear next steps instead of repeating contact details ---------- */
.footer { padding: clamp(64px, 8vw, 120px) var(--m) 22px; }
.footer-head { border-top: 1px solid var(--line); padding-top: 12px; }
.footer-label { font-size: 14px; color: var(--muted); }
.footer-title { margin: 18px 0 28px; font: 800 clamp(28px, 3.4vw, 46px)/1.05 var(--display); letter-spacing: -.025em; max-width: 18em; }
.footer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--g); margin-bottom: 48px; }
.cta {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 26px 28px 28px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2);
  transition: border-color .25s, box-shadow .25s var(--ease), background-color .25s;
}
.cta:hover { border-color: var(--accent); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .55); }
.cta-kicker { font-size: 13px; color: var(--muted); }
.cta-title { font: 700 clamp(19px, 1.7vw, 23px)/1.2 var(--display); letter-spacing: -.01em; }
.cta-text { font-size: 14px; color: var(--text-2); max-width: 30em; }
.footer-row { display: flex; justify-content: space-between; gap: 10px var(--g); flex-wrap: wrap; font-size: 13px; color: var(--muted); border-top: 1px solid var(--hair); padding-top: 14px; }
.footer-row a { margin-right: 12px; }

/* ---------- Certificate viewer ---------- */
.viewer { width: min(1000px, 94vw); max-height: 92vh; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg-2); color: var(--ink); }
.viewer::backdrop { background: rgba(0, 0, 0, .8); backdrop-filter: blur(4px); }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; font-size: 13px; }
.viewer-bar button { font: inherit; background: none; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.viewer-img { display: block; width: 100%; max-height: calc(92vh - 52px); object-fit: contain; background: #fff; }

/* ---------- Game player ---------- */
.player { width: min(1100px, 94vw); max-height: 94vh; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #000; color: var(--ink); }
.player::backdrop { background: rgba(0, 0, 0, .82); backdrop-filter: blur(4px); }
.player-bar { display: flex; align-items: center; gap: 16px; padding: 10px 14px; font-size: 13px; background: var(--bg-2); }
.player-title { font-weight: 500; }
.player-note { color: var(--muted); margin-right: auto; }
.player-bar button { font: inherit; background: none; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.player-bar button:hover { border-color: var(--ink); }
.player-frame { aspect-ratio: 16 / 9; background: #000; }
.player-frame iframe { width: 100%; height: 100%; border: 0; display: block; }


/* ---------- Landing intro: plays once when the page opens ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-bg { animation: introScene 1.8s var(--ease) both; }
  .js .hero-content > * { animation: introUp .9s var(--ease) both; }
  .js .hero-status { animation-delay: .35s; }
  .js .hero-kicker { animation-delay: .5s; }
  .js .hero-name { animation: introName 1.1s var(--ease) .62s both; }
  .js .hero-lede { animation-delay: .9s; }
  .js .hero-actions { animation-delay: 1.05s; }
  .js .bar { animation: introBar .8s var(--ease) .25s both; }
  .js .hero-caption, .js .hero-ticks { animation: introFade 1s ease 1.4s both; }
}
@keyframes introScene { from { opacity: 0; transform: scale(1.06); } }
@keyframes introUp { from { opacity: 0; transform: translateY(18px); } }
@keyframes introName { from { opacity: 0; transform: translateY(26px); filter: blur(10px); } }
@keyframes introBar { from { opacity: 0; transform: translateY(-100%); } }
@keyframes introFade { from { opacity: 0; } }

/* ---------- Light theme ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f6f3; --bg-rgb: 247, 246, 243; --bg-2: #eeece7;
  --ink: #161615; --text-2: #3a3a37; --muted: #6c6b66;
  --hair: #e1ded7; --line: #cfcbc2; --accent: #b7791f; --shadow: rgba(0, 0, 0, .18);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f7f6f3; --bg-rgb: 247, 246, 243; --bg-2: #eeece7;
    --ink: #161615; --text-2: #3a3a37; --muted: #6c6b66;
    --hair: #e1ded7; --line: #cfcbc2; --accent: #b7791f; --shadow: rgba(0, 0, 0, .18);
  }
  :root:not([data-theme="dark"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .i-moon { display: none; }
}

/* ---------- Tablet and phone ---------- */
@media (max-width: 900px) {
  .row-head { grid-template-columns: 30px minmax(0, 1fr) 70px 16px; row-gap: 2px; }
  .c-k { grid-column: 2; grid-row: 2; }
  .c-y { grid-column: 3; grid-row: 1; }
  .c-x { grid-column: 4; grid-row: 1; }
  .row-inner { grid-template-columns: 30px minmax(0, 1fr); }
  .row-inner > img, .row-inner > .row-text { grid-column: 2; }
  .row-inner > img { margin-bottom: 0; }
  .row-text > :first-child { margin-top: 16px; }
  .cv li { grid-template-columns: 100px minmax(0, 1fr); }
  .xp-now { grid-template-columns: 1fr; }
  .xp-intro { grid-template-columns: 1fr; }
  .xp-intro .btn { justify-self: start; }
  .cards3, .cert-grid { grid-template-columns: 1fr 1fr; }
  .cv-d { grid-column: 2; }
    .studio-inner, .about-inner { grid-template-columns: 1fr; }
  .about-photo { max-width: 360px; }
  .studio-photos { grid-row: 1; max-width: none; justify-self: stretch; grid-auto-rows: clamp(30px, 7vw, 52px); }
  .preview { display: none; }
  .hero-caption, .hero-ticks { display: none; }
}
@media (max-width: 700px) {
  .bar-mark { display: none; }
}
@media (max-width: 560px) {
  :root { --m: 16px; --g: 16px; }
  .bar-links { gap: 16px; font-size: 13px; }
  .theme-toggle { width: 28px; height: 28px; }
  .hero-time { display: none; }
  .hero-content { padding-bottom: 56px; }
  .row-head { grid-template-columns: 24px minmax(0, 1fr) 14px; }
  .c-y { display: none; }
  .c-x { grid-column: 3; grid-row: 1; }
  .row-inner { grid-template-columns: 0 minmax(0, 1fr); column-gap: 0; }
  .cv li { grid-template-columns: 1fr; gap: 2px; }
  .cards3, .cert-grid { grid-template-columns: 1fr; }
  .cv-d { grid-column: 1; }
    .footer-row { flex-direction: column; }
  .footer-actions { grid-template-columns: 1fr; }
  .cta { padding: 22px 20px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .hero-slide.is-on { transform: scale(1.01); }
}
