/* Layout + usage chrome for coinupbtc.com.
   Phone-first (390×844), sticky wayfinding, lab card. Visual identity stays in style.css. */

html {
  scroll-padding-top: 4.75rem;
}

/* Hero no longer has an in-flow top bar — nav is sticky above it. */
.hero {
  grid-template-rows: 1fr auto;
}

body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ── Sticky site nav (the missing "how do I use this page") ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  min-height: 52px;
  padding:
    max(0.55rem, env(safe-area-inset-top, 0px))
    max(0.75rem, env(safe-area-inset-right, 0px))
    0.55rem
    max(0.9rem, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.site-nav nav::-webkit-scrollbar { display: none; }

.eyebrow {
  color: color-mix(in srgb, var(--ink) 70%, var(--mute));
}
.site-nav nav a {
  flex: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: color-mix(in srgb, var(--ink) 82%, var(--mute));
  border-bottom: 2px solid transparent;
  position: relative;
}
/* Pass 3 D-Finish D3 · nav underline sweep — acid line grows in from the
   left on hover/focus, stays for the active section. Off for touch / reduced-motion. */
.site-nav nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--acid);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.site-nav nav a:hover::after,
.site-nav nav a:focus-visible::after,
.site-nav nav a[aria-current="true"]::after {
  transform: scaleX(1);
}
@media (prefers-reduced-motion: reduce), (hover: none) {
  .site-nav nav a::after { display: none; }
}
.site-nav nav a:hover,
.site-nav nav a[aria-current="true"] {
  color: var(--ink);
}

.nav-clock {
  display: none;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (min-width: 720px) {
  .nav-clock { display: inline-flex; align-items: center; gap: 0.45em; }
}

/* Theme toggle lives in the nav row, not floating over the hero */
.site-nav .theme-toggle {
  position: static;
  width: 44px;
  height: 44px;
  flex: none;
  margin: 0;
}

.use-line {
  margin-top: 1.1rem;
  max-width: 42ch;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--mute);
  opacity: 1;
}

/* First paint must show the verbs — don't hide CTAs behind entrance motion */
.lede,
.ctas,
.use-line {
  opacity: 1;
  animation: none;
}
.lede {
  color: color-mix(in srgb, var(--ink) 82%, var(--mute));
}

/* The one thing to do on this page must read as a button on the video */
.hero .ctas a.primary {
  background: var(--acid);
  color: #12141a;
  border: none;
}
.hero .ctas a.primary:hover {
  background: #d9ff63;
  color: #12141a;
}

/* Lab card: CSS motif instead of a fake project still */
.card-lab .lab-field {
  background:
    radial-gradient(120% 90% at 80% 10%, var(--glow), transparent 55%),
    repeating-radial-gradient(circle at 78% 18%, var(--ink) 0 1px, transparent 1px 11px),
    var(--well);
  min-height: 0;
}
.card-lab .lab-field::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(circle at 78% 18%, var(--ink) 0 1px, transparent 1px 11.6px);
  opacity: 0.45;
  pointer-events: none;
}

/* Captions must be readable without a mouse */
@media (hover: none) {
  .art-cap {
    opacity: 1;
    transform: none;
  }
  .art-btn:hover img,
  .card:hover .card-img,
  .plate:hover img {
    transform: none;
  }
}

/* Lightbox + back-to-top: thumbs and the home indicator */
.to-top {
  width: 44px;
  height: 44px;
  right: max(0.9rem, env(safe-area-inset-right, 0px));
  bottom: max(0.9rem, env(safe-area-inset-bottom, 0px));
}
.lb-close {
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  right: max(0.75rem, env(safe-area-inset-right, 0px));
}
.lb-z {
  width: 44px;
  height: 44px;
}

/* Phone: don't trap the CTAs in a 100vh hero under the plate */
@media (max-width: 480px) {
  .hero {
    min-height: 0;
    padding-bottom: 1.25rem;
  }
  .brand {
    font-size: clamp(2.4rem, 16vw, 3.4rem);
  }
  .lede { max-width: none; }
  .ctas a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .ctas a.primary { padding: 0.75rem 1.1rem; }
  .site-nav nav a { padding: 0 0.55rem; letter-spacing: 0.08em; }
  .hub-list li { grid-template-columns: 1fr; }
  .hub-list span { text-align: left; }
}

@media (max-width: 920px) {
  .hero { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .use-line { opacity: 1; animation: none; }
}
