/* DMIYC 2 · shared look: the dictionary entry, shot on tape.
   Camcorder viewfinder, photocopy grain, marker strikes, red rubber stamps.
   Pages set their own palette on :root (the homepage is light paper, the Lies room is damaged tape). */

:root {
  --bg: #e9e9e5;          /* photocopy paper */
  --bg-2: #dcdcd7;        /* recessed fields */
  --ink: #0e0e0e;
  --ink-soft: #5a5b55;
  --rule: rgba(14, 14, 14, .2);
  --on-ink: #e9e9e5;      /* type on ink fills */
  --red: #d9261c;         /* REC light and stamp ink, the only color */
  --marker: #0e0e0e;
  --grain-blend: multiply;
  --grain-opacity: .22;

  --f-head: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --f-osd: "VT323", "IBM Plex Mono", ui-monospace, monospace;

  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --static: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix values='4 0 0 0 -1.5  4 0 0 0 -1.5  4 0 0 0 -1.5  0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
  --ink-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='70'%3E%3Cfilter id='i'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  -14 0 0 0 8.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23i)'/%3E%3C/svg%3E");

  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--ink); }
body {
  margin: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.5;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Film grain, drifting. */
.grain {
  position: fixed; inset: -50%; z-index: 60; pointer-events: none;
  background-image: var(--noise); opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
  animation: grain .6s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 17% { transform: translate(-4%, 3%); } 33% { transform: translate(3%, -5%); }
  50% { transform: translate(-6%, -2%); } 67% { transform: translate(5%, 4%); } 83% { transform: translate(-2%, 6%); } 100% { transform: translate(0, 0); }
}

.sheet { max-width: 1120px; margin: 0 auto; }
.label { font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.soft { color: var(--ink-soft); }

/* Top line above the viewfinder */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 16px 0 14px; }
.top a { text-decoration: none; }
.top a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Camcorder viewfinder: corner brackets, OSD rows top and bottom. */
.vf { position: relative; padding: 16px 18px 18px; }
.vf::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  --c: var(--ink); --l: 26px; --w: 2px;
  background:
    linear-gradient(var(--c), var(--c)) left top / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) left top / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) right top / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) right top / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / var(--w) var(--l) no-repeat;
}
.osd {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-family: var(--f-osd); font-size: 24px; line-height: 1; text-transform: uppercase; letter-spacing: .03em;
}
.osd > span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.rec-dot { width: 13px; height: 13px; border-radius: 50%; background: var(--red); animation: blink 1s steps(1) infinite; }
.play-tri { width: 0; height: 0; border-left: 12px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.pause-bars { width: 12px; height: 14px; border-left: 4px solid currentColor; border-right: 4px solid currentColor; }

.headword {
  margin: 18px 0 6px;
  font-family: var(--f-head); font-weight: 900; font-stretch: 62%; font-variation-settings: "wdth" 62;
  font-size: clamp(132px, 40vw, 430px); line-height: .78; letter-spacing: -.02em; text-transform: uppercase;
  white-space: nowrap;
}
.pron { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 18px; font-family: var(--f-mono); font-size: 15px; color: var(--ink-soft); }
.pron i { font-family: var(--f-head); font-style: normal; font-weight: 700; font-size: 18px; color: var(--ink); }
.etym { margin: 28px 0 22px; max-width: 54ch; font-size: 17px; line-height: 1.5; color: var(--ink-soft); }
.etym b { color: var(--ink); font-weight: 700; }

/* Definitions: big condensed caps, crossed out in marker, stamped. */
.senses { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.sense {
  position: relative; display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); align-items: center;
  padding: 18px 150px 18px 0; min-height: 76px; border-bottom: 1px solid var(--rule);
}
.sense .n { font-family: var(--f-osd); font-size: 26px; line-height: 1; color: var(--ink-soft); }
.sense .t {
  position: relative; justify-self: start; min-width: 0;
  font-family: var(--f-head); font-weight: 800; font-stretch: 75%; font-variation-settings: "wdth" 75;
  font-size: clamp(25px, 4.1vw, 46px); line-height: 1.02; letter-spacing: .005em; word-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft);
}
.mk { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.mk path { fill: none; stroke: var(--marker); stroke-linecap: round; stroke-linejoin: round; }
.stamp {
  position: absolute; right: 6px; top: 50%; translate: 0 -50%; rotate: var(--rot, -6deg);
  font-family: var(--f-head); font-weight: 900; font-stretch: 85%; font-variation-settings: "wdth" 85;
  font-size: 16px; line-height: 1; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  color: var(--red); border: 3px solid var(--red); padding: 7px 10px 6px 12px;
  -webkit-mask-image: var(--ink-mask); mask-image: var(--ink-mask);
  -webkit-mask-size: 140px 70px; mask-size: 140px 70px;
  mix-blend-mode: var(--grain-blend);
  animation: stampin .34s cubic-bezier(.2, 1.5, .4, 1) both; animation-delay: var(--sd, 0s);
}
.sense.yours .t { color: var(--ink); }
.sense.open { padding-right: 0; }
.sense.open .t {
  font-weight: 900; color: var(--on-ink); background: var(--ink); padding: 6px 12px 3px;
}
.caret { display: inline-block; width: .5em; height: .82em; margin-left: 6px; vertical-align: -.06em; background: currentColor; animation: blink 1.1s steps(1) infinite; }

@keyframes stampin { from { opacity: 0; scale: 1.9; } to { opacity: 1; scale: 1; } }
@keyframes blink { 50% { opacity: 0; } }

/* Submit a definition */
.attempt { display: grid; gap: 10px; margin-top: 30px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.row input {
  flex: 1 1 260px; min-width: 0;
  font-family: var(--f-head); font-weight: 700; font-stretch: 85%; font-variation-settings: "wdth" 85;
  font-size: 22px; text-transform: uppercase; color: var(--ink);
  background: transparent; border: 2px solid var(--ink); border-radius: 0; padding: 12px 14px;
}
.row input::placeholder { color: var(--ink-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 0 22px;
  font-family: var(--f-mono); font-weight: 500; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  background: var(--ink); color: var(--on-ink); border: 2px solid var(--ink); border-radius: 0;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--red); border-color: var(--red); color: #fff; }
.note { margin: 0; min-height: 1.2em; font-family: var(--f-osd); font-size: 22px; line-height: 1.1; text-transform: uppercase; color: var(--red); }

/* Sections */
.sec { display: grid; gap: 20px; margin-top: 96px; scroll-margin-top: 16px; }
.sec-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; border-top: 2px solid var(--ink); padding-top: 10px; }

/* TV static for anything sealed */
.static {
  position: relative; overflow: hidden; background: #111;
}
.static::before {
  content: ""; position: absolute; inset: -40px; background-image: var(--static); opacity: .55;
  animation: static .28s steps(3) infinite;
}
.static::after {
  content: attr(data-osd); position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  font-family: var(--f-osd); font-size: 26px; letter-spacing: .06em; color: #f2f2ee; background: #111; padding: 3px 10px 1px; white-space: nowrap;
}
@keyframes static { 0% { transform: translate(0, 0); } 33% { transform: translate(-22px, 14px); } 66% { transform: translate(17px, -19px); } 100% { transform: translate(0, 0); } }

.redact { display: inline-block; height: .9em; background: var(--ink); vertical-align: -.08em; }
.meta { font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.chip {
  justify-self: start; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  border: 1.5px solid var(--ink); padding: 4px 8px 3px;
}
.chip.live { background: var(--red); border-color: var(--red); color: #fff; }
.chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1s steps(1) infinite; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: 96px; border-top: 2px solid var(--ink); padding-top: 12px; color: var(--ink-soft);
}

@media (max-width: 640px) {
  .vf { padding: 12px 12px 14px; }
  .vf::before { --l: 18px; }
  .osd { font-size: 20px; }
  .osd .wide { display: none; }
  .sense { grid-template-columns: 2.4rem minmax(0, 1fr); padding: 16px 0 54px; }
  .sense.open { padding-bottom: 16px; }
  .sense .n { font-size: 22px; align-self: start; padding-top: 4px; }
  .stamp { top: auto; bottom: 12px; right: 4px; translate: none; font-size: 14px; }
  .sec, .foot { margin-top: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
