/* ==========================================================================
   Tidewire Apps — apps.tidewiredigital.com
   Same type and structure as tidewiredigital.com, with an electric-blue accent
   so the app side reads as its own line of work.
   ========================================================================== */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --abyss: #050d1f;
  --abyss-2: #081428;
  --trench: #0b1a35;
  --trench-2: #0f2142;
  --shoal: #1b2e55;
  --shoal-2: #2a4373;
  --foam: #eaf1ff;
  --brine: #a0b1d0;
  --brine-dim: #7184a8;
  --blue: #4c8dff;
  --blue-hi: #7aabff;
  --blue-ink: #03122e;

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.3125rem;
  --t-xl: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --t-2xl: clamp(2rem, 1.4rem + 2.2vw, 2.75rem);
  --t-3xl: clamp(2.5rem, 1.6rem + 3.6vw, 4rem);
  --t-hero: clamp(2.75rem, 1.4rem + 5vw, 5.25rem);

  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --max: 1240px;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--abyss);
  color-scheme: dark;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--abyss);
  color: var(--foam);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
p,
ul,
ol,
dl,
dd {
  margin: 0;
}
p {
  text-wrap: pretty;
}
ul,
ol {
  padding: 0;
}
::selection {
  background: var(--blue);
  color: var(--blue-ink);
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--blue);
  color: var(--blue-ink);
  font-weight: 700;
  border-radius: var(--radius-s);
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
}
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(5, 13, 31, 0.84);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: rgba(76, 141, 255, 0.12);
}
.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand svg {
  width: 34px;
  height: 22px;
  flex: none;
}
.brand-sub {
  color: var(--blue-hi);
  font-weight: 500;
}
.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav a {
  position: relative;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--brine);
  font-size: var(--t-sm);
  font-weight: 500;
  transition: color 0.2s;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--foam);
}
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.15rem;
  width: 14px;
  height: 2px;
  margin-left: -7px;
  border-radius: 2px;
  background: var(--blue);
}
.nav .nav-out {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
  border: 1px solid var(--shoal-2);
}
.nav .nav-out svg {
  width: 14px;
  height: 14px;
}
.nav .nav-out:hover {
  border-color: var(--blue);
}
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--shoal);
  border-radius: 12px;
  background: transparent;
  color: var(--foam);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease), background-color 0.2s;
}
.nav-toggle span {
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle span::before {
  transform: translateY(-6px);
}
.nav-toggle span::after {
  transform: translateY(6px);
}
.is-open .nav-toggle span {
  background: transparent;
}
.is-open .nav-toggle span::before {
  transform: rotate(45deg);
}
.is-open .nav-toggle span::after {
  transform: rotate(-45deg);
}
@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    height: calc(100dvh - var(--header-h));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1.5rem var(--gutter) 2rem;
    background: var(--abyss);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.3s var(--ease), visibility 0s 0.3s;
  }
  .is-open .nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.25s var(--ease), transform 0.3s var(--ease);
  }
  .nav a {
    padding: 1rem 0;
    border-radius: 0;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--foam);
    border-bottom: 1px solid var(--shoal);
  }
  .nav a[aria-current="page"] {
    color: var(--blue-hi);
  }
  .nav a[aria-current="page"]::after {
    display: none;
  }
  .nav .nav-out {
    margin: 1.5rem 0 0;
    justify-content: center;
    font-size: var(--t-md);
    border-radius: 999px;
    border: 1px solid var(--shoal-2);
  }
}

/* ---------- buttons, pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--blue);
  color: var(--blue-ink);
  font: 700 var(--t-sm) / 1.2 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.3s var(--ease);
}
.btn:hover {
  background: var(--blue-hi);
  box-shadow: 0 8px 30px -10px rgba(76, 141, 255, 0.7);
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn-ghost {
  background: transparent;
  color: var(--foam);
  border-color: var(--shoal-2);
}
.btn-ghost:hover {
  background: rgba(76, 141, 255, 0.1);
  border-color: var(--blue);
  box-shadow: none;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(76, 141, 255, 0.4);
  background: rgba(76, 141, 255, 0.1);
  color: var(--blue-hi);
  font-size: var(--t-xs);
  font-weight: 700;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(76, 141, 255, 0.25);
}
.text-link {
  color: var(--blue-hi);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(122, 171, 255, 0.4);
  text-underline-offset: 3px;
}
.text-link:hover {
  text-decoration-color: currentColor;
}

/* ---------- sections ---------- */
.section {
  padding-block: clamp(4rem, 3rem + 5vw, 7.5rem);
}
.section-tight {
  padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem);
}
.section-head {
  max-width: 44rem;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.25rem);
}
.section-head h2 {
  font-size: var(--t-3xl);
}
.section-head p {
  margin-top: 1rem;
  color: var(--brine);
  font-size: var(--t-lg);
  line-height: 1.5;
}
.lede {
  color: var(--brine);
  font-size: var(--t-lg);
  line-height: 1.5;
}
.page-hero {
  padding-top: calc(var(--header-h) + clamp(2rem, 1rem + 3vw, 3.75rem));
  padding-bottom: clamp(2.5rem, 2rem + 3vw, 4rem);
  background: radial-gradient(60% 120% at 100% 0%, rgba(76, 141, 255, 0.14), transparent 60%);
}
.page-hero h1 {
  font-size: var(--t-3xl);
  max-width: 20ch;
}
.page-hero .lede {
  margin-top: 1.25rem;
  max-width: 40rem;
}

/* ---------- home: apps list ---------- */
.apps-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(2.5rem, 1rem + 5vw, 5rem));
  padding-bottom: clamp(3rem, 2rem + 4vw, 5rem);
  overflow: hidden;
  isolation: isolate;
}
.apps-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(55% 80% at 85% 10%, rgba(76, 141, 255, 0.2), transparent 65%);
}
.apps-hero h1 {
  font-size: var(--t-hero);
  letter-spacing: -0.035em;
  max-width: 14ch;
}
.apps-hero h1 span {
  color: var(--brine);
}
.apps-hero .lede {
  margin-top: 1.5rem;
  max-width: 38rem;
}
.app-list {
  list-style: none;
  display: grid;
  gap: 1rem;
}
.app-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem 2rem;
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  border-radius: var(--radius-l);
  border: 1px solid var(--shoal);
  background: linear-gradient(120deg, rgba(76, 141, 255, 0.09), transparent 45%), var(--abyss-2);
  transition: border-color 0.25s, transform 0.3s var(--ease);
}
.app-card:hover {
  border-color: var(--shoal-2);
}
.app-icon {
  width: 104px;
  height: 104px;
  border-radius: 23px;
  box-shadow: 0 18px 40px -16px rgba(37, 99, 235, 0.8);
}
.app-card h2 {
  font-size: var(--t-2xl);
}
.app-card .app-tag {
  margin-top: 0.35rem;
  color: var(--brine);
  font-size: var(--t-lg);
}
.app-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.9rem;
  color: var(--brine-dim);
  font-size: var(--t-sm);
}
.app-meta .dev {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.app-meta .dev svg {
  width: 16px;
  height: 16px;
}
.app-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.app-card.is-placeholder {
  grid-template-columns: auto minmax(0, 1fr);
  background: transparent;
  border-style: dashed;
}
.app-card.is-placeholder .app-icon-empty {
  width: 104px;
  height: 104px;
  border-radius: 23px;
  border: 1.5px dashed var(--shoal-2);
  display: grid;
  place-items: center;
  color: var(--brine-dim);
}
.app-card.is-placeholder .app-icon-empty svg {
  width: 32px;
  height: 32px;
}
.app-card.is-placeholder h2 {
  font-size: var(--t-xl);
  color: var(--brine);
}
@media (max-width: 760px) {
  .app-card {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .app-icon,
  .app-card.is-placeholder .app-icon-empty {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    align-self: start;
  }
  .app-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.about-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 1rem + 4vw, 5rem);
}
.about-band h2 {
  font-size: var(--t-xl);
}
.about-band p {
  margin-top: 0.75rem;
  color: var(--brine);
}
@media (max-width: 760px) {
  .about-band {
    grid-template-columns: 1fr;
  }
}

/* ---------- app page ---------- */
.app-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(2rem, 1rem + 3vw, 3.5rem));
  padding-bottom: clamp(2rem, 1rem + 3vw, 3.5rem);
  overflow: hidden;
  isolation: isolate;
}
.app-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(50% 70% at 78% 45%, rgba(76, 141, 255, 0.24), transparent 70%),
    radial-gradient(35% 50% at 10% 0%, rgba(37, 99, 235, 0.14), transparent 70%);
}
.app-hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 2rem clamp(2rem, 1rem + 4vw, 5rem);
}
.app-hero .app-icon {
  width: 120px;
  height: 120px;
  border-radius: 27px;
  margin-bottom: 1.75rem;
}
.app-hero h1 {
  font-size: var(--t-hero);
  letter-spacing: -0.04em;
}
.app-hero .tagline {
  margin-top: 1rem;
  font-size: var(--t-xl);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  max-width: 22ch;
}
.app-hero .lede {
  margin-top: 1rem;
  max-width: 32rem;
}
.app-hero .hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.75rem;
  color: var(--brine);
  font-size: var(--t-sm);
}
.hero-meta .plat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.hero-meta .plat svg {
  width: 17px;
  height: 17px;
  color: var(--blue-hi);
}
.app-hero .hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* fanned phones */
.phones {
  position: relative;
  height: clamp(420px, 34vw + 160px, 620px);
}
.phone {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(170px, 12vw + 90px, 260px);
  aspect-ratio: 390 / 844;
  border-radius: 13% / 6%;
  padding: 2.6%;
  background: linear-gradient(145deg, #2a3550, #0c1224);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 80px -30px rgba(0, 0, 0, 0.8),
    0 20px 60px -30px rgba(37, 99, 235, 0.6);
}
.phone img {
  width: 100%;
  height: 100%;
  border-radius: 11% / 5.2%;
  object-fit: cover;
}
.phone.p-center {
  transform: translate(-50%, -50%);
  z-index: 3;
}
.phone.p-left {
  transform: translate(-112%, -44%) rotate(-7deg) scale(0.86);
  z-index: 2;
  filter: brightness(0.8);
}
.phone.p-right {
  transform: translate(12%, -44%) rotate(7deg) scale(0.86);
  z-index: 2;
  filter: brightness(0.8);
}
.preview-note {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--brine-dim);
  font-size: var(--t-xs);
}
@media (max-width: 900px) {
  .app-hero .wrap {
    grid-template-columns: 1fr;
  }
  .phones {
    height: 520px;
    margin-top: 1rem;
  }
}
@media (max-width: 480px) {
  .phones {
    height: 440px;
  }
  .phone {
    width: 170px;
  }
  .phone.p-left {
    transform: translate(-98%, -44%) rotate(-7deg) scale(0.82);
  }
  .phone.p-right {
    transform: translate(-2%, -44%) rotate(7deg) scale(0.82);
  }
}

/* feature rows: screenshot + text, alternating */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 2rem clamp(2rem, 1rem + 5vw, 6rem);
  padding-block: clamp(3rem, 2rem + 3vw, 5rem);
  border-top: 1px solid var(--shoal);
}
.feature:first-child {
  border-top: 0;
}
.feature.flip .feature-shot {
  order: 2;
}
.feature-shot {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem) 1rem;
  border-radius: var(--radius-l);
  background: radial-gradient(70% 60% at 50% 40%, rgba(76, 141, 255, 0.18), transparent 70%), var(--abyss-2);
  border: 1px solid var(--shoal);
}
.feature-shot .phone {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: min(250px, 70%);
}
.feature h2 {
  font-size: var(--t-2xl);
}
.feature > div > p {
  margin-top: 1rem;
  color: var(--brine);
  font-size: var(--t-lg);
  line-height: 1.5;
  max-width: 34rem;
}
.points {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
  margin-top: 2rem;
}
.points li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.85rem;
}
.points .pi {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(76, 141, 255, 0.12);
  color: var(--blue-hi);
}
.points .pi svg {
  width: 19px;
  height: 19px;
}
.points strong {
  display: block;
  font-weight: 700;
}
.points span {
  display: block;
  margin-top: 0.15rem;
  color: var(--brine);
  font-size: var(--t-sm);
  line-height: 1.5;
}
@media (max-width: 900px) {
  .feature,
  .feature.flip {
    grid-template-columns: 1fr;
  }
  .feature.flip .feature-shot {
    order: 0;
  }
}
@media (max-width: 560px) {
  .points {
    grid-template-columns: 1fr;
  }
}

/* optional server panel */
.server {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 1.5rem + 3vw, 4rem);
  border-radius: var(--radius-l);
  border: 1px solid var(--shoal-2);
  background: repeating-linear-gradient(0deg, rgba(76, 141, 255, 0.05) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(76, 141, 255, 0.05) 0 1px, transparent 1px 28px),
    linear-gradient(160deg, var(--trench-2), var(--abyss-2) 70%);
}
.server-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  max-width: 48rem;
}
.server-head .si {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: var(--blue-ink);
}
.server-head .si svg {
  width: 28px;
  height: 28px;
}
.server h2 {
  font-size: var(--t-2xl);
}
.server-head p {
  margin-top: 0.75rem;
  color: var(--brine);
  font-size: var(--t-lg);
  line-height: 1.5;
}
.server .points {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2.5rem;
}
.server-note {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--shoal);
  color: var(--brine-dim);
  font-size: var(--t-xs);
  max-width: 52rem;
}
@media (max-width: 900px) {
  .server .points {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .server .points {
    grid-template-columns: 1fr;
  }
  .server-head {
    grid-template-columns: 1fr;
  }
}

/* details table */
.details {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--shoal);
  border-bottom: 1px solid var(--shoal);
}
.details > div {
  padding: 1.35rem 1.25rem 1.35rem 0;
}
.details > div + div {
  padding-left: 1.25rem;
  border-left: 1px solid var(--shoal);
}
.details dt {
  color: var(--brine-dim);
  font-size: var(--t-xs);
}
.details dd {
  margin-top: 0.3rem;
  font-weight: 600;
}
@media (max-width: 900px) {
  .details {
    grid-template-columns: 1fr 1fr;
  }
  .details > div {
    padding: 1.1rem 0 !important;
    border-left: 0 !important;
    border-bottom: 1px solid var(--shoal);
  }
  .details > div:nth-child(even) {
    padding-left: 1.25rem !important;
    border-left: 1px solid var(--shoal) !important;
  }
}
.link-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.link-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-m);
  border: 1px solid var(--shoal);
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}
.link-card:hover {
  border-color: var(--blue);
  background: rgba(76, 141, 255, 0.06);
}
.link-card .li {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(76, 141, 255, 0.12);
  color: var(--blue-hi);
}
.link-card .li svg,
.link-card > svg {
  width: 20px;
  height: 20px;
}
.link-card > svg {
  color: var(--brine-dim);
}
.link-card strong {
  display: block;
}
.link-card small {
  color: var(--brine);
  font-size: var(--t-sm);
}
@media (max-width: 640px) {
  .link-cards {
    grid-template-columns: 1fr;
  }
}

/* ---------- legal / support ---------- */
.doc {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
.doc-toc {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: grid;
  gap: 0.15rem;
  font-size: var(--t-sm);
}
.doc-toc a {
  padding: 0.35rem 0;
  color: var(--brine);
  text-decoration: none;
}
.doc-toc a:hover {
  color: var(--foam);
}
.prose {
  max-width: 44rem;
}
.prose .summary {
  padding: 1.25rem 1.4rem;
  margin-bottom: 2.5rem;
  border-radius: var(--radius-m);
  border: 1px solid rgba(76, 141, 255, 0.35);
  background: rgba(76, 141, 255, 0.08);
  font-size: var(--t-lg);
  line-height: 1.5;
}
.prose h2 {
  font-size: var(--t-xl);
  margin: 2.5rem 0 0.75rem;
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
.prose h2:first-of-type {
  margin-top: 0;
}
.prose p,
.prose li {
  color: #c3d0e8;
}
.prose p + p {
  margin-top: 0.9rem;
}
.prose ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.45rem;
}
.prose a {
  color: var(--blue-hi);
}
.prose .updated {
  color: var(--brine-dim);
  font-size: var(--t-sm);
  margin-bottom: 1.5rem;
}
@media (max-width: 860px) {
  .doc {
    grid-template-columns: 1fr;
  }
  .doc-toc {
    display: none;
  }
}

.support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 3rem;
  align-items: start;
}
.contact-card {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  padding: 1.75rem;
  border-radius: var(--radius-l);
  border: 1px solid var(--shoal-2);
  background: linear-gradient(160deg, var(--trench-2), var(--abyss-2));
}
.contact-card h2 {
  font-size: var(--t-xl);
}
.contact-card p {
  margin-top: 0.75rem;
  color: var(--brine);
  font-size: var(--t-sm);
}
.contact-card .btn {
  margin-top: 1.25rem;
  width: 100%;
  justify-content: center;
}
.contact-card .addr {
  margin-top: 0.85rem;
  text-align: center;
  font-size: var(--t-sm);
  color: var(--brine);
  word-break: break-all;
}
.faq {
  border-top: 1px solid var(--shoal);
}
.faq h2 {
  font-size: var(--t-2xl);
  margin-bottom: 1rem;
}
.faq details {
  border-bottom: 1px solid var(--shoal);
}
.faq summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.3rem 0;
  cursor: pointer;
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  background: linear-gradient(var(--blue), var(--blue)) center / 14px 2px no-repeat,
    linear-gradient(var(--blue), var(--blue)) center / 2px 14px no-repeat;
  transition: transform 0.3s var(--ease);
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq .faq-body {
  padding: 0 0 1.4rem;
  color: var(--brine);
  max-width: 42rem;
}
.faq .faq-body p + p {
  margin-top: 0.75rem;
}
@media (max-width: 860px) {
  .support-grid {
    grid-template-columns: 1fr;
  }
  .contact-card {
    position: static;
  }
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: clamp(3rem, 2rem + 4vw, 6rem);
  border-top: 1px solid var(--shoal);
  padding-block: clamp(2.5rem, 2rem + 3vw, 4rem) 2rem;
  color: var(--brine);
  font-size: var(--t-sm);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.7fr));
  gap: 2.5rem;
}
.footer-grid .brand {
  color: var(--foam);
  margin-bottom: 1rem;
}
.footer-grid p {
  max-width: 30rem;
}
.footer-grid p a {
  color: var(--foam);
}
.footer-grid h2 {
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--foam);
  margin-bottom: 1rem;
}
.footer-grid ul {
  list-style: none;
  display: grid;
  gap: 0.6rem;
}
.footer-grid ul a {
  text-decoration: none;
}
.footer-grid ul a:hover {
  color: var(--blue-hi);
}
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--shoal);
  color: var(--brine-dim);
  font-size: var(--t-xs);
}
@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

/* 404 */
.lost {
  min-height: 70vh;
  display: grid;
  align-items: center;
  padding-top: var(--header-h);
}
.lost h1 {
  font-size: var(--t-hero);
}
.lost p {
  margin-top: 1rem;
}
.lost .btn {
  margin-top: 2rem;
}

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