/* ---------- Tokens ---------- */
:root {
  /* Strict monochrome: black, white and a few greys between. */
  --ink: #000000;
  --panel: #121212;
  --line: #2a2a2a;
  --text: #ffffff;
  --muted: #8a8a8a;
  --dusk: #ffffff;       /* primary accent */
  --sodium: #ffffff;     /* focus / highlights */
  --ok: #ffffff;         /* correct keystrokes */
  --bad: #ffffff;        /* wrong keystrokes are shown inverted */
  --dot: 8px;            /* halftone grid size */

  --display: "Big Shoulders Display", "IBM Plex Sans Thai", sans-serif;
  --body: "IBM Plex Sans Thai", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1240px;
  --r-sm: 6px;
  --r-md: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 1rem/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--sodium); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--sodium); color: var(--ink); padding: .5rem 1rem; border-radius: var(--r-sm);
}
.skip:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px;
  font-weight: 600; text-decoration: none; border: 1px solid transparent;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn--primary { background: #fff; color: #000; }
.btn--primary:hover { background: #d6d6d6; }
.btn--ghost { border-color: rgba(255,255,255,.35); background: transparent; }
.btn--ghost:hover { border-color: var(--text); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  padding: 1rem var(--pad);
  transition: padding .35s;
}
.nav::before { /* fade-to-black behind the bar once the page scrolls */
  content: ""; position: absolute; inset: 0 0 -1.5rem; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.92) 45%, transparent);
  opacity: 0; transition: opacity .35s;
}
.nav.is-solid { padding-top: .6rem; padding-bottom: .6rem; }
.nav.is-solid::before { opacity: 1; }

.nav__brand { justify-self: start; display: inline-flex; align-items: center; gap: .6rem; font: 900 1.6rem/1 var(--display); text-decoration: none; letter-spacing: .02em; }
.nav__brand img { width: 34px; height: auto; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.nav__brand:hover img { transform: rotate(-12deg); }
.footer__brand { display: inline-flex; align-items: center; gap: .5rem; }
.footer__brand img { opacity: .6; }

/* Links sit in a capsule; a white pill slides under the section you're reading. */
.nav__pill {
  position: relative; padding: 4px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(12,12,12,.75); backdrop-filter: blur(12px);
}
.nav__thumb {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: var(--w, 0px);
  transform: translateX(var(--x, 0px)); border-radius: 999px; background: #fff;
  opacity: 0; transition: transform .45s cubic-bezier(.2,.8,.2,1), width .45s cubic-bezier(.2,.8,.2,1), opacity .3s;
}
.nav__pill.has-current .nav__thumb { opacity: 1; }
.nav__links { position: relative; display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: block; padding: .45rem 1.1rem; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem;
  transition: color .3s;
}
.nav__links a:hover { color: #fff; }
.nav__links a[aria-current="true"] { color: #000; }

.nav__cta {
  justify-self: end; display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none; font-weight: 600; font-size: .9rem;
  padding: .5rem 1.1rem; border-radius: 999px; background: #fff; color: #000;
  transition: background-color .2s;
}
.nav__cta:hover { background: #d6d6d6; }

/* Reading progress: a thin loading bar along the bottom of the nav. */
.nav__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; opacity: 0; transition: opacity .35s; }
.nav.is-solid .nav__progress { opacity: 1; }
.nav__progress span { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- Hero / loading screen ---------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column;
  padding: 6.5rem var(--pad) 1.75rem;
}
.hero__bg { /* faint dot grid, brightest behind the logo, fading out to the edges */
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle, rgba(255,255,255,.12) 1px, transparent 1.3px) 0 0 / var(--dot) var(--dot);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 72% 50%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 70% at 72% 50%, #000 0%, transparent 75%);
}
.hero::after { /* soft floor at the bottom of the hero */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; z-index: -1;
  background: linear-gradient(180deg, transparent, #111);
}

.hero__inner {
  flex: 1; width: 100%; max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2rem 3rem;
  align-items: center;
}
.hero__title {
  margin: 0; font: 900 clamp(3.6rem, 9.6vw, 9.5rem)/.84 var(--display);
  text-transform: uppercase; letter-spacing: -.01em;
}
.hero__title span { display: block; }
.hero__title span:first-child::after { /* the "dot" */
  content: ""; display: inline-block; width: .2em; height: .2em; margin-left: .06em;
  border-radius: 50%; background: var(--text);
}
/* "DEVELOPER" in dots, like the logo; the dots near the cursor turn bright white. */
.hero__title span:last-child {
  --tx: -999px; --ty: -999px;
  color: transparent;
  background: radial-gradient(240px circle at var(--tx) var(--ty), #fff, transparent 70%) no-repeat;
  background-color: rgba(255,255,255,.62);
  -webkit-background-clip: text; background-clip: text;
  -webkit-mask-image: radial-gradient(circle, #000 2.2px, transparent 2.6px); -webkit-mask-size: 6px 6px;
          mask-image: radial-gradient(circle, #000 2.2px, transparent 2.6px); mask-size: 6px 6px;
}

/* Live online count from the Discord server, above the name */
.hero__live {
  display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem;
  padding: .4rem .9rem .4rem .75rem; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(12,12,12,.7); color: #cfcfcf; font-size: .88rem; text-decoration: none;
  transition: border-color .2s, color .2s;
}
.hero__live[hidden] { display: none; }
.hero__live:hover { border-color: #fff; color: #fff; }
.hero__live b { color: #fff; font-family: var(--mono); }
.hero__role { margin: 1.5rem 0 1.75rem; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: #cfcfcf; max-width: 32ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero__stats { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2.25rem 0 0; }
/* Stat chip: dotted number on the left, unit + label stacked on the right. */
.stat {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 1.1rem;
  padding: .7rem 1.4rem .7rem 1rem; border-radius: 16px;
  border: 1px solid var(--line); background: rgba(12,12,12,.75); backdrop-filter: blur(6px);
  transition: border-color .25s;
}
.stat:hover { border-color: #fff; }
.stat__num {
  font: 900 clamp(3.6rem, 5vw, 4.6rem)/.8 var(--display); padding: .04em .02em 0;
  color: transparent; background-color: #fff;
  -webkit-background-clip: text; background-clip: text;
  -webkit-mask-image: radial-gradient(circle, #000 1.45px, transparent 1.75px); -webkit-mask-size: 4.5px 4.5px;
          mask-image: radial-gradient(circle, #000 1.45px, transparent 1.75px); mask-size: 4.5px 4.5px;
}
.stat__text { display: flex; flex-direction: column; gap: .25rem; padding-left: 1.1rem; border-left: 1px solid var(--line); }
.stat__unit { font: 800 1.5rem/1 var(--display); text-transform: uppercase; }
.stat__label { color: var(--muted); font-size: .85rem; line-height: 1.2; }

.hero__art { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1; justify-self: end; }
.hero__art canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: crosshair; }
.hero__hint {
  position: absolute; right: 0; bottom: -.25rem; margin: 0;
  font: .75rem var(--mono); color: var(--muted); transition: opacity .4s;
}
.hero__hint.is-hidden { opacity: 0; }


@media (max-width: 900px) {
  .hero { padding-top: 5.5rem; }
  .hero__inner { grid-template-columns: 1fr; align-content: center; gap: 1rem; }
  .hero__art { order: -1; max-width: 240px; justify-self: start; margin-left: -12px; }
  .hero__hint { display: none; }
}
@media (max-width: 640px) {
  .hero__title span:last-child {
    -webkit-mask-image: radial-gradient(circle, #000 1.3px, transparent 1.6px); -webkit-mask-size: 3.6px 3.6px;
            mask-image: radial-gradient(circle, #000 1.3px, transparent 1.6px); mask-size: 3.6px 3.6px;
    background-color: rgba(255,255,255,.75);
  }
  .hero__live { margin-bottom: 1rem; }
  .hero__art { max-width: 170px; }
  .hero__role { margin: 1rem 0 1.25rem; }
  .hero__stats { margin-top: 1.25rem; }
}

/* ---------- Section shell ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(4rem, 10vw, 8rem) var(--pad) 0; }
.section__head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem;
  margin-bottom: 2.5rem;
}
.section__title { margin: 0; font: 800 clamp(3rem, 8vw, 6rem)/.9 var(--display); }
.section__note { margin: 0; color: var(--muted); }

/* ---------- Works ---------- */
/* ---------- Script library ---------- */
.lib { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }

.lib__list { position: relative; border-top: 1px solid var(--line); }
.lib__marker { /* the dot that slides to the selected script */
  position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%; background: #fff;
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.lib__row {
  display: flex; flex-direction: column; gap: .45rem; width: 100%; text-align: left;
  padding: 1.5rem 0 1.5rem 2.25rem; background: none; border: 0; border-bottom: 1px solid var(--line);
  color: #4a4a4a; transition: color .3s;
}
.lib__row:hover { color: #9a9a9a; }
.lib__row[aria-selected="true"] { color: #fff; }
.lib__name { font: 800 clamp(2.2rem, 4.2vw, 3.8rem)/.95 var(--display); word-break: break-word; }
.lib__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; font-size: .9rem; color: var(--muted); }
.lib__kind { font: .72rem var(--mono); padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); }
.lib__row[aria-selected="true"] .lib__kind { border-color: #fff; color: #fff; }

.lib__panel {
  position: sticky; top: 5.5rem;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #0b0b0b;
}
.lib__stage { position: relative; aspect-ratio: 16 / 10; background: #000; overflow: hidden; }
.lib__media {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in;
  transition: opacity .4s, transform .6s cubic-bezier(.2,.8,.2,1);
}
.lib__media.is-entering { opacity: 0; transform: scale(1.03); }
.lib__media.is-leaving { opacity: 0; }
.lib__expand {
  position: absolute; top: .75rem; right: .75rem; z-index: 2;
  font-size: .8rem; font-weight: 600; padding: .35rem .8rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
}
.lib__expand:hover { background: #fff; color: #000; }

.lib__thumbs { display: flex; gap: .5rem; padding: .75rem 1rem 0; }
.lib__thumbs[hidden] { display: none; }
.lib__thumb {
  width: 84px; aspect-ratio: 16 / 10; padding: 0; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; background: #000; opacity: .5; transition: opacity .2s, border-color .2s;
}
.lib__thumb img, .lib__thumb video { width: 100%; height: 100%; object-fit: cover; }
.lib__thumb:hover { opacity: .85; }
.lib__thumb[aria-current="true"] { opacity: 1; border-color: #fff; }

.lib__foot { display: grid; gap: .75rem; padding: 1rem; }
.lib__actions { display: flex; gap: .5rem; }
.lib__actions .btn { flex: 1; justify-content: center; padding: .7rem 1rem; font-size: .9rem; }

/* Small slide on hover so the list feels pickable */
.lib__name { display: inline-block; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.lib__row:hover .lib__name { transform: translateX(6px); }
.lib__row[aria-selected="true"] .lib__name { transform: none; }

/* Install steps under the list: a dotted timeline */
.lib__steps { margin-top: 2.5rem; }
.lib__steps-title { margin: 0 0 1.1rem; font: 600 .8rem var(--mono); color: var(--muted); }
.lib__steps-title b { color: #fff; font-weight: 600; }
.lib__steps ol { position: relative; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.lib__steps ol::before { /* the line joining the dots */
  content: ""; position: absolute; left: 5px; top: .7em; bottom: .7em; width: 1px;
  background: repeating-linear-gradient(180deg, #444 0 2px, transparent 2px 6px);
}
.lib__steps li {
  counter-increment: step; position: relative;
  padding: .45rem 0 .45rem 2rem; color: #cfcfcf; font-size: .95rem;
}
.lib__steps li::before {
  content: ""; position: absolute; left: 0; top: calc(.45rem + .45em); width: 11px; height: 11px;
  border-radius: 50%; background: #0b0b0b; border: 1.5px solid #fff;
}
.lib__steps li:last-child::before { background: #fff; }
.lib__steps code { font: .85rem var(--mono); color: #fff; padding: .05rem .4rem; border-radius: 4px; background: #151515; border: 1px solid var(--line); }

/* Preview: playback label and progress bar */
.lib__state {
  position: absolute; top: .75rem; left: .75rem; z-index: 2;
  display: none; align-items: center; gap: .45rem;
  font: 600 .75rem var(--body); padding: .3rem .7rem; border-radius: 999px;
  background: rgba(0,0,0,.65); backdrop-filter: blur(6px); color: #cfcfcf;
}
.lib__state::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 4px 0 4px 7px; border-color: transparent transparent transparent currentColor; }
.lib__stage.is-video .lib__state { display: inline-flex; }
.lib__stage.is-playing .lib__state { color: #fff; }
.lib__stage.is-playing .lib__state::before { width: 7px; height: 8px; border: 0; border-left: 2px solid currentColor; border-right: 2px solid currentColor; box-sizing: border-box; }
.lib__bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 3px; background: rgba(255,255,255,.15); display: none; }
.lib__stage.is-video .lib__bar { display: block; }
.lib__bar span { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

@media (max-width: 900px) {
  .lib__steps { margin-top: 1.75rem; }
}

/* ensure line + copy button (also used by the library panel) */
.script__cfg {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .45rem .45rem .45rem .85rem; border-radius: 8px;
  background: #151515; border: 1px solid var(--line);
  font: .85rem var(--mono);
}
.script__cfg code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.script__copy {
  flex-shrink: 0; border: 1px solid var(--line); background: transparent; border-radius: 6px;
  padding: .25rem .6rem; font: 500 .8rem var(--body); color: var(--muted);
  transition: color .2s, border-color .2s, background-color .2s;
}
.script__copy:hover { color: #fff; border-color: #fff; }
.script__copy.is-done { background: #fff; color: #000; border-color: #fff; }

@media (max-width: 900px) {
  .lib { grid-template-columns: 1fr; }
  .lib__marker { display: none; }
  .lib__row { padding-left: 0; }
  .lib__row[aria-selected="true"] .lib__name::before {
    content: ""; display: inline-block; width: .28em; height: .28em; margin-right: .3em;
    border-radius: 50%; background: #fff; vertical-align: middle;
  }
  .lib__panel { position: static; margin: 0 0 1.25rem; }
}

/* ---------- Skills as a resource monitor ---------- */
.cfg__kw { color: var(--muted); } /* "ensure" keyword in the script library */

.mon { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #0b0b0b; }
.mon__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1.25rem; background: #fff; color: #000;
}
.mon__title { display: inline-flex; align-items: center; gap: .5rem; font: 600 .85rem var(--mono); }
.mon__title img { filter: invert(1); }
.mon__count { font: 600 .8rem var(--mono); font-variant-numeric: tabular-nums; }

/* Bento grid; the 1px gaps show the line colour underneath, so tiles read like monitor cells. */
.mon__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line);
}
.mon__tile {
  --mx: 50%; --my: 50%;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: .9rem;
  min-height: 17rem; padding: 1.25rem 1.35rem 1.35rem;
  background: #0b0b0b;
  transition: background-color .3s, opacity .35s;
}
.mon__tile:first-child, .mon__tile:last-child { grid-column: span 2; }
.mon__tile::before { /* dot grid that lights up around the cursor */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.35) 1px, transparent 1.4px) 0 0 / var(--dot) var(--dot);
  -webkit-mask-image: radial-gradient(220px circle at var(--mx) var(--my), #000, transparent 70%);
          mask-image: radial-gradient(220px circle at var(--mx) var(--my), #000, transparent 70%);
  opacity: 0; transition: opacity .3s;
}
.mon__tile:hover { background: #111; }
.mon__tile:hover::before { opacity: 1; }

.mon__top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.mon__name { font: 600 .9rem var(--mono); }
.mon__status { display: inline-flex; align-items: center; gap: .45rem; font: .75rem var(--mono); color: var(--muted); }
.mon__dot { width: 7px; height: 7px; border-radius: 50%; background: #3a3a3a; flex-shrink: 0; }

/* Big dot-matrix word. Dim at rest; the dots under the cursor light up white. */
.mon__label {
  --lx: -999px; --ly: -999px;
  align-self: flex-start; margin: auto 0 .25rem; padding: .05em 0;
  font: 900 clamp(4.6rem, 8vw, 7.5rem)/.82 var(--display); text-transform: uppercase; white-space: nowrap;
  color: transparent;
  background: radial-gradient(200px circle at var(--lx) var(--ly), #fff, transparent 70%) no-repeat;
  background-color: rgba(255,255,255,.55);
  -webkit-background-clip: text; background-clip: text;
  -webkit-mask-image: radial-gradient(circle, #000 1.45px, transparent 1.75px); -webkit-mask-size: 5px 5px;
          mask-image: radial-gradient(circle, #000 1.45px, transparent 1.75px); mask-size: 5px 5px;
  transition: background-color .35s;
  pointer-events: none; user-select: none;
}
.mon__tile:hover .mon__label { background-color: rgba(255,255,255,.8); }
/* Wide tiles: text on the left, a bigger word filling the right side. */
@media (min-width: 1001px) {
  .mon__tile:first-child, .mon__tile:last-child {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto auto;
    column-gap: 1.5rem;
  }
  .mon__tile:first-child .mon__top, .mon__tile:last-child .mon__top { grid-column: 1 / -1; }
  .mon__tile:first-child .mon__label, .mon__tile:last-child .mon__label {
    grid-column: 2; grid-row: 2 / 5; align-self: end; margin: 0 0 -.06em;
    font-size: clamp(7rem, 11.5vw, 11.5rem);
  }
  .mon__tile:first-child .mon__desc, .mon__tile:last-child .mon__desc { grid-column: 1; grid-row: 3; margin-bottom: .9rem; }
  .mon__tile:first-child .mon__tags, .mon__tile:last-child .mon__tags { grid-column: 1; grid-row: 4; }
}
.mon__desc { margin: 0; color: #d0d0d0; font-size: .92rem; max-width: 36ch; }
.mon__tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.mon__tags li {
  font: .72rem var(--mono); padding: .15rem .55rem; border-radius: 999px;
  border: 1px solid var(--line); color: #bdbdbd; background: #0b0b0b;
}

/* Start-up sequence: tiles boot one after another when the panel scrolls in. */
.mon__tile.is-pending { opacity: .3; }
.mon__tile.is-started .mon__status { color: #fff; }
.mon__tile.is-started .mon__dot { background: #fff; animation: mon-ping .6s ease-out 1; }
@keyframes mon-ping {
  from { box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
  to { box-shadow: 0 0 0 9px rgba(255,255,255,0); }
}

@media (max-width: 1000px) {
  .mon__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .mon__grid { grid-template-columns: 1fr; }
  .mon__tile:first-child, .mon__tile:last-child { grid-column: auto; }
  .mon__tile { min-height: 13rem; }
}

/* ---------- About + Contact ---------- */
.contact { padding-bottom: clamp(4rem, 10vw, 7rem); }

/* About: big text on the left, a small profile.cfg panel on the right */
.contact__about {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 1fr); gap: 2.5rem clamp(2rem, 5vw, 4.5rem); align-items: center;
  padding: 0 0 clamp(4rem, 9vw, 7rem);
}
.contact__head { padding-top: clamp(1rem, 3vw, 2rem); border-top: 1px solid var(--line); }

/* profile.cfg: same window chrome as the Resource Monitor and F8 Console */
.about__card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #0b0b0b; }
.about__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1.1rem; background: #fff; color: #000;
}
.about__file { display: inline-flex; align-items: center; gap: .5rem; font: 600 .8rem var(--mono); }
.about__file img { filter: invert(1); }
.about__count { font: .72rem var(--mono); color: #555; }
.about__facts { margin: 0; padding: .4rem 0; counter-reset: ln; }
.about__facts div {
  counter-increment: ln;
  display: grid; grid-template-columns: 1.6rem 1fr auto; align-items: baseline; gap: .75rem;
  padding: .7rem 1.1rem .7rem .6rem; transition: background-color .2s;
}
.about__facts div::before { content: counter(ln); text-align: right; font: .72rem var(--mono); color: #444; }
.about__facts div:hover { background: rgba(255,255,255,.04); }
.about__facts dt { font: .82rem var(--mono); color: #bdbdbd; }
.about__kw { color: var(--muted); margin-right: .35rem; }
.about__facts dd { margin: 0; font-weight: 600; font-size: 1rem; text-align: right; }
.about__q { font-family: var(--mono); color: #555; }

/* Big about text; words light up from grey to white as you scroll through it */
.about__text {
  margin: 0; max-width: 22ch;
  font: 600 clamp(1.7rem, 3.6vw, 3.1rem)/1.35 var(--body); letter-spacing: -.01em;
}
.about__text .w { color: #3a3a3a; transition: color .25s; }
.about__text .w.is-on { color: #fff; }

/* F8 console, full width: the closing scene */
.console {
  --mx: 50%; --my: 50%;
  position: relative; isolation: isolate;
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #0b0b0b;
}
.console::before { /* dot grid that brightens around the cursor */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.3) 1px, transparent 1.4px) 0 0 / var(--dot) var(--dot);
  -webkit-mask-image: radial-gradient(360px circle at var(--mx) var(--my), #000, transparent 70%);
          mask-image: radial-gradient(360px circle at var(--mx) var(--my), #000, transparent 70%);
  opacity: .35; transition: opacity .3s;
}
.console:hover::before { opacity: 1; }
.console__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1.5rem; background: #fff; color: #000;
}
.console__title { display: inline-flex; align-items: center; gap: .5rem; font: 600 .85rem var(--mono); }
.console__title img { filter: invert(1); }
.console__hint { font: .75rem var(--mono); color: #555; }
.console__body { padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.25rem); display: flex; flex-direction: column; gap: clamp(1.25rem, 3vw, 2rem); }
.console__line { margin: 0; }
.console__line--log { color: #bdbdbd; font-size: clamp(.95rem, 1.3vw, 1.1rem); max-width: 60ch; }
.console__tag { font-family: var(--mono); color: #fff; margin-right: .35rem; }

/* The command itself is the big call to action and a link. */
.console__cmd {
  display: flex; gap: clamp(.75rem, 2vw, 1.5rem); align-items: flex-start;
  margin: 0 calc(-1 * clamp(.75rem, 2vw, 1.25rem));
  padding: clamp(.75rem, 2vw, 1.25rem);
  border-radius: 12px; text-decoration: none; color: #fff;
  font: 600 clamp(1.1rem, 5.2vw, 4.6rem)/1.1 var(--mono); letter-spacing: -.02em;
  transition: background-color .25s, color .25s;
}
.console__prompt { color: #555; transition: color .25s; }
.console__text { white-space: pre-wrap; overflow-wrap: anywhere; }
.console__cmd:hover, .console__cmd:focus-visible { background: #fff; color: #000; }
.console__cmd:hover .console__prompt, .console__cmd:focus-visible .console__prompt { color: #999; }
.console__cmd:hover .console__caret, .console__cmd:focus-visible .console__caret { background: #000; }
.console__caret {
  display: inline-block; width: .55em; height: .95em; margin-left: .08em;
  background: #fff; vertical-align: -.08em; animation: caret 1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.console__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-top: clamp(1rem, 2vw, 1.5rem); border-top: 1px solid var(--line); }
.console__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn kbd {
  font: 600 .75rem var(--mono); padding: .05rem .4rem; border-radius: 4px;
  border: 1px solid rgba(0,0,0,.35);
}
.contact__toast { margin: 0; min-height: 1.5em; color: #fff; font-size: .85rem; }

@media (max-width: 900px) {
  .contact__about { grid-template-columns: 1fr; }
  .about__text { max-width: none; }
  .console__hint { display: none; }
  .console__actions { width: 100%; }
  .console__actions .btn { flex: 1 1 12rem; justify-content: center; }
}

.footer { overflow: hidden; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.footer__row { max-width: var(--max); margin: 0 auto; padding: 1.5rem var(--pad); display: flex; justify-content: space-between; }
.footer p { margin: 0; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }

/* Sign-off: the name across the full width, filled with dots that light up under the cursor. */
.footer__mark {
  --mx: 50%; --my: 50%;
  margin: 0 !important; padding: 0 var(--pad); text-align: center; white-space: nowrap;
  font: 900 clamp(3rem, 15.5vw, 17rem)/.8 var(--display); text-transform: uppercase; letter-spacing: -.01em;
  color: transparent;
  background:
    radial-gradient(260px circle at var(--mx) var(--my), rgba(255,255,255,.95), transparent 70%) 0 0 / 100% 100% no-repeat,
    radial-gradient(circle, rgba(255,255,255,.22) 1.6px, transparent 2px) 0 0 / 7px 7px;
  -webkit-background-clip: text; background-clip: text;
  /* dots only: punch the white spotlight through the same dot grid */
  -webkit-mask-image: radial-gradient(circle, #000 1.9px, transparent 2.2px);
  -webkit-mask-size: 7px 7px;
          mask-image: radial-gradient(circle, #000 1.9px, transparent 2.2px);
          mask-size: 7px 7px;
  user-select: none;
  transform: translateY(12%);
}

/* Live Discord server row, styled like a server-browser entry */
.srv {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  padding: .85rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: #111;
  text-decoration: none; color: #fff; transition: border-color .2s, background-color .2s;
}
.srv[hidden] { display: none; }
.srv:hover { border-color: #fff; background: #151515; }
.srv__icon { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; filter: grayscale(1) contrast(1.1); background: #222; }
.srv__info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.srv__name { font-weight: 600; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv__sub { font: .72rem var(--mono); color: var(--muted); }
.srv__stats { display: flex; gap: 1.25rem; font-size: .85rem; color: var(--muted); }
.srv__stat { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.srv__stat b { color: #fff; font: 600 1rem var(--mono); font-variant-numeric: tabular-nums; }
.srv__live { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: srv-live 2s ease-out infinite; }
@keyframes srv-live {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}
@media (max-width: 640px) {
  .footer__mark {
    -webkit-mask-image: radial-gradient(circle, #000 1.05px, transparent 1.3px); -webkit-mask-size: 3.5px 3.5px;
            mask-image: radial-gradient(circle, #000 1.05px, transparent 1.3px); mask-size: 3.5px 3.5px;
    background-size: 100% 100%, 3.5px 3.5px;
  }
  .srv { grid-template-columns: auto 1fr; }
  .srv__stats { grid-column: 1 / -1; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  width: min(1100px, 94vw); max-height: 92vh; padding: 0; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--panel); color: var(--text); overflow: visible;
}
.lightbox::backdrop { background: rgba(0,0,0,.88); backdrop-filter: blur(4px); }
.lightbox__media { background: #000; border-radius: var(--r-md) var(--r-md) 0 0; overflow: hidden; }
.lightbox__media img, .lightbox__media video { width: 100%; max-height: 72vh; object-fit: contain; margin: 0 auto; }
.lightbox__meta { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; }
.lightbox__title { margin: 0; font-weight: 600; }
.lightbox__note { margin: 0; color: var(--muted); font-size: .9rem; }
.lightbox__side { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.lightbox__dl { padding: .55rem 1.1rem; font-size: .9rem; }
.lightbox__count { margin: 0; font: .85rem var(--mono); color: var(--muted); }
.lightbox__btn, .lightbox__close {
  position: absolute; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); font-size: 1.5rem; line-height: 1;
}
.lightbox__btn:hover, .lightbox__close:hover { border-color: var(--text); }
.lightbox__prev { left: -1.4rem; top: 40%; }
.lightbox__next { right: -1.4rem; top: 40%; }
.lightbox__close { right: -1rem; top: -1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
}
@media (max-width: 640px) {
  /* Phones: brand + Discord stay on top; the section links float at the bottom, within thumb reach. */
  .nav { grid-template-columns: 1fr auto; }
  .nav__pill {
    position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 60;
    transform: translateX(-50%);
    background: rgba(12,12,12,.88); box-shadow: 0 10px 30px rgba(0,0,0,.6);
  }
  .nav__links a { padding: .55rem .8rem; font-size: .85rem; white-space: nowrap; }
  .footer { padding-bottom: 6rem; }
  .hero { padding-bottom: 5.5rem; } /* keep hero content clear of the floating bottom menu */
  .lightbox__prev { left: .5rem; top: auto; bottom: 4.5rem; }
  .lightbox__next { right: .5rem; top: auto; bottom: 4.5rem; }
  .lightbox__close { right: .5rem; top: .5rem; }
}

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