/* Rewire — landing site. Tokens mirror Frontend/constants/theme.ts */

@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/Satoshi-Light.otf") format("opentype");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/Satoshi-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/Satoshi-Medium.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("assets/fonts/Satoshi-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #131313;
  --bg-lowest: #0e0e0e;
  --container-low: #1c1b1b;
  --container: #201f1f;
  --container-high: #2a2a2a;
  --bright: #393939;
  --ink: #e5e2e1;
  --ink-variant: #d0c5af;
  --outline: #99907c;
  --outline-faint: #4d4635;
  --gold: #fcc56f;
  --gold-deep: #ddaa57;
  --gold-muted: #c9b780;
  --max: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-muted);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(19, 19, 19, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(153, 144, 124, 0.12);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand-mark { height: 26px; width: auto; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-variant);
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--ink); }
.nav a.nav-cta {
  color: var(--bg);
  background: var(--gold);
  padding: 9px 18px;
  font-weight: 700;
}
.nav a.nav-cta:hover { background: var(--gold-deep); color: var(--bg); }
@media (max-width: 640px) { .nav .nav-link { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 56px;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: -2px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
/* Warm glow that breathes — inhale/exhale rhythm, like the app */
.hero-glow {
  position: absolute;
  top: -240px;
  left: 50%;
  width: 1040px;
  height: 820px;
  margin-left: -520px;
  background: radial-gradient(closest-side,
    rgba(252, 197, 111, 0.22),
    rgba(252, 197, 111, 0.06) 52%,
    transparent 72%);
  filter: blur(10px);
  transform-origin: center 58%;
  animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe {
  0%   { transform: scale(0.9);  opacity: 0.6; }
  42%  { transform: scale(1.14); opacity: 1; }
  100% { transform: scale(0.9);  opacity: 0.6; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-glow { animation: none; }
}
.hero .wrap { position: relative; z-index: 1; }
/* Small brand swoosh — a delicate flourish above the headline. Each of the
   57 lines ripples individually (staggered phase offset set in JS), so a wave
   travels through the lines rather than the whole SVG moving as one piece.
   Edges fade out via a radial mask (mirrors the app's swooshFade). */
.hero-swoosh {
  display: block;
  width: 138px;
  margin: 0 auto 18px;
  opacity: 0.92;
  -webkit-mask-image: radial-gradient(ellipse 58% 62% at 50% 50%, #000 32%, transparent 78%);
          mask-image: radial-gradient(ellipse 58% 62% at 50% 50%, #000 32%, transparent 78%);
}
.hero-swoosh svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;   /* let lines ripple past the viewBox without clipping */
}
.hero-swoosh path {
  transform-box: fill-box;
  transform-origin: center;
  animation: lineFlow 2.6s ease-in-out infinite;
  /* animation-delay is set per line in JS to make the wave travel */
}
@keyframes lineFlow {
  0%   { transform: translateY(-3px) scaleY(0.96); opacity: 0.55; }
  50%  { transform: translateY(3px)  scaleY(1.06); opacity: 1; }
  100% { transform: translateY(-3px) scaleY(0.96); opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-swoosh path { animation: none; }
}
.hero .eyebrow { margin-bottom: 22px; }
.hero h1 {
  font-weight: 700;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 16ch;
  margin: 0 auto;
}
.hero h1 .accent { color: var(--gold); }
.hero .sub {
  margin: 26px auto 0;
  max-width: 46ch;
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 400;
  color: var(--ink-variant);
}
.cta-row {
  margin-top: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 14px 24px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(153, 144, 124, 0.4);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn .apple { width: 16px; height: 16px; }
.hero-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--outline);
  letter-spacing: 0.01em;
}

/* ---------- Phone showcase ---------- */
.showcase {
  position: relative;
  padding: 30px 0 90px;
}
.phones {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(20px, 5vw, 64px);
}
.phone-col { display: flex; flex-direction: column; align-items: center; }
.phone-caption {
  margin-top: 26px;
  text-align: center;
}
.phone-caption .label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 6px;
}
.phone-caption .desc {
  font-size: 14px;
  color: var(--ink-variant);
  max-width: 24ch;
}

.phone {
  position: relative;
  width: clamp(210px, 26vw, 286px);
  background: linear-gradient(150deg, #2c2c2c, #0a0a0a 60%);
  border-radius: 46px;
  padding: 10px;
  box-shadow:
    0 0 0 1.5px rgba(153, 144, 124, 0.16),
    0 40px 80px -30px rgba(0, 0, 0, 0.9),
    0 0 110px -38px rgba(252, 197, 111, 0.45);
}
.phone.raised { transform: translateY(-26px); }
.phone .screen {
  position: relative;
  width: 100%;
  aspect-ratio: 1206 / 2622;   /* exactly matches the iPhone 17 capture — no cropping */
  border-radius: 37px;
  overflow: hidden;
  background: var(--bg);
}
.phone .screen img { display: block; width: 100%; height: 100%; object-fit: cover; }
.phone .island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 31%;
  height: 22px;
  background: #000;
  border-radius: 999px;
  z-index: 3;
}

@media (max-width: 720px) {
  .phones { gap: 16px; }
  .phone.raised { transform: none; }
  .phone-caption .desc { display: none; }
}
@media (max-width: 480px) {
  .phone { width: clamp(150px, 42vw, 200px); }
}

/* ---------- Features ---------- */
.features {
  background: var(--bg-lowest);
  border-top: 1px solid rgba(153, 144, 124, 0.1);
  border-bottom: 1px solid rgba(153, 144, 124, 0.1);
  padding: 86px 0;
}
.section-head { text-align: center; margin-bottom: 54px; }
.section-head .eyebrow { display: block; margin-bottom: 16px; }
.section-head h2 {
  font-weight: 700;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  max-width: 20ch;
  margin: 0 auto;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.feature {
  background: var(--container-low);
  border: 1px solid rgba(153, 144, 124, 0.1);
  padding: 28px 24px 30px;
  border-radius: 4px;
}
.feature .ic {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--outline-faint);
  border-radius: 4px;
  margin-bottom: 20px;
  color: var(--gold);
}
.feature .ic svg { width: 20px; height: 20px; }
.feature h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.feature p {
  font-size: 14px;
  color: var(--ink-variant);
  line-height: 1.55;
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---------- Support ---------- */
.support { padding: 90px 0; text-align: center; }
.support .panel {
  max-width: 720px;
  margin: 0 auto;
  background: linear-gradient(160deg, var(--container), var(--bg-lowest));
  border: 1px solid rgba(153, 144, 124, 0.16);
  border-radius: 6px;
  padding: 56px 40px;
  position: relative;
  overflow: hidden;
}
.support .panel::after {
  content: "";
  position: absolute;
  bottom: -120px; right: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(closest-side, rgba(252, 197, 111, 0.12), transparent 70%);
  pointer-events: none;
}
.support .eyebrow { display: block; margin-bottom: 16px; }
.support h2 {
  font-weight: 700;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.support p {
  color: var(--ink-variant);
  font-size: 16px;
  max-width: 44ch;
  margin: 0 auto 30px;
}
.support .btn { position: relative; z-index: 1; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid rgba(153, 144, 124, 0.12);
  padding: 44px 0;
  background: var(--bg-lowest);
}
.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer .brand-mark { height: 22px; opacity: 0.9; }
.foot-links { display: flex; gap: 26px; flex-wrap: wrap; }
.foot-links a {
  font-size: 13px;
  color: var(--ink-variant);
  transition: color 0.2s ease;
}
.foot-links a:hover { color: var(--gold); }
.copyright { font-size: 12px; color: var(--outline); width: 100%; }

/* ---------- Legal pages (privacy / terms) ---------- */
.legal { padding: 72px 0 96px; }
.legal .wrap { max-width: 760px; }
.legal .eyebrow { display: block; margin-bottom: 14px; }
.legal h1 {
  font-weight: 700;
  font-size: clamp(30px, 5vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: 10px;
}
.legal .updated { color: var(--outline); font-size: 14px; margin-bottom: 8px; }
.legal .intro {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  margin: 26px 0 8px;
}
.legal h2 {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 40px 0 12px;
}
.legal h3 { font-weight: 700; font-size: 15px; color: var(--ink); margin: 22px 0 8px; }
.legal p, .legal li { color: var(--ink-variant); font-size: 15px; line-height: 1.72; }
.legal p { margin-bottom: 14px; }
.legal ul { margin: 0 0 16px; padding-left: 20px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--gold); }
.legal a:hover { text-decoration: underline; }
.legal .back {
  display: inline-block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-variant);
}
.legal .back:hover { color: var(--gold); }
