/* ==========================================================================
   Layout — mobile-first, single set of breakpoints.

   Structure is deliberately simple: a centred column, a few grids that collapse
   to one column, and no horizontal scroll anywhere. Wide content (the skills
   table, code-ish rows) scrolls inside its own container rather than pushing
   the page sideways.
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
  position: relative;
  border-top: var(--border);
}

.section:first-of-type { border-top: 0; }

.section__head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }

.section__index {
  font-size: var(--step--1);
  color: var(--fg-faint);
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: 0.5rem;
}

/* --- Header -------------------------------------------------------------- */

.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem var(--gutter);
  background: rgb(7 9 12 / 0.82);
  backdrop-filter: blur(10px);
  border-bottom: var(--border);
}

.site-head__mark {
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber);
  text-decoration: none;
  font-size: var(--step--1);
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav {
  display: none;
  gap: 1.25rem;
}

.site-nav a {
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
  text-decoration: none;
  transition: color var(--speed) var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current="true"] { color: var(--amber); }

@media (min-width: 60rem) { .site-nav { display: flex; } }

/* Language toggle — a two-state switch, because the whole i18n model is one
   boolean. The active side is lit. */
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--rule-bright);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.lang-toggle button {
  font: inherit;
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  padding: 0.35rem 0.7rem;
  background: transparent;
  color: var(--fg-faint);
  border: 0;
  cursor: pointer;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--amber);
  color: var(--bg);
}

/* --- Language notification ----------------------------------------------
   The "push notification" for language choice: a toast that offers the binary
   and then gets out of the way. Slides from the top on mobile, bottom-right on
   desktop. */

.lang-toast {
  position: fixed;
  z-index: 200;
  left: var(--gutter);
  right: var(--gutter);
  top: 4.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--amber-dim);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.6);
  transform: translateY(-140%);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}

.lang-toast[data-open="true"] { transform: translateY(0); opacity: 1; }
.lang-toast[hidden] { display: none; }

.lang-toast__q { margin: 0 0 0.75rem; font-size: var(--step-0); }
.lang-toast__hint { margin: 0.75rem 0 0; font-size: var(--step--1); color: var(--fg-faint); }
.lang-toast__actions { display: flex; gap: 0.6rem; }
.lang-toast__actions .btn { flex: 1; justify-content: center; }

@media (min-width: 48rem) {
  .lang-toast {
    left: auto;
    right: var(--gutter);
    top: auto;
    bottom: var(--gutter);
    width: min(24rem, calc(100vw - 2 * var(--gutter)));
    transform: translateY(140%);
  }
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  padding-block: 8rem 4rem;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

.hero__name {
  margin: 0 0 0.4em;
  line-height: 0.95;
}

.hero__role {
  font-size: var(--step-2);
  color: var(--cyan);
  margin: 0 0 0.6em;
  font-weight: 400;
}

.hero__line {
  font-size: var(--step-1);
  color: var(--fg-mute);
  max-width: 40ch;
}

.hero__specialty {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: var(--border);
  color: var(--amber);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__actions { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* --- Generic grids ------------------------------------------------------- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 42rem) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }

@media (min-width: 62rem) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.split { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: 1fr; }
@media (min-width: 62rem) { .split { grid-template-columns: 1fr 1fr; align-items: start; } }

/* --- Tech stack ---------------------------------------------------------- */

.stack-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 42rem) {
  .stack-row { grid-template-columns: 12rem 1fr; align-items: baseline; }
}

.stack-row__label {
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

.stack-row__items { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chip {
  font-size: var(--step--1);
  color: var(--fg);
  border: 1px solid var(--rule-bright);
  border-radius: var(--radius);
  padding: 0.15rem 0.55rem;
  background: var(--bg-inset);
  white-space: nowrap;
}

/* --- Art / video --------------------------------------------------------- */

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--rule-bright);
  border-radius: var(--radius);
  overflow: hidden;
}

.video-frame iframe,
.video-frame__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* The contrast treatment. A blend layer over the iframe pushes the footage
   toward the phosphor palette; the filter drives contrast and saturation.
   Both are animated by GSAP on scroll — see js/scenes/video-fx.js. */
.video-frame__iframe-wrap {
  position: absolute;
  inset: 0;
  filter: contrast(var(--v-contrast, 1.35)) saturate(var(--v-sat, 0.55))
          brightness(var(--v-bright, 0.95));
  transition: filter 0.6s var(--ease);
}

.video-frame__grade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgb(255 176 0 / 0.22),
    transparent 40%,
    rgb(34 211 238 / 0.20)
  );
  mix-blend-mode: color;
  opacity: var(--v-grade, 1);
}

.video-frame__lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgb(0 0 0 / 0.3) 0px,
    rgb(0 0 0 / 0.3) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.5;
}

.video-frame__missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: var(--fg-faint);
  font-size: var(--step--1);
}

.video-caption {
  margin-top: 0.75rem;
  font-size: var(--step--1);
  color: var(--fg-faint);
}

/* --- Cards --------------------------------------------------------------- */

.card {
  background: var(--bg-panel);
  border: var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
}

.card__title { margin: 0; font-size: var(--step-1); }
.card__body { margin: 0; color: var(--fg-mute); font-size: var(--step-0); }

.card__status {
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  align-self: flex-start;
  border: 1px solid var(--cyan-dim);
  border-radius: var(--radius);
  padding: 0.1rem 0.5rem;
}

.card__status[data-soon="true"] { color: var(--amber); border-color: var(--amber-dim); }

/* --- Download / platform rows -------------------------------------------- */

.platform-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.platform-row__os { font-weight: 700; }
.platform-row__note { color: var(--fg-faint); font-size: var(--step--1); }

/* --- Career -------------------------------------------------------------- */

.tick { list-style: none; margin: 0; padding: 0; }
.tick li { padding-left: 1.4rem; position: relative; margin-bottom: 0.5rem; }
.tick li::before { content: "▸"; position: absolute; left: 0; color: var(--amber); }

/* --- Footer -------------------------------------------------------------- */

.site-foot {
  border-top: var(--border);
  padding-block: 2.5rem;
  color: var(--fg-faint);
  font-size: var(--step--1);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
}

/* --- Entrance animation baseline ---------------------------------------- */

[data-anim] { opacity: 0; }

/* If JavaScript never runs, nothing should stay invisible. */
.no-js [data-anim] { opacity: 1; }

/* --- Utilities ----------------------------------------------------------
   The CSP forbids inline style attributes (style-src 'self'), so every
   one-off spacing tweak in the markup lives here as a class instead.
   Note this restriction does not affect CSSOM writes, so GSAP and the video
   grading still animate element.style directly. */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
}

.skip-link:focus-visible { left: 1rem; top: 1rem; }

.mb-1  { margin-bottom: 1rem; }
.mt-15 { margin-top: 1.5rem; }
.mt-2  { margin-top: 2rem; }

.subhead {
  font-size: var(--step-1);
  color: var(--cyan);
  margin: 0 0 0.6em;
  font-weight: 400;
}

.row-wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.text-mute { color: var(--fg-mute); }
.figure-reset { margin: 0; }

/* --- Project template ----------------------------------------------------
   Shared by every project section (js/project.js). Any block is optional, so
   these styles must not assume siblings exist. */

.project__audience {
  font-size: var(--step-1);
  color: var(--cyan);
  margin: 0 0 0.75rem;
  max-width: 44ch;
}

.project__description {
  font-size: var(--step-1);
  color: var(--fg);
  max-width: 52ch;
}

.project__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.badge {
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius);
  border: 1px solid currentColor;
  color: var(--fg-faint);
}

/* Free is the one badge that should be read as good news, so it gets the
   only filled treatment on the page. */
.badge--free {
  color: var(--bg);
  background: var(--green);
  border-color: var(--green);
  font-weight: 700;
}

.badge[data-tone="live"] { color: var(--cyan); }
.badge[data-tone="soon"] { color: var(--amber); }

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* The caveat some projects need to state plainly — for TrustHale, that it is
   an alerting aid rather than a medical device. Marked, not buried. */
.project__note {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border-left: 2px solid var(--amber-dim);
  background: var(--bg-inset);
  color: var(--fg-mute);
  font-size: var(--step--1);
  max-width: 60ch;
}

.mt-1 { margin-top: 1rem; }

/* Work cards carry the same badges as the sections they link to. */
.card .row-wrap { margin-top: auto; padding-top: 0.5rem; align-items: center; }
.card__status[data-tone="live"] { color: var(--cyan); border-color: var(--cyan-dim); }
.card__status[data-tone="soon"] { color: var(--amber); border-color: var(--amber-dim); }
