/* =====================================================================================
   Curio Bench · coming soon
   Type is the Ep. 01 system (assets/templates/studio-dark/tokens.css): Barlow Condensed
   ExtraBold headline, Instrument Serif italic accent word, JetBrains Mono microtext.
   Layout is comp 3: the picture on top, the headline under it, one screen, no boxes.
   ===================================================================================== */

@font-face { font-family: "AwwwardsDisplay"; src: url("./fonts/BarlowCondensed-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: block; }
@font-face { font-family: "EditorialSerif"; src: url("./fonts/InstrumentSerif-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: block; }
@font-face { font-family: "StudioMono"; src: url("./fonts/JetBrainsMono-Variable.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "StudioInk"; src: url("./fonts/Kalam-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --font-display: "AwwwardsDisplay", "Arial Narrow", sans-serif;
  --font-serif: "EditorialSerif", Georgia, serif;
  --font-mono: "StudioMono", ui-monospace, monospace;

  --text: #f2ede3;
  --text-2: #bdb7ab;
  --text-3: #8a8478;
  --accent: #b6a6ff;
  /* background: the Ep. 01 cover (violet + coral aurora on obsidian, 35mm grain) */
  --glow-a: 124, 108, 255;
  --glow-b: 255, 113, 91;
  --bg-top: #121119;
  --bg-mid: #0b0b10;
  --bg-bottom: #09090c;
  --grain: .055;
  --line-major: rgba(242, 237, 227, .5);
  --stroke-major: 1.5px solid var(--line-major);

  --pad-x: clamp(18px, 4.4vw, 64px);
  --pad-y: clamp(16px, 3vh, 36px);
  /* one line on wide screens, sized by whichever runs out first: width or height */
  --headline: clamp(44px, min(7.8vw, 11vh), 148px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg-bottom); color: var(--text); }
body {
  /* Ep. 01 palette, but quieter: the light only lives in the far corners,
     the middle (Curio + headline) is near-pure black, like a gallery wall */
  background:
    radial-gradient(ellipse 55% 50% at 50% 52%, #050507 0%, rgba(5, 5, 7, .92) 40%, rgba(5, 5, 7, 0) 100%),
    radial-gradient(ellipse 38% 30% at 100% 0%, rgba(var(--glow-a), .2) 0%, rgba(var(--glow-a), .05) 50%, transparent 80%),
    radial-gradient(ellipse 30% 26% at 0% 100%, rgba(var(--glow-b), .09) 0%, rgba(var(--glow-b), .02) 55%, transparent 80%),
    linear-gradient(168deg, #0d0c12 0%, #070709 50%, #050507 100%);
  min-height: 100svh;
}
/* film grain over everything, never catches clicks */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: calc(var(--grain) / .055);
  background-image: 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='0.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
}
body {
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
::selection { background: var(--accent); color: #000; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

main {
  height: 100svh;
  min-height: 420px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  padding: var(--pad-y) var(--pad-x);
  overflow: hidden;
}

/* ---------------------------------------------------------------- wordmark (in the footer)
   Set in the headline's two faces: condensed CURIO + violet italic bench. */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: .14em;
  line-height: 1;
  font-size: clamp(20px, 1.7vw, 26px);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
.wm-a {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.01em;
  color: var(--text);
}
.wm-b {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1em;
  letter-spacing: -.02em;
  color: var(--accent);
  transition: letter-spacing .5s var(--ease);
}
.wordmark:hover .wm-b { letter-spacing: .02em; }

/* ---------------------------------------------------------------- footer (Ep. 01) */
.footer {
  position: relative;
  z-index: 2;
  font-size: clamp(11px, 1vw, 14px);
  text-transform: uppercase;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  border-top: var(--stroke-major);
  letter-spacing: .12em;
}
.brand-sig { display: inline-flex; align-items: baseline; gap: 18px; color: var(--text); font-weight: 700; }
.motto { color: var(--text-3); font-weight: 500; white-space: nowrap; }
.next-cue { color: var(--text); font-weight: 600; white-space: nowrap; }

/* ---------------------------------------------------------------- picture */
.hero {
  position: relative;
  min-height: 0;
  margin: 0 calc(var(--pad-x) * -1);
}
/* Curio is a tall cut-out: he takes the full height above the headline,
   head to feet, centered. Never cropped, on any screen. */
.hero .curio {
  position: absolute;
  top: clamp(10px, 2.4vh, 28px);
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  height: calc(100% - clamp(10px, 2.4vh, 28px));
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  /* a sticker on the page: same lift as .sticker in the posts */
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .82)) drop-shadow(0 3px 6px rgba(0, 0, 0, .5));
  animation: lift .8s var(--ease) both;
}
@keyframes lift { from { opacity: 0; transform: translateY(24px); } }
.hero .curio { z-index: 2; }

/* ---------------------------------------------------------------- living background
   ink.js draws a WebGL hatching shader into this canvas. It sits behind everything,
   fades in once the first frame is ready, and never catches clicks. */
.ink-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s var(--ease);
}
.ink-bg.on { opacity: 1; }
main { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- doodles
   Same ink language as Curio: bone strokes, round caps. Driven in random rounds
   by ink.js (.is-in -> hold together -> .is-out): pure pen draw-in and draw-out,
   no fade. */
.doodles { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.doodle {
  position: absolute;
  overflow: visible;
  opacity: .78;
}
.doodle path {
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}
.doodle path.accent { stroke: var(--accent); }
.doodle path.hidden-edge { stroke: rgba(242, 237, 227, .38); stroke-width: 1.3; }
.doodle path.fill { fill: rgba(var(--glow-a), .45); fill-opacity: 0; stroke: var(--accent); }
.doodle path.blink { stroke: var(--accent); }

.doodle.is-in path {
  animation: doodle-in .72s cubic-bezier(.22, .68, .28, 1) forwards;
}
.doodle.is-in path.fill {
  animation: doodle-in .72s cubic-bezier(.22, .68, .28, 1) forwards, fill-in .18s .54s linear forwards;
}
.doodle.is-in path.blink {
  animation: doodle-in .72s cubic-bezier(.22, .68, .28, 1) forwards, blink-stroke 1s .75s steps(1) infinite;
}

.doodle.is-out path {
  animation: doodle-out .6s cubic-bezier(.55, .06, .68, .19) forwards;
}
.doodle.is-out path.fill {
  animation: fill-out .14s linear forwards, doodle-out .6s .08s cubic-bezier(.55, .06, .68, .19) forwards;
}

@keyframes doodle-in {
  0%   { stroke-dashoffset: 1; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes doodle-out {
  0%   { stroke-dashoffset: 0; opacity: 1; }
  99%  { stroke-dashoffset: -1; opacity: 1; }
  100% { stroke-dashoffset: -1; opacity: 0; }
}
@keyframes fill-in  { from { fill-opacity: 0; } to { fill-opacity: 1; } }
@keyframes fill-out { from { fill-opacity: 1; } to { fill-opacity: 0; } }
@keyframes blink-stroke { 50% { stroke-opacity: 0; } }

.d-code   { left: 6%;  top: 10%; width: 120px; transform: rotate(-6deg); }
.d-film   { right: 7%; top: 8%;  width: 132px; transform: rotate(5deg); }
.d-bezier { left: 14%; top: 38%; width: 112px; transform: rotate(4deg); }
.d-eye    { right: 15%;top: 38%; width: 110px; transform: rotate(-5deg); }
.d-flask  { left: 7%;  top: 66%; width: 88px;  transform: rotate(-7deg); }
.d-cube   { right: 15%;top: 64%; width: 100px; transform: rotate(-4deg); }
.d-spark  { left: 19%; top: 76%; width: 78px;  transform: rotate(8deg); }
.d-wave   { right: 6%; top: 78%; width: 124px; transform: rotate(3deg); }

/* ---------------------------------------------------------------- Curio's note */
.note {
  position: absolute;
  z-index: 3;
  left: calc(50% + clamp(96px, 10vw, 170px));
  top: 16%;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  flex-direction: row-reverse;
  font-family: "StudioInk", cursive;
  font-weight: 700;
  font-size: clamp(17px, 1.5vw, 23px);
  line-height: 1.12;
  color: var(--accent);
  transform: rotate(-4deg);
  transform-origin: 0 50%;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .9);
  white-space: nowrap;
  pointer-events: none;
  animation: scribble .6s .8s var(--ease) both;
}
.note svg { flex: 0 0 auto; margin-top: 10px; }
.note svg path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes scribble { from { opacity: 0; transform: rotate(-4deg) translateY(6px); clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------------------------------------------------------------- headline */
.below {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: clamp(4px, 1.2vh, 14px) 0 clamp(16px, 3vh, 34px);
}
.headline {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: .22em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--headline);
  line-height: .87;
  letter-spacing: -.025em;
  text-transform: uppercase;
  white-space: nowrap;
}
.row { display: block; overflow: hidden; padding: .04em .02em .02em; }
.row .in { display: block; animation: rise .7s var(--ease) both; }
.row:nth-child(1) .in { animation-delay: .1s; }
.row:nth-child(2) .in { animation-delay: .18s; }
@keyframes rise { from { transform: translateY(105%); } }
.headline em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  font-size: 1.08em;
  letter-spacing: -.02em;
  line-height: .82;
  padding-left: .08em;
  color: var(--accent);
}

.sub {
  margin-top: clamp(18px, 3vh, 32px);
  animation: fade .6s .35s var(--ease) both;
}

/* ---------------------------------------------------------------- the button: a sticker plate
   A white parallelogram with a thick ink border and a hard black offset shadow, the
   same white-on-ink language as Curio's die-cut edge. The SVG filter (#ink-edge in the
   HTML) makes the straight lines wobble like a pen drew them. Press = it sinks into
   its shadow. */
.ink-btn {
  --skew: -12deg;
  --shadow: 7px;
  position: relative;
  display: inline-block;
  padding: 14px 30px 13px;
  transform: skewX(var(--skew));
  isolation: isolate;
  transition: transform .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
/* the plate and its shadow are pseudo-elements, so only they get the wobbly filter;
   the label stays crisp */
.ink-btn::before, .ink-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2.5px solid #0b0b0b;
  filter: url(#ink-edge);
}
.ink-btn::before {
  z-index: -1;
  background: var(--text);
  transition: background-color .3s, transform .25s var(--ease);
}
/* hard shadow, hatched like the ink drawings instead of a flat blur */
.ink-btn::after {
  z-index: -2;
  transform: translate(var(--shadow), var(--shadow));
  background:
    repeating-linear-gradient(-45deg, #0b0b0b 0 2px, transparent 2px 5px),
    rgba(11, 11, 11, .55);
  border-color: rgba(242, 237, 227, .35);
  transition: transform .25s var(--ease);
}
.ink-btn__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transform: skewX(calc(var(--skew) * -1));
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #0b0b0b;
  white-space: nowrap;
}
.ink-btn__arrow { display: inline-block; transition: transform .3s var(--ease); }

.ink-btn:hover::before, .ink-btn:focus-visible::before { background: var(--accent); }
.ink-btn:hover .ink-btn__arrow, .ink-btn:focus-visible .ink-btn__arrow { transform: translate(3px, -3px); }
.ink-btn:hover, .ink-btn:focus-visible { transform: skewX(var(--skew)) translate(-2px, -2px); outline: none; }
.ink-btn:hover::after, .ink-btn:focus-visible::after { transform: translate(calc(var(--shadow) + 2px), calc(var(--shadow) + 2px)); }
.ink-btn:active { transform: skewX(var(--skew)) translate(var(--shadow), var(--shadow)); transition-duration: .08s; }
.ink-btn:active::after { transform: translate(0, 0); transition-duration: .08s; }
.ink-btn:focus-visible::before { outline: 2px solid var(--accent); outline-offset: 5px; }

.defs { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.footer { animation: fade .6s .05s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- phones & portrait */
@media (max-width: 760px), (orientation: portrait) {
  /* two stacked lines, as big as the width allows */
  .headline { flex-direction: column; align-items: center; gap: 0; font-size: min(15vw, 9svh, 116px); }
}
@media (max-width: 560px) {
  .motto { display: none; }
}
/* narrow screens: hide doodles and note below tablet so Curio has clean breathing room */
@media (max-width: 760px) {
  .doodles, .note { display: none; }
}
/* short landscape phones: picture shrinks first, type stays readable */
@media (max-height: 520px) and (orientation: landscape) {
  main { min-height: 0; }
  .headline { font-size: min(8.4vw, 13vh); }
  .footer { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .doodle path { stroke-dashoffset: 0; opacity: 1; }
  .doodle path.fill { fill-opacity: 1; }
}
