/* ─────────────────────────────────────────────────────────────
   19eighty4.net — Ministry of Truth, Records Department
   ───────────────────────────────────────────────────────────── */

@property --gx { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --gy { syntax: "<number>"; inherits: true; initial-value: 0; }

:root {
  --ink: #140b07;
  --ink-2: #21120a;
  --paper: #f3dfb0;
  --paper-dim: #bda57c;
  --orange: #e8742a;
  --red: #d63a22;

  --display: "Big Shoulders Display", "Oswald", Impact, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --ease-out: cubic-bezier(.2, .8, .2, 1);

  /* Fractal noise, reused for film grain and stamp ink. */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --ink-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035 .09' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -9 6.7'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

html {
  background: var(--ink);
  color: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 90% at 70% 30%, var(--ink-2), var(--ink) 70%);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── Page frame ─────────────────────────────────────────────── */

.page {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: clip;
  padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 10;
  pointer-events: none;
  background-image: var(--noise);
  opacity: .09;
  mix-blend-mode: overlay;
  animation: grain 1s steps(4) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -4%); }
  75%  { transform: translate(-1%, 3%); }
}

.masthead,
.colophon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 2rem;
  padding-block: 1.1rem;
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.masthead {
  border-bottom: 1px solid color-mix(in oklab, var(--paper) 14%, transparent);
}

.masthead__org { color: var(--paper); font-weight: 500; }

.masthead__rec {
  display: inline-flex;
  align-items: center;
  gap: .6em;
}

.masthead__rec i {
  width: .6em;
  height: .6em;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 var(--red);
  animation: rec 2s var(--ease-out) infinite;
}

@keyframes rec {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--red) 70%, transparent); }
  70%  { box-shadow: 0 0 0 .7em transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.masthead__clock { font-variant-numeric: tabular-nums; }

.colophon {
  border-top: 1px solid color-mix(in oklab, var(--paper) 14%, transparent);
}

/* ── Stage ──────────────────────────────────────────────────── */

.stage {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
  padding-block: clamp(2rem, 6vh, 4rem);
}

@media (min-width: 960px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: start;
  }
}

.notice {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: start;
  gap: clamp(1.25rem, 3vh, 2rem);
  width: 100%;
  max-width: 40rem;
}

.eyebrow {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1em;
  font-size: .75rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--orange);
}

.eyebrow::before {
  content: "";
  width: 3rem;
  height: 2px;
  background: currentColor;
}

/* The stamp: slammed onto the page, ink-textured. */
.stamp {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(6.5rem, 19vw, 15.5rem);
  line-height: .8;
  letter-spacing: -.01em;
  rotate: -4deg;
  transform-origin: 40% 60%;
  animation: slam .7s cubic-bezier(.5, 0, .75, 0) .25s both;
}

.stamp span {
  display: block;
  padding: .1em .14em .02em;
  background: var(--red);
  color: var(--ink);
  outline: .025em solid var(--red);
  outline-offset: .045em;
  -webkit-mask: var(--ink-mask) center / 420px;
          mask: var(--ink-mask) center / 420px;
}

@keyframes slam {
  0%   { opacity: 0; scale: 2.4; filter: blur(6px); }
  60%  { opacity: 1; filter: blur(0); }
  78%  { scale: .96; }
  100% { opacity: 1; scale: 1; }
}

/* Screen shake on impact. */
.page { animation: thud .35s linear .68s both; }

@keyframes thud {
  0%, 100% { translate: 0 0; }
  20% { translate: -4px 3px; }
  40% { translate: 3px -2px; }
  60% { translate: -2px 1px; }
  80% { translate: 1px 0; }
}

/* ── Slogan (the Ministry edits it live) ────────────────────── */

.slogan {
  margin: 0;
  min-height: 2.6em;
  font-size: clamp(1.05rem, 2.2vw, 1.55rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-wrap: balance;
}

.slogan__word {
  position: relative;
  white-space: nowrap;
  transition: color .3s;
}

.slogan__word::after {
  content: "";
  position: absolute;
  left: -.15em;
  right: -.15em;
  top: 52%;
  height: .14em;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  rotate: -2deg;
  transition: transform .35s var(--ease-out);
}

.slogan__word.is-struck { color: var(--paper-dim); }
.slogan__word.is-struck::after { transform: scaleX(1); }

.slogan__fix {
  display: inline-block;
  margin-left: .35em;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.25em;
  line-height: 1;
  letter-spacing: .02em;
  color: var(--orange);
  rotate: -3deg;
  translate: 0 -.12em;
}

.slogan__fix:not(:empty)::after {
  content: "";
  display: inline-block;
  width: .08em;
  height: .8em;
  margin-left: .06em;
  background: currentColor;
  vertical-align: -.05em;
  animation: caret .8s steps(1) infinite;
}

.slogan__fix.is-done::after { display: none; }

@keyframes caret { 50% { opacity: 0; } }

.slogan.is-leaving { opacity: 0; translate: 0 -.4em; transition: opacity .4s, translate .4s; }
.slogan.is-entering { animation: enter .5s var(--ease-out); }

@keyframes enter { from { opacity: 0; translate: 0 .5em; } }

.aside {
  margin: 0;
  font-size: .85rem;
  color: var(--paper-dim);
  max-width: 34ch;
  text-wrap: pretty;
}

/* ── Poster ─────────────────────────────────────────────────── */

.poster {
  --size: min(100%, 34rem);
  position: relative;
  margin: 0;
  width: var(--size);
  display: grid;
  gap: 1rem;
  justify-items: center;
}

@media (min-width: 960px) {
  .poster { --size: min(44vw, 74svh); }
}

/* Sunburst radiating from the sun behind the figure. */
.poster::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 49%;
  top: 27%;
  width: 260vmax;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: repeating-conic-gradient(
    color-mix(in oklab, var(--orange) 13%, transparent) 0deg 5deg,
    transparent 5deg 12deg
  );
  -webkit-mask: radial-gradient(closest-side, #000 8%, transparent 42%);
          mask: radial-gradient(closest-side, #000 8%, transparent 42%);
  animation: spin 180s linear infinite;
}

@keyframes spin { to { rotate: 1turn; } }

.poster__frame {
  position: relative;
  width: 100%;
  padding: clamp(6px, 1.1vw, 14px);
  background: var(--paper);
  rotate: 1.5deg;
  box-shadow:
    0 1px 0 color-mix(in oklab, var(--paper) 50%, transparent) inset,
    0 30px 60px -20px rgb(0 0 0 / .8),
    0 60px 120px -40px color-mix(in oklab, var(--orange) 35%, transparent);
  animation: hang 1.1s var(--ease-out) .05s both;
}

@keyframes hang {
  from { opacity: 0; translate: 0 2rem; rotate: 5deg; }
}

/* Masking tape. */
.poster__frame::before,
.poster__frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: -12px;
  width: 22%;
  height: 28px;
  background: color-mix(in oklab, var(--paper) 55%, transparent);
  -webkit-backdrop-filter: blur(1px);
          backdrop-filter: blur(1px);
  box-shadow: 0 1px 2px rgb(0 0 0 / .25);
}

.poster__frame::before { left: -4%; rotate: -32deg; }
.poster__frame::after  { right: -4%; rotate: 28deg; }

.poster img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  background: var(--orange);
}

/* ── The glasses notice you ─────────────────────────────────── */
/* Lens positions measured against the 2048px source artwork. */

.lens {
  --pad: clamp(6px, 1.1vw, 14px);
  position: absolute;
  top: calc(var(--pad) + (100% - 2 * var(--pad)) * .2334);
  width: calc((100% - 2 * var(--pad)) * .047);
  height: calc((100% - 2 * var(--pad)) * .029);
  border-radius: 38% 38% 48% 48%;
  overflow: hidden;
  pointer-events: none;
}

.lens--l { left: calc(var(--pad) + (100% - 2 * var(--pad)) * .4555); }
.lens--r { left: calc(var(--pad) + (100% - 2 * var(--pad)) * .5245); }

/* A glint that tracks the pointer. */
.lens::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  translate: calc(-50% + var(--gx) * 90%) calc(-50% + var(--gy) * 70%);
  background: radial-gradient(circle, rgb(255 246 220 / .95), rgb(255 230 180 / .35) 35%, transparent 70%);
  transition: translate .6s var(--ease-out), background .4s;
}

/* An occasional sheen sweeping across both lenses. */
.lens::after {
  content: "";
  position: absolute;
  inset: -50% -150%;
  background: linear-gradient(105deg, transparent 42%, rgb(255 244 214 / .55) 50%, transparent 58%);
  translate: -60% 0;
  animation: sheen 7s ease-in-out 2s infinite;
}

@keyframes sheen {
  0%, 82% { translate: -60% 0; }
  100%    { translate: 60% 0; }
}

/* Linger on the poster and it looks back. */
.poster.is-locked .lens::before {
  background: radial-gradient(circle, rgb(255 90 60), rgb(214 58 34 / .7) 40%, transparent 72%);
  translate: -50% -50%;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: .55; } }

.poster figcaption {
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--paper-dim);
  rotate: 1.5deg;
}

/* ── Motion preferences ─────────────────────────────────────── */

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