/* ─────────────────────────────────────────────────────────────────────
   forgy — the one who stays put.

   The whole character is that he doesn't move while everything else
   does, so the page is built that way: a rail on the left that stays
   fixed in place, and a column of pictures that goes past it. On a
   phone the rail stops being sticky and simply sits on top, because a
   sticky panel on a small screen just eats the page.

   The art is coloured pencil on paper, so the page is paper: warm
   stock, hairline plate rules, no shadows, no glow, nothing that
   wouldn't survive being printed.
   ───────────────────────────────────────────────────────────────────── */

:root{
  --paper:#EFE8D9;
  --paper-2:#E6DDC9;
  --ink:#22301F;
  --ink-soft:#5E6D57;
  --sweater:#C2831F;   /* the jumper */
  --moss:#4C7748;
  --dusk:#95588A;      /* the sunsets */

  --font-d:'Petrona', Georgia, serif;
  --font-b:'Karla', system-ui, -apple-system, sans-serif;
  /* The address is case-sensitive, so it never goes in a display face. */
  --font-m:ui-monospace, SFMono-Regular, Menlo, 'DejaVu Sans Mono', monospace;

  --col:34rem;
  --gut:clamp(1.1rem, 4vw, 2.6rem);
  --hair:1px solid rgba(34,48,31,.26);
}

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

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

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--font-b);
  font-size:clamp(1rem, .95rem + .3vw, 1.08rem);
  line-height:1.68;
  overflow-x:hidden;
}

/* height:auto, or the width/height attributes on an <img> set a real height and
   every aspect-ratio below is quietly ignored. */
img{ max-width:100%; height:auto; display:block; }
video{ max-width:100%; display:block; }

a{ color:inherit; }

:focus-visible{ outline:3px solid var(--moss); outline-offset:3px; }

.skip{
  position:absolute; left:-9999px; top:0; z-index:50;
  background:var(--ink); color:var(--paper); padding:.7rem 1rem;
  font-weight:600; text-decoration:none;
}
.skip:focus{ left:.5rem; top:.5rem; }

/* ── top ─────────────────────────────────────────────────────────── */

.top{
  display:flex; align-items:center; gap:.7rem 1.4rem; flex-wrap:wrap;
  padding:.9rem var(--gut);
  border-bottom:var(--hair);
}

.top__name{
  font-family:var(--font-d); font-weight:600; font-size:1.4rem;
  margin-right:auto;
}

.top__links{ display:flex; gap:1.2rem; font-weight:600; font-size:.92rem; }
.top__links a{ text-decoration:none; color:var(--ink-soft); }
.top__links a:hover{ color:var(--sweater); }

.top__ca{
  display:inline-flex; align-items:baseline; gap:.5rem;
  font:inherit; color:var(--ink); cursor:pointer;
  background:transparent; border:var(--hair); border-radius:0;
  padding:.28rem .75rem; max-width:100%;
}
.top__ca:hover{ border-color:var(--sweater); }
.top__ca-label{ font-size:.72rem; font-weight:600; color:var(--ink-soft); }
.top__ca-value{ font-family:var(--font-m); font-size:.76rem; overflow:hidden; text-overflow:ellipsis; }

body[data-ca="pending"] .top__ca{ cursor:default; }
body[data-ca="pending"] .top__ca-value{ font-family:var(--font-b); font-weight:600; }

/* ── opening ─────────────────────────────────────────────────────── */

.open{
  padding:clamp(1.2rem,4vw,2.4rem) var(--gut) clamp(1.4rem,4vw,2.2rem);
  /* app.js measures the name and overwrites this; the clamp is the fallback if
     the script never runs. It lives here, not on .wordmark, because a local
     declaration on the heading would beat the value the script sets here. */
  --wm-size:clamp(3rem, 15vw, 9rem);
}

.open__frame{
  width:100%;
  aspect-ratio:2/1;
  max-height:min(62vh, 520px);
  overflow:hidden;
  border:var(--hair);
  background:var(--paper-2);
}
.open__frame video{ width:100%; height:100%; object-fit:cover; }

.wordmark{
  margin:clamp(.7rem,2vw,1.1rem) 0 0;
  font-family:var(--font-d); font-weight:500;
  font-size:var(--wm-size); line-height:.95;
  letter-spacing:-.015em;
  color:var(--ink);
}
.wordmark__inner{ display:inline-block; white-space:nowrap; }
.wordmark span{ display:inline-block; }

/* The one page-load moment: the name settles, once, slowly. */
.wordmark__inner span{
  animation:settle .7s cubic-bezier(.22,.78,.3,1) backwards;
  animation-delay:calc(var(--i) * 60ms + 140ms);
}
@keyframes settle{
  from{ opacity:0; transform:translateY(.1em); }
  to  { opacity:1; transform:none; }
}

/* ── band ────────────────────────────────────────────────────────── */

.band{
  overflow:hidden;
  border-top:var(--hair); border-bottom:var(--hair);
  padding:.55rem 0;
  background:var(--paper-2);
}
.band__row{ display:flex; width:max-content; animation:roll 36s linear infinite; }
.band__row span{
  font-family:var(--font-d); font-style:italic; font-size:1rem;
  color:var(--ink-soft);
  padding-right:3rem; white-space:nowrap;
}
@keyframes roll{ to{ transform:translateX(-50%); } }

/* ── the spread ──────────────────────────────────────────────────── */

.spread{
  display:grid;
  grid-template-columns:minmax(16rem, 22rem) minmax(0, 1fr);
  gap:clamp(1.5rem,4vw,3.5rem);
  align-items:start;
  max-width:76rem;
  margin:0 auto;
  padding:clamp(2rem,5vw,3.5rem) var(--gut);
}

.rail{
  position:sticky;
  top:clamp(1.5rem,4vw,3rem);
}
.rail__creed{
  margin:0 0 1rem;
  font-family:var(--font-d); font-weight:500;
  font-size:clamp(1.3rem,2.6vw,1.75rem); line-height:1.25;
}
.rail__note{
  margin:0 0 1.6rem;
  font-size:.95rem; color:var(--ink-soft);
  text-wrap:pretty;
}

.acts{ display:flex; flex-wrap:wrap; gap:.6rem; margin:0 0 1.6rem; }

.act{
  display:inline-block;
  font-family:var(--font-b); font-weight:600; font-size:.96rem;
  text-decoration:none; cursor:pointer;
  padding:.56rem 1.3rem;
  border:1.5px solid var(--ink); border-radius:0;
  background:transparent; color:var(--ink);
}
.act:hover{ background:var(--ink); color:var(--paper); }
.act--go{ background:var(--sweater); border-color:var(--sweater); color:#1A1405; }
.act--go:hover{ background:var(--ink); border-color:var(--ink); color:var(--paper); }
.act--quiet{
  border-color:transparent; color:var(--ink-soft);
  text-decoration:underline; text-underline-offset:3px;
  padding-left:.3rem; padding-right:.3rem;
}
.act--quiet:hover{ background:transparent; color:var(--sweater); }

body[data-ca="pending"] [data-scan-link]{ display:none; }

.rail__ca{ border-top:var(--hair); padding-top:1rem; }
.rail__ca-label{
  display:block;
  font-family:var(--font-d); font-style:italic; font-size:.9rem;
  color:var(--ink-soft); margin-bottom:.35rem;
}
.rail__ca-value{
  display:block;
  font-family:var(--font-m); font-size:.76rem; line-height:1.6;
  word-break:break-all;
}
body[data-ca="pending"] .rail__ca-value{ font-family:var(--font-b); font-weight:600; }

/* ── plates ──────────────────────────────────────────────────────── */

.plates{ display:grid; gap:clamp(2rem,5vw,3.4rem); }

.plate{ margin:0; }
.plate > img,
.plate > video{
  width:100%;
  aspect-ratio:1;
  object-fit:cover;
  border:var(--hair);
  background:var(--paper-2);
}
.plate--tall > video{ aspect-ratio:3/4; object-position:center 30%; }

.plate--pair{ display:grid; grid-template-columns:1fr 1fr; gap:clamp(.6rem,2vw,1.1rem); }
.plate--pair figcaption{ grid-column:1 / -1; }

.plate figcaption{
  margin-top:.8rem;
  font-family:var(--font-d); font-style:italic;
  font-size:1.02rem; line-height:1.5;
  color:var(--ink-soft);
  max-width:var(--col);
  text-wrap:pretty;
}

/* ── buy ─────────────────────────────────────────────────────────── */

.buy{
  max-width:44rem;
  margin:0 auto clamp(3rem,8vw,5rem);
  padding:clamp(2rem,5vw,3rem) var(--gut) 0;
  border-top:var(--hair);
}
.buy h2{
  font-family:var(--font-d); font-weight:600;
  font-size:clamp(1.8rem,5vw,2.6rem); line-height:1.1;
  margin:0 0 1.6rem;
}

.steps{ list-style:none; counter-reset:step; margin:0 0 2.4rem; padding:0; }
.steps li{ counter-increment:step; position:relative; padding:0 0 1.4rem 3.2rem; }
.steps li::before{
  content:counter(step);
  position:absolute; left:0; top:-.1rem;
  width:2.1rem; height:2.1rem;
  display:grid; place-items:center;
  font-family:var(--font-d); font-weight:600; font-size:1.05rem;
  color:var(--paper); background:var(--moss);
  border-radius:50%;
}
.steps h3{ font-family:var(--font-d); font-weight:600; font-size:1.12rem; margin:0 0 .15rem; }
.steps p{ margin:0; color:var(--ink-soft); }

.addr{ border:var(--hair); padding:clamp(1rem,4vw,1.6rem); background:var(--paper-2); }
.addr__label{
  display:block;
  font-family:var(--font-d); font-style:italic; font-size:.92rem;
  color:var(--ink-soft); margin-bottom:.4rem;
}
.addr__value{
  display:block;
  font-family:var(--font-m);
  font-size:clamp(.74rem,2.5vw,.92rem); line-height:1.6;
  word-break:break-all;
}
.addr__acts{ display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; margin-top:1.1rem; }
.addr__pending{ margin:1rem 0 0; font-size:.94rem; color:var(--ink-soft); }

body[data-ca="live"] .addr__pending{ display:none; }
body[data-ca="pending"] .addr__value{ font-family:var(--font-b); font-weight:600; }
body[data-ca="pending"] .addr [data-copy]{ display:none; }

/* ── foot ────────────────────────────────────────────────────────── */

.foot{
  text-align:center;
  padding:0 var(--gut) clamp(2.5rem,7vw,4rem);
  color:var(--ink-soft);
}
.foot__face{ width:clamp(4.5rem,13vw,6rem); height:auto; margin:0 auto 1rem; }
.foot__line{ max-width:34rem; margin:0 auto 1.1rem; font-size:.9rem; line-height:1.7; }
.foot__links{ display:flex; justify-content:center; gap:1.4rem; font-weight:600; }
.foot__links a{ text-decoration:none; }
.foot__links a:hover{ color:var(--sweater); }

/* ── toast ───────────────────────────────────────────────────────── */

.toast{
  position:fixed; left:50%; bottom:1.4rem; z-index:40;
  transform:translate(-50%, 1rem);
  margin:0; padding:.6rem 1.2rem;
  background:var(--ink); color:var(--paper);
  font-weight:600; font-size:.94rem;
  max-width:calc(100vw - 2rem);
  opacity:0; pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
}
.toast.is-up{ opacity:1; transform:translate(-50%, 0); }

/* ── narrow ──────────────────────────────────────────────────────── */

@media (max-width:52rem){
  .spread{ grid-template-columns:1fr; gap:2rem; }
  /* sticky on a small screen would cover the pictures it is meant to sit beside */
  .rail{ position:static; }
}

@media (max-width:34rem){
  .top__name{ margin-right:0; width:100%; }
  .top__ca{ order:3; width:100%; justify-content:center; }
  .plate--pair{ grid-template-columns:1fr; }
  .open__frame{ aspect-ratio:4/3; }
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important; animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
  .wordmark__inner span{ animation:none; }
}
