/* Living Squeek — dark, single theme, one accent (amber, taken from the LED
   harness palette so the page and the art share a light source).
   Dial read: VARIANCE 7, MOTION 5, DENSITY 3. Product page, not a landing.
*/

:root {
  --ink:        #e8e4da;
  --ink-dim:    #9a968d;
  --ink-faint:  #6b6862;
  --bg:         #0a0a0c;
  --bg-raise:   #101013;
  --bg-sink:    #06060a;
  --line:       #1e1e22;
  --line-soft:  #17171a;
  --amber:      #e9a23d;
  --amber-hi:   #ffd08c;
  --amber-dim:  rgba(233, 162, 61, 0.16);
  --danger:     #c4553f;

  --r: 10px;
  --r-sm: 6px;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --gut: clamp(20px, 5vw, 72px);
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* subtle grain, fixed and non-interactive */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
  padding: 0 var(--gut);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(12px);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.mark svg { width: 22px; height: 22px; color: var(--amber); }

.masthead nav { display: flex; gap: 22px; }
.masthead nav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.18s ease;
}
.masthead nav a:hover { color: var(--ink); }

@media (max-width: 640px) {
  .masthead nav { gap: 14px; }
  .masthead nav a { font-size: 13px; }
  .mark span { display: none; }
}

/* ---------------------------------------------------------------- layout */

main { display: block; }
section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 104px) var(--gut);
}
section + section { border-top: 1px solid var(--line-soft); }

h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(2.35rem, 4.6vw, 3.5rem); font-weight: 620; text-wrap: balance; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }

.section-lede {
  margin: 14px 0 0;
  max-width: 62ch;
  color: var(--ink-dim);
}

/* ---------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-top: clamp(44px, 6vw, 76px);
}
.hero-live { padding-top: 6px; }

.lede {
  margin: 20px 0 0;
  max-width: 46ch;
  color: var(--ink-dim);
  font-size: 1.02rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
}
.hero-hint .mono { color: var(--ink-dim); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--amber);
  color: #170f02;
  border-color: var(--amber);
}
.btn-primary:hover { background: var(--amber-hi); border-color: var(--amber-hi); }

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: #33333a;
}
.btn-quiet:hover { border-color: #4a4a52; background: var(--bg-raise); }

.btn-sm { padding: 7px 14px; font-size: 13px; }

:where(.btn, a, input, button):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- live art */

.hero-live { min-width: 0; }

.live-frame {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    radial-gradient(circle at 50% 42%, rgba(233, 162, 61, 0.07), transparent 62%),
    var(--bg-sink);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.live-frame img {
  width: 112%;
  height: 112%;
  object-fit: contain;
  display: block;
  transition: opacity 0.28s ease;
}
.live-frame img.swapping { opacity: 0; }

.live-skeleton {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px solid var(--line);
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.25; transform: scale(0.97); }
  50%      { opacity: 0.6;  transform: scale(1.02); }
}

.live-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--line);
}
.live-facts > div { background: var(--bg); padding: 10px 12px; min-width: 0; }
.live-facts dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.live-facts dd {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-live { order: -1; max-width: 420px; width: 100%; }
}

/* ---------------------------------------------------------------- round strip */

.round-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.round-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-raise);
  overflow: hidden;
}
.round-card figure { margin: 0; display: grid; place-items: center; aspect-ratio: 1; background: var(--bg-sink); }
.round-card img { width: 100%; height: 100%; object-fit: contain; display: block; }
.round-card figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 13px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}
.round-card .rc-name { color: var(--ink-dim); }
.round-card .rc-seed { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

.skeleton {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(100deg, var(--bg-sink) 30%, #101014 50%, var(--bg-sink) 70%);
  background-size: 200% 100%;
  animation: sweep 1.4s linear infinite;
}
@keyframes sweep { to { background-position: -200% 0; } }

@media (max-width: 760px) {
  .round-strip { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- proof rows */

.proof {
  margin-top: 28px;
  border-top: 1px solid var(--line-soft);
}
.proof-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.proof-k { color: var(--ink-faint); font-size: 13px; }
.proof-v { color: var(--ink); overflow-wrap: anywhere; font-size: 12.5px; text-decoration: none; }
a.proof-v:hover { color: var(--amber); }

@media (max-width: 560px) {
  .proof-row { grid-template-columns: 1fr; gap: 3px; }
}

/* ---------------------------------------------------------------- gallery */

.scrubber {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 30px 0 26px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-raise);
}
.scrubber label { font-size: 13px; color: var(--ink-dim); }
.scrubber input[type="range"] {
  flex: 1 1 200px;
  min-width: 140px;
  accent-color: var(--amber);
}
.scrubber output { font-family: var(--mono); font-size: 13px; color: var(--amber); min-width: 64px; }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-raise);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: #2a2a30; transform: translateY(-2px); }

.card-art { position: relative; aspect-ratio: 1; background: var(--bg-sink); }
.card-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-art .skeleton { position: absolute; inset: 0; }

.card-body {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.card-id { font-size: 13px; font-weight: 550; }
.card-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

.card-err {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  color: var(--danger);
  font-size: 12.5px;
}

@media (max-width: 980px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 400px) { .grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- contract */

.mech {
  list-style: none;
  counter-reset: m;
  margin: 30px 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}
.mech li {
  counter-increment: m;
  background: var(--bg);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.mech li::before {
  content: counter(m);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  padding-top: 3px;
}
.mech h3 { margin: 0 0 5px; }
.mech p { margin: 0; color: var(--ink-dim); font-size: 14.5px; max-width: 68ch; }
.mech code { color: var(--ink); background: var(--bg-raise); padding: 1px 5px; border-radius: 4px; }

.addr-block {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.addr-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.addr-row:last-child { border-bottom: none; }
.addr-row span { color: var(--ink-faint); font-size: 13px; }
.addr-row code { overflow-wrap: anywhere; font-size: 12.5px; }

@media (max-width: 560px) {
  .addr-row { grid-template-columns: 1fr; gap: 3px; }
}

/* ---------------------------------------------------------------- footer */

.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 34px var(--gut) 56px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-faint);
  font-size: 13px;
}
.foot p { margin: 0; }
.foot-meta { margin-top: 5px !important; color: #4d4a45; }
.foot.is-error #foot-status { color: var(--danger); }
