/* ==========================================================================
   ROBOPHOBIC — teaser site
   Palette tokens are the canonical HEX anchors from the Robophobic Style Guide.
   ========================================================================== */

/* Self-hosted variable fonts — one file per family covers every weight we use,
   and keeps the critical path on our own origin. SIL OFL 1.1, see
   assets/fonts/OFL-*.txt */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/archivo-var.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("assets/fonts/jetbrainsmono-var.woff2") format("woff2");
}

:root {
  /* shared neutrals */
  --ink:        #111216;
  --soft-black: #19191C;
  --charcoal:   #292528;
  --paper:      #F0E8DD;
  --cream:      #DDC8BA;
  --steel:      #858E99;

  /* signals — used sparingly, per the guide */
  --lilac:      #B396D1;
  --cyan:       #54BCD0;
  --coral:      #D9655D;
  --amber:      #E6B65B;
  --navy:       #1D2942;

  --ticker-h: 30px;
  --gutter: clamp(16px, 4vw, 48px);

  --font-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-synthesis-weight: none;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

::selection { background: var(--lilac); color: var(--ink); }

:where(a, button):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font: 500 12px/1 var(--font-mono);
}
.skip-link:focus { left: 8px; top: 8px; }

/* small square bullet used through the micro-copy */
.sq {
  display: inline-block;
  width: 6px; height: 6px;
  background: currentColor;
  vertical-align: 1px;
}
.sq--lilac { background: var(--lilac); }
.sq--cyan  { background: var(--cyan); }

/* ── ticker ─────────────────────────────────────────────────────────────── */

.ticker {
  flex: 0 0 auto;
  height: var(--ticker-h);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 20;
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: slide 38s linear infinite;
}

.ticker__group { display: flex; flex: 0 0 auto; }

.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  font: 500 10px/1 var(--font-mono);
  letter-spacing: .14em;
  white-space: nowrap;
}
.ticker__item .sq { background: var(--coral); }
.ticker__item .sq--lilac { background: var(--lilac); }
.ticker__item .sq--cyan { background: var(--cyan); }

@keyframes slide {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ── masthead ───────────────────────────────────────────────────────────── */

.masthead {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  position: relative;
  z-index: 15;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  width: 22px; height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
  flex: 0 0 auto;
}
.brand__eye { fill: var(--lilac); stroke: none; }

.brand__word {
  font: 800 13px/1 var(--font-display);
  letter-spacing: .2em;
}

.masthead__nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── buttons ────────────────────────────────────────────────────────────── */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bg);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: .14em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  /* clipped corners — machined, not rounded */
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}

.btn:hover { transform: translate(-1px, -1px); }
.btn:active { transform: translate(0, 0); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--paper); }
.btn--ghost[aria-pressed="true"] { --btn-bg: var(--ink); --btn-fg: var(--paper); }

.btn--signal { --btn-bg: var(--coral); --btn-fg: var(--ink); }
.btn--signal:hover { --btn-bg: var(--ink); --btn-fg: var(--paper); border-color: var(--ink); }

.btn--big {
  padding: 18px 26px;
  font-size: 12px;
  letter-spacing: .18em;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.btn--big:hover { background: var(--lilac); border-color: var(--lilac); color: var(--ink); }
.btn--big em { font-style: normal; margin-left: 2px; }

/* equalizer glyph inside the sound toggle */
.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 13px; height: 11px;
}
.eq i {
  flex: 1;
  height: 25%;
  background: currentColor;
}
.btn--ghost[aria-pressed="true"] .eq i { animation: bounce .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .15s; }
.eq i:nth-child(3) { animation-delay: .3s; }
.eq i:nth-child(4) { animation-delay: .45s; }

@keyframes bounce {
  0%, 100% { height: 25%; }
  50%      { height: 100%; }
}

/* ── hero ───────────────────────────────────────────────────────────────── */

.hero {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 47fr) minmax(0, 53fr);
  align-items: stretch;
  min-height: 0;
  position: relative;
}

/* left: the image, interrupted */
.hero__visual {
  position: relative;
  min-height: clamp(320px, 52vh, 900px);
  isolation: isolate;
}

.hero__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* jagged outer silhouette — saw-tooth on the right, notched top + bottom */
  clip-path: polygon(
    0% 0%,    100% 0%,
    100% 12%,  86% 19%, 100% 26%,
     87% 35%, 100% 43%,
     85% 53%, 100% 61%,
     88% 70%, 100% 78%,
    100% 100%, 26% 100%, 26% 91%, 6% 91%, 6% 100%, 0% 100%
  );
}

.hero__frame picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 22%;
}

/* a whisper of lilac to tie the photo to the palette */
.hero__wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(179,150,209,.16) 0%, rgba(179,150,209,0) 46%),
    linear-gradient(0deg, rgba(17,18,22,.22) 0%, rgba(17,18,22,0) 38%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* blank spots — paper shards cutting into the photo */
.shard {
  position: absolute;
  background: var(--paper);
  pointer-events: none;
  z-index: 2;
}

/* 1 — wedge off the top-right corner */
.shard--1 {
  top: -1px; right: -1px;
  width: 40%; height: 26%;
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%, 0 38%);
}
/* 2 — chevron cut into the left edge */
.shard--2 {
  top: 26%; left: -1px;
  width: 17%; height: 20%;
  clip-path: polygon(0 0, 100% 0, 62% 50%, 100% 100%, 0 100%);
}
/* 3 — stair notch along the lower right */
.shard--3 {
  bottom: -1px; right: 12%;
  width: 24%; height: 22%;
  clip-path: polygon(0 100%, 0 46%, 46% 46%, 46% 0, 100% 0, 100% 100%);
}
/* 4 — thin slash, off-rhythm */
.shard--4 {
  top: 58%; right: -1px;
  width: 11%; height: 9%;
  clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%);
}

.visual__tag {
  position: absolute;
  left: var(--gutter);
  bottom: 20px;
  z-index: 3;
  padding: 7px 10px;
  background: var(--ink);
  color: var(--paper);
  font: 500 9px/1 var(--font-mono);
  letter-spacing: .16em;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}

/* right: type panel */
.hero__panel {
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vh, 80px) var(--gutter);
  position: relative;
}

.hero__inner {
  width: 100%;
  max-width: 46ch;
  text-align: center;
  container-type: inline-size;
}

.kicker {
  margin: 0 0 clamp(18px, 3vh, 32px);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 500 10px/1 var(--font-mono);
  letter-spacing: .24em;
  color: var(--charcoal);
}

.title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(1.9rem, 7vw, 6rem);            /* fallback: viewport-based */
  font-size: clamp(1.9rem, 13cqw, 8.5rem);        /* preferred: column-based  */
  line-height: .86;
  letter-spacing: -.035em;
  text-transform: uppercase;
  position: relative;
}

/*
  The wordmark sits behind a torn edge and is only ever partly legible.
  Every glitch burst snaps it whole for a beat, then the tear returns.
*/
.title__line,
.title::before,
.title::after {
  clip-path: polygon(0 0, 67% 0, 62% 23%, 69% 41%, 60% 62%, 67% 81%, 61% 100%, 0 100%);
}

.title__line {
  display: block;
  animation: wipe .8s var(--ease) .2s backwards;
}

@keyframes wipe {
  from { opacity: 0; transform: translate3d(0, .22em, 0); }
  to   { opacity: 1; transform: none; }
}

/* full reveal — held for the length of a burst */
.title.is-open .title__line,
.title.is-open::before,
.title.is-open::after {
  clip-path: polygon(-6% -8%, 106% -8%, 106% -8%, 106% 50%, 106% 108%, 106% 108%, -6% 108%);
}

/* machine interference — chromatic split, driven from the soundtrack */
.title::before,
.title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.title::before { color: var(--lilac); }
.title::after  { color: var(--cyan); }

.title.is-glitch::before {
  opacity: .9;
  transform: translate3d(calc(var(--kick, 1) * -5px), 1px, 0);
}
.title.is-glitch::after {
  opacity: .75;
  transform: translate3d(calc(var(--kick, 1) * 5px), -1px, 0);
}
.title.is-glitch .title__line {
  transform: translate3d(calc(var(--kick, 1) * 1px), 0, 0);
}

.rule {
  width: 100%;
  height: 3px;
  margin: clamp(20px, 3.4vh, 34px) 0;
  background: linear-gradient(90deg,
    var(--ink)   0 17%,
    transparent 17% 21%,
    var(--lilac) 21% 29%,
    var(--ink)  29% 100%);
}

.subtitle {
  margin: 0;
  font-size: clamp(.95rem, 1.6vw, 1.25rem);
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--charcoal);
}

.cta {
  margin-top: clamp(26px, 4.4vh, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cta__note {
  margin: 0;
  font: 500 9px/1 var(--font-mono);
  letter-spacing: .22em;
  /* steel (#858E99) measured 2.73:1 on paper — below the 4.5:1 AA floor.
     Midnight navy is the guide's blue and measures 11.94:1. */
  color: var(--navy);
}

/* ── footer ─────────────────────────────────────────────────────────────── */

.footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--gutter) max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(17, 18, 22, .16);
  font: 500 9px/1.4 var(--font-mono);
  letter-spacing: .18em;
  color: var(--charcoal);
  position: relative;
  z-index: 10;
}

.footer__cell { display: inline-flex; align-items: center; gap: 8px; }
.footer__cell--mid { color: var(--steel); }

/* the status line hardens when the interference reaches it */
.footer__status { white-space: nowrap; }
.footer__status.is-alt { color: var(--ink); }
.footer__status.is-alt::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--coral);
}

/* ── grain ──────────────────────────────────────────────────────────────── */

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .5;
  mix-blend-mode: multiply;
  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='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

/* ── responsive ─────────────────────────────────────────────────────────── */

/* tablet / small laptop: give type a bit more room */
@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); }
}

/* stacked: image band on top, panel below — same jagged system, rotated */
@media (max-width: 800px), (orientation: portrait) and (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(190px, 40svh) auto;
  }

  .hero__visual { min-height: 0; }

  .hero__frame {
    clip-path: polygon(
      0% 0%, 100% 0%, 100% 100%,
      82% 100%, 78% 88%, 62% 88%, 58% 100%,
      30% 100%, 26% 90%, 10% 90%, 6% 100%,
      0% 100%
    );
  }

  .hero__frame img { object-position: 50% 16%; }

  .shard--1 { top: 0; right: 0; width: 26%; height: 30%; }
  .shard--2 { top: auto; bottom: 0; left: 0; width: 24%; height: 26%;
              clip-path: polygon(0 0, 100% 44%, 100% 100%, 0 100%); }
  .shard--3 { display: none; }
  .shard--4 { display: none; }

  .visual__tag { bottom: auto; top: 12px; left: var(--gutter); }

  .hero__panel { padding: clamp(22px, 4.2vh, 52px) var(--gutter); }
  .hero__inner { max-width: 30ch; }
  .cta { margin-top: clamp(20px, 3.4vh, 38px); }
  .rule { margin: clamp(16px, 2.6vh, 26px) 0; }

  .footer { font-size: 8px; letter-spacing: .14em; }
  .footer__cell--mid { display: none; }
}

@media (max-width: 460px) {
  .masthead { padding-top: 12px; padding-bottom: 12px; gap: 8px; }
  .brand__word { font-size: 11px; letter-spacing: .16em; }
  .btn { padding: 10px 12px; font-size: 9px; letter-spacing: .1em; }
  .btn--big { padding: 16px 20px; font-size: 11px; }
  /* Visually hidden, but still the button's accessible name — display:none
     would leave the toggle nameless for screen readers at this width. */
  .btn--ghost .btn__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .btn--ghost { padding: 10px; }
  .ticker__item { padding: 0 18px; }
}

/* narrow phones — every element on one line, nothing wrapping */
@media (max-width: 380px) {
  :root { --gutter: 14px; }
  .brand__mark { width: 18px; height: 18px; }
  .brand__word { font-size: 10px; letter-spacing: .12em; }
  .masthead__nav .btn { padding: 9px 10px; font-size: 8px; }
  .footer { font-size: 7px; letter-spacing: .1em; }
}

/* short screens — give the art less room so the page still fits */
@media (max-height: 640px) and (orientation: portrait) {
  .hero { grid-template-rows: minmax(140px, 27svh) auto; }
  .cta { margin-top: clamp(16px, 2.6vh, 28px); }
  .btn--big { padding: 14px 18px; }
}

/* very short landscape phones: keep everything on one screen */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { grid-template-columns: minmax(0, 40fr) minmax(0, 60fr); grid-template-rows: 1fr; }
  .hero__visual { min-height: 0; }
  .title { font-size: clamp(1.7rem, 11cqw, 3.2rem); }
  .cta { margin-top: 18px; }
  .rule { margin: 14px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .ticker__track { animation: none; }
  .title__line { animation: none; }
  .title__line,
  .title::before,
  .title::after { clip-path: none; }
  .title::before, .title::after { display: none; }
}

@media (prefers-contrast: more) {
  .grain { display: none; }
  .kicker, .subtitle, .footer { color: var(--ink); }
}
