/* thernus.com portfolio. Dark, one accent (#E0218A), everything else ink.
   Layout is a single column of full-width sections on a 1120px inner rail. */

:root {
  --bg:        #08080a;
  --bg-2:      #0b0b0f;
  --panel:     #101015;
  --panel-2:   #15151b;
  --line:      rgba(255,255,255,.075);
  --line-2:    rgba(255,255,255,.14);
  --ink:       #eceef2;
  --ink-2:     #a4a7b2;
  --ink-3:     #6e7180;
  --accent:     #E0218A;
  --accent-dim: #c21c77;
  --rail:      1120px;
  --ease:      cubic-bezier(.22,.61,.36,1);
  --ease-out:  cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 600; letter-spacing: -.025em; margin: 0; }
.num { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.rail { width: min(100% - 40px, var(--rail)); margin-inline: auto; }
section { position: relative; padding: clamp(80px, 11vw, 150px) 0; }

/* ---------------------------------------------------------------- chrome */

#progress {
  position: fixed; inset: 0 auto auto 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  z-index: 90; transition: width .1s linear;
}

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 70;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px max(20px, calc((100vw - var(--rail)) / 2));
  transition: background .4s var(--ease), backdrop-filter .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar.stuck { background: rgba(8,8,10,.72); backdrop-filter: blur(14px) saturate(1.3); border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-family: 'Space Grotesk', sans-serif; font-weight: 600; letter-spacing: -.02em; }
.brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.topnav { display: flex; gap: 26px; font-size: 13.5px; color: var(--ink-2); }
.topnav a { position: relative; padding: 4px 0; transition: color .25s var(--ease); }
.topnav a::after { content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--accent); transition: width .3s var(--ease-out); }
.topnav a:hover { color: var(--ink); }
.topnav a:hover::after { width: 100%; }
@media (max-width: 720px) { .topnav { display: none; } }

/* right-hand section dots */
.dots { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 65; display: grid; gap: 14px; }
.dots button {
  all: unset; cursor: pointer; width: 8px; height: 8px; border-radius: 50%;
  background: var(--line-2); transition: background .3s var(--ease), transform .3s var(--ease-out);
}
.dots button[aria-current='true'] { background: var(--accent); transform: scale(1.45); box-shadow: 0 0 10px rgba(224,33,138,.5); }
@media (max-width: 1000px) { .dots { display: none; } }

/* ------------------------------------------------------------------ hero */

.hero { min-height: 100svh; display: grid; align-content: center; padding-top: 90px; overflow: hidden; }
#waves { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 75% at 50% 8%, transparent 30%, rgba(8,8,10,.55) 72%, var(--bg) 100%),
    linear-gradient(to bottom, transparent 60%, var(--bg) 100%);
}
.hero .rail { position: relative; z-index: 2; }

@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(224,33,138,0); } 100% { box-shadow: 0 0 0 0 rgba(224,33,138,0); } }

h1 {
  font-size: clamp(58px, 13vw, 148px); line-height: .92; margin: 0; letter-spacing: -.045em;
  background: linear-gradient(170deg, #ffffff 8%, #b9bcc6 58%, #71747f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { max-width: 47ch; margin: 22px 0 0; font-size: clamp(16px, 1.7vw, 19px); color: var(--ink-2); }
.lead b { color: var(--ink); font-weight: 500; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 12px 20px; border-radius: 10px;
  border: 1px solid var(--line-2); font-size: 14.5px; font-weight: 500;
  transition: transform .25s var(--ease-out), background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { box-shadow: 0 10px 30px -10px rgba(224,33,138,.55); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--ink-3); }

.scrollcue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2; color: var(--ink-3); font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; display: grid; justify-items: center; gap: 8px; }
.scrollcue i { display: block; width: 1px; height: 34px; background: linear-gradient(var(--ink-3), transparent); animation: cue 2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0%,100% { transform: scaleY(.35); opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }

/* -------------------------------------------------------------- counters */

.counter-wrap { margin-top: 46px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; }
.counter { font-size: clamp(30px, 5.6vw, 62px); font-weight: 500; line-height: 1; color: var(--ink); }
.counter .tick { color: var(--accent); }
.counter-label { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stat { background: var(--bg-2); padding: 26px 24px; transition: background .3s var(--ease); }
.stat:hover { background: var(--panel); }
.stat .v { font-size: clamp(24px, 3.2vw, 36px); font-weight: 500; line-height: 1.1; }
.stat .k { margin-top: 8px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 359px) { .stats { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- the earth */

/* Numbers on the left, planet on the right. The canvas is square and sized by
   the column so the shader never renders more pixels than it has to. */
.reach { padding-top: 0; }
.reachgrid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.reachcopy h2 { font-size: clamp(26px, 3.6vw, 40px); }
.reachcopy > p { margin: 12px 0 0; color: var(--ink-3); font-size: 14.5px; max-width: 42ch; }
.reachcopy .stats { margin-top: 30px; }

.earthwrap { position: relative; aspect-ratio: 1; width: 100%; }
/* the haze on the globe's limb. It never moves, so it's a background here and
   not a gradient the canvas has to refill 60 times a second. Sphere radius is
   44% of the box, hence the stops sitting where they do. */
.earthwrap::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle closest-side,
    rgba(224,33,138,0) 62%, rgba(224,33,138,.085) 87%, rgba(224,33,138,0) 102%);
}
#earth { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@media (max-width: 900px) {
  .reachgrid { grid-template-columns: 1fr; }
  .earthwrap { order: -1; max-width: 420px; margin-inline: auto; }
}

/* -------------------------------------------------------------- sections */

.sechead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 44px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sechead h2 { font-size: clamp(28px, 4.2vw, 46px); }
.sechead p { margin: 10px 0 0; color: var(--ink-3); font-size: 14.5px; max-width: 46ch; }

/* ----------------------------------------------------------------- cards */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.card {
  position: relative; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--bg-2); isolation: isolate;
  transition: transform .45s var(--ease-out), border-color .35s var(--ease), box-shadow .45s var(--ease-out);
}
.card::before {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background: radial-gradient(320px circle at var(--mx,50%) var(--my,50%), rgba(224,33,138,.13), transparent 65%);
  transition: opacity .35s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: var(--line-2); box-shadow: 0 26px 60px -30px rgba(0,0,0,.95); }
.card:hover::before { opacity: 1; }
.card.feature { grid-column: span 2; }
/* Cards in a row are stretched to the tallest one by the grid; without this the
   short ones ended in a slab of empty black. The art absorbs the extra height. */
.card > a { display: flex; flex-direction: column; height: 100%; }
.card > a .shot { flex: 1 1 auto; }
@media (max-width: 760px) { .card.feature { grid-column: span 1; } }

.shot { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--panel); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.02); transition: transform .8s var(--ease-out), filter .5s var(--ease); filter: saturate(.9) contrast(1.02); }
.card:hover .shot img { transform: scale(1.07); filter: saturate(1.05); }
.shot::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,11,15,.96) 2%, rgba(11,11,15,.25) 46%, transparent 78%); }

.badge {
  position: absolute; z-index: 2; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 100px;
  background: rgba(8,8,10,.72); backdrop-filter: blur(8px); border: 1px solid var(--line-2);
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
}
.badge.now { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.badge .live { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse 2.4s infinite; }

.card-body { position: relative; z-index: 2; padding: 0 20px 20px; margin-top: -46px; }
.card-title { display: flex; align-items: center; gap: 12px; }
.card-title img { width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel); }
.card-title h3 { font-size: 20px; line-height: 1.15; }
.card-title .role { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

.figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.fig .v { font-size: 17px; font-weight: 500; }
.fig .k { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.fig .v.hot { color: var(--accent); }

.spark { display: block; width: 100%; height: 30px; margin-top: 14px; overflow: visible; }

/* ---------------------------------------------------------------- videos */

/* youtube's maxres thumbnails carry legal small print along the bottom edge;
   a wider crop than the source 16/9 cuts it off top and bottom. */
.vidcard { display: flex; flex-direction: column; }
.vidcard .shot { aspect-ratio: 2 / 1; flex: 1 1 auto; }
.vidcard .shot::after { background: linear-gradient(to top, rgba(11,11,15,.94) 4%, rgba(11,11,15,.15) 55%, transparent 80%); }
.play {
  position: absolute; z-index: 2; inset: 0; margin: auto; width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(8,8,10,.6); border: 1px solid var(--line-2);
  backdrop-filter: blur(6px); transition: transform .35s var(--ease-out), background .3s var(--ease), border-color .3s var(--ease);
}
.vidcard:hover .play { transform: scale(1.1); background: var(--accent); border-color: var(--accent); }
.play svg { width: 20px; height: 20px; fill: var(--ink); margin-left: 3px; transition: fill .3s var(--ease); }
.vidcard:hover .play svg { fill: #fff; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line); border-radius: 100px; padding: 4px 10px; }

.gone { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px 24px; min-height: 100%; }
.gone .mark { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-dim); }

dialog#lightbox { border: none; padding: 0; background: transparent; max-width: min(1100px, 92vw); width: 100%; }
dialog#lightbox::backdrop { background: rgba(4,4,6,.88); backdrop-filter: blur(6px); }
dialog#lightbox .frame { position: relative; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: #000; }
dialog#lightbox iframe { width: 100%; height: 100%; border: 0; }
dialog#lightbox .lbmeta { margin: 16px auto 0; max-width: 720px; text-align: center; }
dialog#lightbox .lbmeta h4 { margin: 0 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
dialog#lightbox .lbmeta p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
dialog#lightbox .lbmeta p:empty { display: none; }
dialog#lightbox .close { all: unset; cursor: pointer; display: block; margin: 14px auto 0; color: var(--ink-2); font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }

/* -------------------------------------------------------------- timeline */

.tl { display: grid; gap: 0; border-top: 1px solid var(--line); }
.tl-row {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 24px; align-items: baseline;
  padding: 22px 8px; border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), padding-left .35s var(--ease-out);
}
.tl-row:hover { background: var(--panel); padding-left: 18px; }
.tl-row .yr { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--accent-dim); letter-spacing: .08em; }
.tl-row h3 { font-size: 18px; }
.tl-row p { margin: 5px 0 0; color: var(--ink-3); font-size: 14px; }
.tl-row .where { color: var(--ink-3); font-size: 13px; font-family: 'JetBrains Mono', monospace; }
@media (max-width: 700px) { .tl-row { grid-template-columns: 1fr; gap: 6px; } .tl-row .where { order: 3; } }

/* --------------------------------------------------------------- contact */

.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; gap: 36px; } }

.links { display: grid; gap: 10px; margin-top: 26px; }
.link {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2); transition: border-color .3s var(--ease), background .3s var(--ease), transform .3s var(--ease-out);
}
.link:hover { border-color: var(--line-2); background: var(--panel); transform: translateX(5px); }
.link svg { width: 18px; height: 18px; fill: var(--ink-2); flex: none; }
.link .t { font-size: 14.5px; }
.link .s { font-size: 12px; color: var(--ink-3); font-family: 'JetBrains Mono', monospace; }
.link .go { margin-left: auto; color: var(--ink-3); transition: transform .3s var(--ease-out), color .3s var(--ease); }
.link:hover .go { transform: translateX(3px); color: var(--accent); }

form { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
label { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-3); }
input, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
  padding: 13px 15px; font: inherit; font-size: 15px; transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent-dim); background: var(--panel); box-shadow: 0 0 0 3px rgba(224,33,138,.1); }
textarea { min-height: 148px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formnote { font-size: 12.5px; color: var(--ink-3); min-height: 1.4em; }
.formnote.ok { color: var(--accent); }
.formnote.bad { color: #ff8577; }

/* ---------------------------------------------------------------- footer */

footer { border-top: 1px solid var(--line); padding: 34px 0 44px; }
.footrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink-3); font-size: 13px; }

/* A date that belongs to one person. Sits in the footer as a heart and only
   spells itself out when you're actually looking for it. */
.seal { all: unset; cursor: default; display: inline-flex; align-items: center; vertical-align: baseline; margin-left: 4px; }
.seal-h { color: var(--accent); opacity: .32; font-size: 11px; transition: opacity .35s var(--ease); }
.seal-n {
  max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; font-size: 11px; color: var(--accent-dim);
  transition: max-width .5s var(--ease-out), opacity .35s var(--ease), margin-left .5s var(--ease-out);
}
.seal:hover .seal-h, .seal:focus-visible .seal-h { opacity: 1; }
.seal:hover .seal-n, .seal:focus-visible .seal-n { max-width: 90px; opacity: .85; margin-left: 6px; }

/* ---------------------------------------------------------------- reveal */

[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: var(--d, 0ms); }
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .scrollcue i, .badge .live { animation: none; }
}

.blackcat { image-rendering: pixelated; }
.catbtn { all: unset; cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); transition: color .25s var(--ease); }
.catbtn:hover { color: var(--accent); }

/* The work grid ends on a half-empty row (one wide card + six). This tile fills
   the last slot and turns the gap into the only call to action in the section. */
.card.callout { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 30px 26px; background: linear-gradient(160deg, var(--panel) 0%, var(--bg-2) 70%); }
.card.callout h3 { font-size: 21px; }
.card.callout p { margin: 0; color: var(--ink-3); font-size: 14px; }
.card.callout .go { margin-top: 6px; color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; }
.card.callout:hover .go { text-decoration: underline; text-underline-offset: 4px; }
