@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var-latin.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper:     #F2EDE3;
  --stone:     #D8D3C5;
  --black:     #111111;
  --indigo:    #1E3A8A;
  --gold:      #F2C24B;
  --vermilion: #E83820;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1.5rem, 5.6vw, 5.5rem);
}

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

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

body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--black);
  font-family: "Archivo", system-ui, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--black) var(--stone);
}

::selection { background: var(--vermilion); color: var(--paper); }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; white-space: nowrap;
  clip-path: inset(50%);
}

/* ---------- stage ---------- */

.stage {
  display: grid;
  height: 100%;
  min-height: 34rem;
  grid-template-columns: 54fr 46fr;
}

.plate {
  grid-column: 1;
  align-self: center;
  padding: var(--gutter);
  padding-right: clamp(1.5rem, 3vw, 3rem);
  max-width: 46rem;
}

.figure {
  grid-column: 2;
  position: relative;
  overflow: hidden;
}

.figure svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.figure svg.figure__wide { display: block; }
.figure svg.figure__tall { display: none; }

/* ---------- planes ---------- */

.pl--black  { fill: var(--black); }
.pl--indigo { fill: var(--indigo); }
.pl--face   { fill: var(--paper); }
.pl--dome   { fill: var(--gold); }
.pl--eye    { fill: var(--indigo); }

/* ---------- type ---------- */

.wordmark {
  margin: 0;
  font-size: clamp(3rem, 7.4vw, 6rem);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 0.84;
  letter-spacing: -0.028em;
  text-transform: uppercase;
}

.wordmark span { display: block; }

.rule {
  height: 1px;
  background: var(--black);
  margin: clamp(1.6rem, 2.8vw, 2.6rem) 0 clamp(0.9rem, 1.4vw, 1.2rem);
  transform-origin: left center;
}

.caption {
  margin: 0;
  font-size: clamp(0.7rem, 0.92vw, 0.8125rem);
  font-weight: 500;
  font-stretch: 104%;
  letter-spacing: 0.22em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* ---------- the one action ---------- */

.post {
  display: inline-block;
  margin-top: clamp(2.6rem, 5vw, 4.25rem);
  line-height: 0;
  border-radius: 1px;
}

.post__mark {
  display: block;
  width: clamp(78px, 6.6vw, 96px);
  height: auto;
  transition: transform 340ms var(--ease);
}

.post__body { fill: var(--vermilion); }

.post__flap {
  fill: var(--black);
  transform-box: fill-box;
  transform-origin: 50% 0%;
  transition: transform 340ms var(--ease);
}

.post:hover .post__mark,
.post:focus-visible .post__mark { transform: translateY(-4px); }

.post:hover .post__flap,
.post:focus-visible .post__flap { transform: scaleY(0.34); }

.post:active .post__mark { transform: translateY(0); }

/* ---------- material ---------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}

/* ---------- portrait recomposition ---------- */

@media (max-width: 900px) and (orientation: portrait), (max-width: 560px) {
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: 42% 1fr;
  }
  .plate {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    padding-right: var(--gutter);
  }
  .figure {
    grid-column: 1;
    grid-row: 1;
  }
  .figure svg.figure__wide { display: none; }
  .figure svg.figure__tall { display: block; }
  .wordmark { font-size: clamp(2.75rem, 12.5vw, 4.5rem); }
  .caption  { font-size: 0.75rem; letter-spacing: 0.2em; }
  .post__mark { width: 84px; }
}

@media (max-width: 900px) and (max-height: 620px) and (orientation: portrait) {
  .stage { grid-template-rows: 34% 1fr; }
  .wordmark { font-size: clamp(2.25rem, 9vw, 3rem); }
}

/* ---------- short landscape: a phone held sideways ---------- */

@media (orientation: landscape) and (max-height: 560px) {
  .stage { min-height: 0; }
  .plate { padding-block: clamp(0.75rem, 3vh, 1.5rem); }
  .wordmark { font-size: clamp(1.9rem, 6.4vw, 3.5rem); }
  /* keep the 2:1 asymmetry: more space above the rule than below it */
  .rule    { margin-top: clamp(0.8rem, 2.6vh, 1.5rem); margin-bottom: clamp(0.45rem, 1.3vh, 0.75rem); }
  .caption { font-size: 0.72rem; letter-spacing: 0.18em; }
  .post    { margin-top: clamp(0.9rem, 3vh, 1.75rem); }
  .post__mark { width: 68px; }
}

/* ---------- the one authored moment ---------- */

@media (prefers-reduced-motion: no-preference) {
  .pl--black  { animation: wipe-right 620ms var(--ease) both; }
  .pl--indigo { animation: wipe-down  620ms var(--ease) 110ms both; }
  .pl--face   { animation: wipe-down  680ms var(--ease) 250ms both; }
  .pl--dome   { animation: rise       700ms var(--ease) 380ms both; }
  .pl--eye    { animation: strike     420ms var(--ease) 720ms both; }

  .wordmark span:first-child { animation: lift 700ms var(--ease) 180ms both; }
  .wordmark span:last-child  { animation: lift 700ms var(--ease) 280ms both; }
  .rule    { animation: draw 640ms var(--ease) 560ms both; }
  .caption { animation: lift 640ms var(--ease) 680ms both; }
  .post    { animation: settle 560ms var(--ease) 880ms both; }

  @keyframes wipe-right { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes wipe-down  { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes rise       { from { transform: translateY(38%); }   to { transform: translateY(0); } }
  @keyframes strike     { from { transform: scaleY(0); }         to { transform: scaleY(1); } }
  @keyframes lift       { from { clip-path: inset(105% 0 0 0); } to { clip-path: inset(-30% 0 -10% 0); } }
  @keyframes draw       { from { transform: scaleX(0); }         to { transform: scaleX(1); } }
  @keyframes settle     { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

  .pl--dome, .pl--eye { transform-box: fill-box; }
  .pl--dome { transform-origin: 50% 100%; }
  .pl--eye  { transform-origin: 50% 0%; }
}
