/* Cabin Connect public site. Tokens mirror docs/previews/cc133/mockups/MOCKUP_CONTRACT.md
   ("Cabin Lit"): one key light top-left, litShade for every shadow, Nunito only, one radius
   family (28 / 20 / 14 / pill). No JavaScript, no third-party assets. */

@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito-wght.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ink: #2b2d42;
  --ink-muted: #646785;
  --ink-soft: rgba(43, 45, 66, .72);
  --white: #ffffff;
  --primary: #ff9f1c;
  --primary-deep: #d97e06;
  --primary-light: #ffb53f;
  --accent: #22b8cf;

  --page: #f6f3ee;
  --page-ink: var(--ink);
  --plate: var(--white);
  --field-a: #8fd0ff;
  --field-b: #eef8ff;
  --phone-shell: #1b1830;
  --spot: rgba(255, 255, 255, .34);
  --edge: rgba(26, 14, 46, .12);

  --r-xl: 28px;
  --r-md: 14px;
  --pill: 999px;

  --sh-plate: 0 8px 20px rgba(26, 14, 46, .14);
  --sh-chip: 0 2px 6px rgba(26, 14, 46, .12);
  --sh-cta: 0 10px 24px rgba(217, 126, 6, .38), inset 0 -5px 0 rgba(26, 14, 46, .16), inset 0 2px 0 rgba(255, 255, 255, .45);
  --sh-phone: 0 30px 60px -20px rgba(26, 14, 46, .45), 0 12px 24px -10px rgba(26, 14, 46, .3);

  --gutter: 16px;
  --max: 1280px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #141026;
    --page-ink: #f3f0ff;
    --ink: #f3f0ff;
    --ink-muted: #b9b4d0;
    --ink-soft: rgba(243, 240, 255, .6);
    --plate: #221b3a;
    --field-a: #2b4f86;
    --field-b: #1a1c3d;
    --spot: rgba(255, 255, 255, .12);
    --edge: rgba(0, 0, 0, .28);
    --sh-plate: 0 8px 20px rgba(0, 0, 0, .35);
    --sh-chip: 0 2px 6px rgba(0, 0, 0, .3);
    --sh-phone: 0 30px 60px -20px rgba(0, 0, 0, .7), 0 12px 24px -10px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --page: #141026;
  --page-ink: #f3f0ff;
  --ink: #f3f0ff;
  --ink-muted: #b9b4d0;
  --ink-soft: rgba(243, 240, 255, .6);
  --plate: #221b3a;
  --field-a: #2b4f86;
  --field-b: #1a1c3d;
  --spot: rgba(255, 255, 255, .12);
  --edge: rgba(0, 0, 0, .28);
  --sh-plate: 0 8px 20px rgba(0, 0, 0, .35);
  --sh-chip: 0 2px 6px rgba(0, 0, 0, .3);
  --sh-phone: 0 30px 60px -20px rgba(0, 0, 0, .7), 0 12px 24px -10px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--page);
  color: var(--page-ink);
  font-family: "Nunito", ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .18em; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: var(--r-md); }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.3em; }
li + li { margin-top: .35em; }

/* ---------- brand ---------- */
.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  font-weight: 900; font-size: 1.05rem; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; color: var(--page-ink); white-space: nowrap;
}
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: var(--sh-chip); }

/* ---------- pill (the one orange CTA) ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 54px; padding: .75rem 1.5rem; border-radius: var(--pill);
  font-weight: 900; font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
  background: linear-gradient(180deg, var(--primary-light), var(--primary) 55%, var(--primary-deep));
  color: #2b2d42; box-shadow: var(--sh-cta); white-space: nowrap;
}
.pill svg { width: 20px; height: 20px; flex: none; }

/* ---------- home: one screen ---------- */
.home {
  display: grid; grid-template-rows: auto 1fr auto;
  min-height: 100vh; min-height: 100svh;
  background:
    radial-gradient(90% 70% at 68% 42%, var(--spot), transparent 60%),
    radial-gradient(120% 100% at 50% 100%, transparent 60%, var(--edge)),
    linear-gradient(180deg, var(--field-a), var(--field-b));
}
@supports (height: 100dvh) { .home { min-height: 100dvh; } }

.home > header, .home > footer, .home > main { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.home > header { padding: max(1.1rem, env(safe-area-inset-top)) 0 0; display: flex; justify-content: center; }

.hero {
  display: grid; grid-template-rows: auto 1fr; justify-items: center; align-items: center;
  gap: clamp(.6rem, 2vh, 1.6rem); padding: clamp(.6rem, 2.5vh, 2.2rem) 0 .6rem; min-height: 0;
}
.hero-copy { display: grid; gap: clamp(.9rem, 2.4vh, 1.6rem); justify-items: center; text-align: center; }
.hero h1 {
  font-weight: 900; line-height: 1.02; letter-spacing: -.02em;
  font-size: clamp(2.25rem, 1.4rem + 4.6vw, 4.6rem);
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 6px 14px rgba(26, 14, 46, .12);
  text-wrap: balance;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero h1 { color: #fff; text-shadow: 0 2px 0 rgba(26, 14, 46, .22), 0 6px 14px rgba(26, 14, 46, .18); }
}
:root[data-theme="dark"] .hero h1 { color: #fff; text-shadow: 0 2px 0 rgba(26, 14, 46, .22), 0 6px 14px rgba(26, 14, 46, .18); }

/* Phone trio. --w is the centre phone width; it is sized so the whole trio fits the viewport
   on both axes. The group box is 2.3w wide and ~2.35w tall (812/375 + lift). */
.phones {
  --w: min(44vw, 27vh, 300px);
  position: relative; width: calc(var(--w) * 2.3); height: calc(var(--w) * 2.35);
  list-style: none; padding: 0; margin: 0; align-self: center;
}
.phone {
  --pw: var(--w);
  position: absolute; left: 50%; top: 0; width: var(--pw); aspect-ratio: 375 / 812;
  margin-left: calc(var(--pw) / -2);
  border-radius: calc(var(--pw) * .16); background: var(--phone-shell); padding: calc(var(--pw) * .035);
  box-shadow: var(--sh-phone), inset 0 0 0 2px rgba(255, 255, 255, .18);
  transform-origin: bottom center;
}
.phone::before {
  content: ""; position: absolute; left: 50%; top: calc(var(--pw) * .045); width: 32%; height: calc(var(--pw) * .055);
  transform: translateX(-50%); background: var(--phone-shell); border-radius: var(--pill); z-index: 2;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--pw) * .125); background: #cfe9ff; }
.phone-main { z-index: 2; animation: float 7s ease-in-out infinite; }
.phone-side { --pw: calc(var(--w) * .84); top: calc(var(--w) * .22); z-index: 1; }
.phone-left { transform: translateX(-72%) rotate(-8deg); animation: float-l 8s ease-in-out infinite; }
.phone-right { transform: translateX(72%) rotate(8deg); animation: float-r 9s ease-in-out infinite; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes float-l { 0%, 100% { transform: translateX(-72%) rotate(-8deg) translateY(0); } 50% { transform: translateX(-72%) rotate(-8deg) translateY(-8px); } }
@keyframes float-r { 0%, 100% { transform: translateX(72%) rotate(8deg) translateY(0); } 50% { transform: translateX(72%) rotate(8deg) translateY(-8px); } }

.hero-copy, .phones { animation-name: rise; animation-duration: .7s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); animation-fill-mode: both; }
.phones { animation-delay: .12s; }
.phone-main, .phone-left, .phone-right { animation-delay: .9s; }
@keyframes rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }

@media (min-width: 900px) {
  .home > header { justify-content: flex-start; }
  .hero {
    grid-template-rows: 1fr; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem;
    padding: 0 0 .5rem;
  }
  .hero-copy { justify-items: start; text-align: left; }
  .hero h1 { max-width: 11ch; }
  .phones { --w: min(21vw, 32vh, 300px); justify-self: end; }
}

/* ---------- footer: one line ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem .55rem;
  padding: .7rem 0 max(1rem, env(safe-area-inset-bottom));
  font-size: .82rem; font-weight: 800; color: var(--ink-soft);
}
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
@media (min-width: 900px) { .home > .foot { justify-content: flex-start; } }

/* ---------- text pages (privacy, support, 404) ---------- */
.page { width: min(100% - 2 * var(--gutter), 46rem); margin-inline: auto; padding: 1.1rem 0 2rem; }
.page > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.page nav { display: flex; gap: .4rem; }
.page nav a {
  text-decoration: none; font-weight: 800; font-size: .92rem;
  padding: .45rem .9rem; border-radius: var(--pill); background: var(--plate); box-shadow: var(--sh-chip);
}
.page nav a[aria-current="page"] { background: var(--ink); color: var(--page); }
@media (max-width: 479px) { .page .brand span { display: none; } }

.prose {
  display: grid; gap: .9rem;
  background: var(--plate); border-radius: var(--r-xl); box-shadow: var(--sh-plate);
  padding: clamp(1.3rem, 1rem + 1.5vw, 2.4rem);
}
.prose h1 { font-weight: 900; font-size: clamp(1.8rem, 1.5rem + 1.6vw, 2.6rem); line-height: 1.08; letter-spacing: -.01em; }
.prose h2 { font-weight: 900; font-size: 1.35rem; margin-top: .9rem; line-height: 1.15; }
.prose h3 { font-weight: 900; font-size: 1.08rem; margin-top: .3rem; }
.prose p, .prose li { color: var(--ink-muted); }
.prose .lead { color: var(--page-ink); font-weight: 800; font-size: 1.15rem; }
.prose .meta { font-size: .9rem; }
.prose .eyebrow { font-weight: 900; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.prose .pill { justify-self: start; margin-top: .4rem; }
.page .foot { justify-content: flex-start; padding-top: 1.4rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-copy, .phones { opacity: 1; translate: 0 0; }
}
