/* ==========================================================
   LONGCAT :: the museum of the long cat
   photo-matched serene grey + museum placards + meme captions
   ========================================================== */

:root {
  --bg: #a09e9b;            /* sampled from the photograph */
  --bg-deep: #8f8d8a;
  --paper: #f4f1ec;
  --ink: #2b2825;
  --ink-soft: #575350;
  --robe: #8a5a32;          /* the monk's robe */
  --robe-deep: #6e4523;
  --cat-w: min(360px, 78vw);
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --impact: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.10), rgba(0,0,0,0) 60%),
    radial-gradient(140% 120% at 50% 100%, rgba(0,0,0,.12), rgba(0,0,0,0) 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  overflow-x: hidden;
}

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

/* ---------- grain ---------- */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 60;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 700ms steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 25% { transform: translate(-2%,1%); }
  50% { transform: translate(1%,-2%); } 75% { transform: translate(-1%,2%); } 100% { transform: translate(2%,1%); }
}

/* ---------- HUD ---------- */
.hud { position: fixed; z-index: 50; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }
.hud-tl { top: 18px; left: 20px; }
.hud-tr { top: 18px; right: 34px; }
.hud-bl { bottom: 16px; left: 20px; }
.hud-br { bottom: 16px; right: 34px; }

.hud-logo {
  font-family: var(--serif); font-size: 20px; letter-spacing: .02em;
  color: var(--ink);
  border-bottom: 2px solid var(--robe);
  padding-bottom: 2px;
}

.ca-pill {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  background: rgba(244,241,236,.82); color: var(--ink);
  border: 1px solid rgba(43,40,37,.35);
  padding: 7px 12px; cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .2s ease;
  max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ca-pill:hover { background: var(--paper); }

.counter {
  background: rgba(43,40,37,.82); color: var(--paper);
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
.counter #meters { color: #f0c98f; }

.hint { color: var(--ink-soft); transition: opacity .6s ease; }
.hint.gone { opacity: 0; }
.hint-arrow { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0);} 50% { transform: translateY(6px);} }

/* ---------- ruler ---------- */
.ruler {
  position: fixed; top: 0; right: 0; bottom: 0; width: 14px; z-index: 40;
  background:
    repeating-linear-gradient(to bottom, rgba(43,40,37,.5) 0 1px, transparent 1px 24px),
    rgba(244,241,236,.35);
  border-left: 1px solid rgba(43,40,37,.25);
}
.ruler-fill {
  position: absolute; top: 0; left: 0; right: 0; height: 0%;
  background: linear-gradient(to bottom, var(--robe-deep), var(--robe));
  opacity: .85;
}

/* ---------- hero ---------- */
.hero {
  min-height: 92vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 96px 24px 0;
}
.hero > * { opacity: 0; transform: translateY(14px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-eyebrow { animation-delay: .1s; }
.hero-title { animation-delay: .25s; }
.hero-sub { animation-delay: .45s; }
.hero-meta { animation-delay: .6s; }
.hero-cue { animation-delay: 1.1s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.hero-eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 18px;
}
.hero-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(64px, 16vw, 180px);
  line-height: .9; letter-spacing: -.01em;
  color: var(--ink);
}
.hero-title-thin { font-style: italic; color: var(--robe-deep); }
.hero-sub {
  margin-top: 22px; font-size: clamp(18px, 2.6vw, 26px); color: var(--ink);
  max-width: 30em;
}
.hero-meta {
  margin-top: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  color: var(--ink-soft); text-transform: uppercase;
}
.hero-cue {
  margin-top: 8vh; font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  color: var(--ink-soft);
}

/* ---------- the cat ---------- */
.cat-track {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.cat-head, .cat-feet {
  width: var(--cat-w); display: block;
}
.cat-body {
  position: relative;
  width: var(--cat-w);
  background-image: url("images/body.png");
  background-repeat: repeat-y;
  background-position: top center;
  /* background-size + height set by app.js to exact tile multiples */
}

/* ---------- milestones ---------- */
.mile {
  position: absolute; left: 50%;
  width: min(560px, 92vw);
  transform: translateX(-50%);
  text-align: center; z-index: 5;
  opacity: 0; transition: opacity .7s ease, translate .7s ease;
  translate: 0 18px;
}
.mile.seen { opacity: 1; translate: 0 0; }

.mile-meme {
  font-family: var(--impact);
  font-size: clamp(34px, 7vw, 64px);
  line-height: 1.02;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: #fff;
  -webkit-text-stroke: 2px #000;
  text-shadow: 3px 3px 0 rgba(0,0,0,.85);
}
.mile-meme .mile-small {
  display: block; margin-top: 10px;
  font-size: clamp(13px, 2vw, 17px);
  -webkit-text-stroke: 0; text-shadow: none;
  font-family: var(--mono); text-transform: none; color: var(--ink-soft);
}

.mile-serif {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(20px, 3.4vw, 30px);
  color: var(--ink);
}
.mile-serif .mile-depth {
  display: block; margin-top: 8px; font-style: normal;
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--ink-soft);
}

/* ---------- placards ---------- */
.placard {
  background: var(--paper);
  border: 1px solid rgba(43,40,37,.4);
  box-shadow: 0 2px 0 rgba(43,40,37,.4), 0 18px 40px rgba(0,0,0,.14);
  padding: 26px 28px 24px;
  text-align: left;
  width: min(380px, 88vw);
  margin: 0 auto;
}
.mile .placard { text-align: left; }
.placard-kicker {
  font-family: var(--mono); font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--robe-deep); margin-bottom: 12px;
  border-bottom: 1px solid rgba(43,40,37,.2); padding-bottom: 10px;
}
.placard h3 {
  font-family: var(--serif); font-weight: 400; font-size: 26px; margin-bottom: 10px; color: var(--ink);
}
.placard p { font-size: 15px; line-height: 1.55; color: var(--ink-soft); font-family: var(--serif); }
.placard p + p { margin-top: 8px; }
.placard .mono { font-family: var(--mono); font-size: 12px; word-break: break-all; color: var(--ink); }
.placard ol { margin: 6px 0 0 18px; font-size: 15px; color: var(--ink-soft); line-height: 1.7; }
.placard .placard-foot {
  margin-top: 14px; font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft);
}

/* desktop: placards step aside from the cat, clamped inside the viewport */
@media (min-width: 900px) {
  .mile[data-side="l"] .placard {
    transform: translateX(max(calc(-1 * (var(--cat-w) / 2) - 50% - 24px), calc(-50vw + 50% + 46px)));
  }
  .mile[data-side="r"] .placard {
    transform: translateX(min(calc((var(--cat-w) / 2) + 50% + 24px), calc(50vw - 50% - 46px)));
  }
}

/* ---------- end ---------- */
.end {
  padding: 10vh 24px 12vh;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.end-title {
  font-family: var(--impact); text-transform: uppercase;
  font-size: clamp(40px, 9vw, 96px);
  color: #fff; -webkit-text-stroke: 2px #000;
  text-shadow: 4px 4px 0 rgba(0,0,0,.85);
  line-height: 1;
}
.end-sub { margin-top: 16px; font-size: clamp(17px, 2.4vw, 24px); }

.end-cert { margin-top: 48px; text-align: center; width: min(420px, 92vw); }
.cert-stat {
  font-family: var(--serif); font-size: clamp(72px, 14vw, 120px); line-height: 1; color: var(--ink);
}
.cert-unit { font-size: .35em; font-style: italic; color: var(--robe-deep); margin-left: 6px; }
.cert-line { margin-top: 10px; font-size: 15px; color: var(--ink-soft); line-height: 1.6; }
.cert-ca {
  margin-top: 20px; padding: 12px;
  border: 1px dashed rgba(43,40,37,.4);
  font-family: var(--mono); font-size: 12px;
  display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.cert-ca-label { color: var(--robe-deep); }
.copy-btn {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); border: 0; padding: 5px 10px; cursor: pointer;
}
.socials { margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--paper); background: var(--robe);
  padding: 12px 22px; text-decoration: none;
  border: 1px solid var(--robe-deep);
  transition: transform .15s ease, background .2s ease;
}
.btn:hover { background: var(--robe-deep); transform: translateY(-2px); }
.cert-note { margin-top: 14px; font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }

.footer { margin-top: 10vh; font-family: var(--mono); font-size: 11px; color: var(--ink-soft); letter-spacing: .06em; }
.footer-fine { margin-top: 8px; max-width: 46em; line-height: 1.7; opacity: .75; }

/* small screens */
@media (max-width: 520px) {
  .hud-tr { right: 24px; }
  .hud-br { display: none; }
  .ruler { width: 8px; }
}
