/* ============================================================
   SnowEdge — reusable components
   nav · buttons · cards · readouts · form · media slots
   ============================================================ */

/* ─────────── NAV ─────────── */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  width: 100%;
}

/* The brand is the app's own lockup: the snow-spray logomark and the
   letterspaced SNOWEDGE wordmark, both white-on-transparent, so they sit on the
   dark shell without a plate behind them. */
.brand { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.brand__mark { height: 26px; width: auto; }
.brand__wordmark { width: 126px; height: auto; }
.brand__cn {
  font-size: .8rem;
  color: var(--dim);
  letter-spacing: .12em;
  align-self: center;
}

.nav__links {
  display: none;
  gap: clamp(1rem, .4rem + 1.4vw, 2rem);
  margin-inline: auto;
  font-size: var(--t-small);
  color: var(--mist);
}
.nav__links a { transition: color .2s var(--ease); position: relative; }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -6px;
  height: 1.5px;
  background: var(--ice);
  transition: right .3s var(--ease);
}
.nav__links a:hover { color: var(--snow); }
.nav__links a:hover::after { right: 0; }
@media (min-width: 1040px) { .nav__links { display: flex; } }

.nav__actions { display: flex; align-items: center; gap: var(--s-3); margin-left: auto; }
@media (min-width: 1040px) { .nav__actions { margin-left: 0; } }

/* On a narrow phone the brand, language toggle, demo pill and hamburger do not
   fit, and the overflow pushes the hamburger off-screen — which would strand
   the menu entirely. The demo pill is already the last item of that menu, so
   it is the one to drop. */
@media (max-width: 479px) {
  .nav__actions > .btn { display: none; }
  .nav .brand__wordmark { width: 108px; }
  .nav .brand__mark { height: 22px; }
}

.lang {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.lang__btn {
  font-size: .74rem;
  font-weight: 560;
  letter-spacing: .04em;
  padding: .28rem .62rem;
  border-radius: 999px;
  color: var(--dim);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.lang__btn:hover { color: var(--snow); }
.lang__btn.is-active { background: var(--snow); color: var(--void); }

.nav__toggle {
  display: grid;
  gap: 5px;
  padding: .55rem .3rem;
}
.nav__toggle span {
  display: block;
  width: 20px; height: 1.6px;
  background: var(--snow);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(3.3px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child  { transform: translateY(-3.3px) rotate(-45deg); }
@media (min-width: 1040px) { .nav__toggle { display: none; } }

.nav__mobile {
  position: fixed;
  inset: var(--nav-h) 0 auto;
  background: color-mix(in srgb, var(--ink) 97%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  padding: var(--s-5) var(--gutter) var(--s-6);
  display: grid;
  gap: var(--s-2);
  z-index: 99;
}
.nav__mobile[hidden] { display: none; }
.nav__mobile a { padding: .7rem 0; color: var(--mist); border-bottom: 1px solid var(--line); }
.nav__mobile a:last-of-type { border: 0; }
.nav__mobile .btn { margin-top: var(--s-3); justify-content: center; }

/* ─────────── BUTTONS ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 580;
  font-size: var(--t-small);
  letter-spacing: -.005em;
  padding: .72rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .18s var(--ease), background .22s var(--ease),
              border-color .22s var(--ease), color .22s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--sm { padding: .5rem 1rem; font-size: .82rem; }
.btn--lg { padding: .95rem 1.85rem; font-size: 1rem; }

.btn--primary { background: var(--snow); color: var(--void); }
.btn--primary:hover { background: #fff; }

.btn--ghost { border-color: var(--line-strong); color: var(--snow); }
.btn--ghost:hover { border-color: var(--snow); background: rgba(255, 255, 255, .05); }

/* ─────────── BITS ─────────── */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot--flare { background: var(--flare); box-shadow: 0 0 0 4px var(--flare-soft); }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ice);
  background: var(--ice-soft);
  border: 1px solid rgba(79, 200, 245, .22);
  padding: .28rem .62rem;
  border-radius: 999px;
  margin-bottom: var(--s-4);
}

.pullquote {
  font-size: var(--t-lede);
  color: var(--snow);
  max-width: 46ch;
  margin-top: clamp(3rem, 2rem + 3vw, 5rem);
  padding-left: var(--s-5);
  border-left: 2px solid var(--ice);
  font-weight: 500;
}

/* ─────────── CARDS ─────────── */
.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.4rem, 1rem + 1.2vw, 2.1rem);
  box-shadow: var(--shadow-card);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.section--alt .card { background: var(--surface-3); }
.card:hover { border-color: var(--line-strong); }
.card h3 { margin-bottom: var(--s-3); }
.card p { color: var(--mist); font-size: var(--t-small); line-height: 1.68; }

.card__idx {
  display: block;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ice);
  letter-spacing: .14em;
  margin-bottom: var(--s-4);
}

/* ─────────── READOUTS ─────────── */
.readouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  margin: 0;
}
.readouts--stack { grid-template-columns: 1fr; gap: var(--s-2); }

.readout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: .8rem .95rem;
}
.readout dt {
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: .3rem;
}
.readout dd { margin: 0; display: flex; align-items: baseline; gap: .12rem; }
.readout__num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--snow);
  line-height: 1;
}
.readout__unit { font-family: var(--font-mono); font-size: .9rem; color: var(--dim); }
.readout__state { font-size: .95rem; font-weight: 560; color: var(--snow); }
.readout--ice   .readout__num { color: var(--ice); }
.readout--flare .readout__num { color: var(--flare); }

/* ─────────── FORM ─────────── */
.form { display: grid; gap: var(--s-4); }
.form__row { display: grid; gap: var(--s-4); }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: .45rem; }
.field__label {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}
.field input, .field select, .field textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: .8rem 1rem;
  color: var(--snow);
  font-size: var(--t-small);
  transition: border-color .2s var(--ease), background .2s var(--ease);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 110px; font-family: inherit; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ice);
  background: var(--surface-2);
  outline: none;
}
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236E7F97' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 11px;
  padding-right: 2.4rem;
}
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--flare); }

.form__foot { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; margin-top: var(--s-2); }
.form__status { font-size: var(--t-small); color: var(--mist); }
.form__status.is-ok { color: var(--positive); }
.form__status.is-err { color: var(--flare); }
.form__legal { font-size: var(--t-micro); color: var(--dim); }

/* ─────────── MEDIA SLOTS (placeholders for art to come) ─────────── */
.media-slot { margin: var(--s-7) 0 0; }
.media-slot__frame {
  display: grid;
  place-content: center;
  gap: .4rem;
  text-align: center;
  aspect-ratio: 16 / 9;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background:
    repeating-linear-gradient(135deg,
      rgba(255, 255, 255, .014) 0 10px,
      transparent 10px 20px);
  color: var(--dim);
}
.media-slot__label { font-size: var(--t-small); color: var(--mist); }
.media-slot__hint { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; }

/* ─────────── FIGURES ─────────── */
.figure { margin: 0; }
.figure img {
  width: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
}
.figure--wide { margin-bottom: clamp(3rem, 2rem + 3vw, 5rem); }
.figure figcaption {
  margin-top: var(--s-4);
  font-size: var(--t-small);
  color: var(--dim);
  line-height: 1.6;
}
