/* Rivolu — site styles */

:root {
  --bg: #f7f5f1;
  --bg-elev: #ffffff;
  --bg-sunk: #efece6;
  --ink: #14171c;
  --ink-2: #4a4f58;
  --ink-3: #7a7f88;
  --line: rgba(20, 23, 28, 0.09);
  --line-2: rgba(20, 23, 28, 0.16);
  --accent: #0b8fae;
  --accent-ink: #0a6f88;
  --star: #e8a33a;
  --shadow: 0 1px 2px rgba(20, 23, 28, .05), 0 8px 24px -8px rgba(20, 23, 28, .12);
  --shadow-lg: 0 2px 4px rgba(20, 23, 28, .04), 0 30px 60px -20px rgba(20, 23, 28, .25);
  --radius: 22px;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --max: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1220;
    --bg-elev: #111c2e;
    --bg-sunk: #0d1727;
    --ink: #eef0f3;
    --ink-2: #aab0ba;
    --ink-3: #7d838d;
    --line: rgba(160, 200, 255, 0.10);
    --line-2: rgba(160, 200, 255, 0.18);
    --accent: #3cc3e2;
    --accent-ink: #6fd5ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 30px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

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

.eyebrow {
  font: 600 12px/1 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.02;
}
.display em { font-style: italic; color: var(--accent-ink); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 19px; letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; }
.nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav ul a { display: block; padding: 8px 14px; border-radius: 999px; font-size: 15px; color: var(--ink-2); transition: color .2s, background .2s; }
.nav ul a:hover { color: var(--ink); background: var(--bg-sunk); }
.nav .cta { background: var(--ink); color: var(--bg); }
.nav .cta:hover { background: var(--ink); color: var(--bg); opacity: .88; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 96px; position: relative; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(48px, 7.4vw, 96px); margin: 20px 0 24px; }
.hero .lede { font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px;
  font-weight: 550; font-size: 15px;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--bg-sunk); }
.btn svg { width: 16px; height: 16px; }

.stats { display: flex; gap: 40px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: -0.01em; }
.stat span { display: block; margin-top: 8px; font-size: 13px; color: var(--ink-3); }

.icon-field {
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  max-width: 460px; margin-left: auto;
}
.icon-field::before {
  content: ""; position: absolute; inset: -12% -10%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  filter: blur(20px); z-index: -1;
}
.icon-field a { display: block; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.icon-field a:nth-child(3n+2) { transform: translateY(28px); }
.icon-field a:hover { transform: translateY(-6px) scale(1.04); }
.icon-field a:nth-child(3n+2):hover { transform: translateY(22px) scale(1.04); }
.app-icon { width: 100%; aspect-ratio: 1; border-radius: 22.5%; box-shadow: var(--shadow-lg); background: var(--bg-elev); }
.app-icon.mac { border-radius: 0; box-shadow: none; background: none; filter: drop-shadow(0 18px 24px rgba(0,0,0,.22)); transform: scale(1.12); }

/* ---------- Section heads ---------- */
section { scroll-margin-top: 80px; }
.section { padding: 112px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(38px, 5vw, 60px); margin-top: 14px; max-width: 16ch; }
.section-head p { max-width: 40ch; color: var(--ink-2); }

/* ---------- Flagship ---------- */
.flagship {
  position: relative; overflow: hidden;
  border-radius: 32px;
  background:
    radial-gradient(120% 90% at 85% 10%, #1f8fb8 0%, transparent 55%),
    radial-gradient(80% 80% at 0% 100%, #0a3a5c 0%, transparent 60%),
    linear-gradient(160deg, #0c2f4a 0%, #071a2b 100%);
  color: #eaf6fb;
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center;
  min-height: 560px;
}
.flagship .copy { padding: 64px; position: relative; z-index: 2; }
.flagship .eyebrow { color: #8fdcf3; }
.flagship h3 { font-size: clamp(44px, 5.6vw, 72px); margin: 18px 0 18px; }
.flagship h3 + p { font-size: 19px; color: rgba(234,246,251,.78); max-width: 38ch; }
.flagship .rating { display: flex; align-items: center; gap: 14px; margin: 32px 0; }
.flagship .rating b { font-family: var(--serif); font-weight: 400; font-size: 54px; line-height: 1; }
.flagship .rating small { display: block; font-size: 13px; color: rgba(234,246,251,.65); }
.stars { color: var(--star); letter-spacing: 2px; font-size: 15px; }
.flagship .chips span { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); color: #eaf6fb; }
.flagship .links .btn-primary { background: #fff; color: #071a2b; }
.flagship .links .btn-ghost { border-color: rgba(255,255,255,.3); color: #fff; }
.flagship .links .btn-ghost:hover { background: rgba(255,255,255,.08); }
.flagship .visual { position: relative; align-self: end; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.flagship .visual img { width: min(380px, 85%); margin-bottom: -60px; filter: drop-shadow(0 40px 60px rgba(0,0,0,.45)); }
.flagship .waves { position: absolute; left: 0; right: 0; bottom: 0; height: 160px; opacity: .5; pointer-events: none; }

/* ---------- App cards ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.chips span {
  font-size: 12px; font-weight: 550; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-sunk); color: var(--ink-2);
}
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.links .btn { padding: 11px 18px; font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 24px; }
.card {
  position: relative; overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-head { display: flex; align-items: center; gap: 16px; }
.card-head .app-icon { width: 60px; flex: none; box-shadow: var(--shadow); }
.card-head .app-icon.mac { width: 64px; transform: none; filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); }
.card h3 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.card .kind { font-size: 14px; color: var(--ink-3); }
.card .desc { margin-top: 18px; color: var(--ink-2); font-size: 16px; }
.card .tagline { font-family: var(--serif); font-size: 30px; line-height: 1.1; margin-top: 24px; letter-spacing: -0.01em; }

.card.showcase { display: grid; grid-template-columns: 1fr 210px; min-height: 440px; }
.card.showcase .body { padding: 36px 8px 36px 36px; display: flex; flex-direction: column; }
.card.showcase .body .links { margin-top: auto; padding-top: 28px; }
.card.showcase .stage { position: relative; }
.phone {
  position: absolute; left: 6px; top: 40px; width: 230px;
  border-radius: 34px; padding: 7px;
  background: #0b0c0e;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, var(--shadow-lg);
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.phone img { border-radius: 28px; width: 100%; }
.card:hover .phone { transform: translateY(-10px) rotate(-1.5deg); }

/* LightPlan's loading screen (LoadingScreen.swift): black → system blue @30% → system orange @20% → black,
   top-leading → bottom-trailing, composited over black */
.tint-lightplan .stage { background: linear-gradient(to bottom right, #000 0%, #00254d 30%, #331e00 70%, #000 100%); }
.tint-lightplan .stage::after { display: none; }
.tint-fish .stage { background: linear-gradient(180deg, #24425a, #0f2232); }
/* windtrac.app .wind-stage gradient + its hero cyan glow */
.tint-wind .stage {
  background:
    radial-gradient(70% 50% at 80% 0%, rgba(34, 211, 238, .14), transparent 60%),
    linear-gradient(160deg, #0a1230 0%, #122046 55%, #0a1738 100%);
}
.tint-wind .stage::after { display: none; }
.tint-bunting .stage { background: linear-gradient(180deg, #cfe6df, #7cb7ad); }

/* wide cards */
.card.wide { grid-column: 1 / -1; display: grid; grid-template-columns: 0.9fr 1.3fr; align-items: center; min-height: 460px; }
.card.wide .body { padding: 48px; }
.card.wide .shot { padding: 40px 0 40px 0; position: relative; height: 100%; display: flex; align-items: center; }
.card.wide .shot img {
  width: 118%; max-width: none; border-radius: 14px;
  box-shadow: var(--shadow-lg);
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.card.wide:hover .shot img { transform: translateX(-10px); }
.tint-appdesk { background: linear-gradient(120deg, var(--bg-elev) 40%, color-mix(in srgb, #ff4b3e 10%, var(--bg-elev))); }

/* compact cards */
.compact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 24px; }
.card.compact { padding: 32px; display: flex; flex-direction: column; }
.card.compact .links { margin-top: auto; padding-top: 24px; }
.card.compact .desc { margin-bottom: 4px; }

.group-label { display: flex; align-items: center; gap: 16px; margin: 72px 0 0; color: var(--ink-3); font-size: 14px; font-weight: 550; }
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Reviews ---------- */
.reviews { background: var(--bg-sunk); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quotes { columns: 3 300px; column-gap: 24px; }
.quote {
  break-inside: avoid; margin: 0 0 24px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px;
}
.quote p { font-family: var(--serif); font-size: 24px; line-height: 1.25; margin: 12px 0 18px; letter-spacing: -0.005em; }
.quote footer { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); }
.quote footer img { width: 22px; border-radius: 22.5%; }

/* ---------- Contact / footer ---------- */
.contact { text-align: center; padding: 128px 0 112px; }
.contact h2 { font-size: clamp(44px, 6.4vw, 84px); max-width: 14ch; margin: 18px auto 24px; }
.contact p { color: var(--ink-2); font-size: 19px; max-width: 46ch; margin: 0 auto; }
.contact .hero-actions { justify-content: center; }

.footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 14px; color: var(--ink-3); }
.footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a:hover { color: var(--ink); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .icon-field { margin: 24px auto 0; max-width: 400px; }
  .flagship { grid-template-columns: 1fr; }
  .flagship .copy { padding: 48px 40px 0; }
  .flagship .visual img { width: 300px; margin: 32px 0 -80px; }
  .grid { grid-template-columns: 1fr; }
  .card.wide { grid-template-columns: 1fr; }
  .card.wide .shot { padding: 0 0 40px 40px; }
  .card.wide .shot img { width: 130%; }
  .compact-grid { grid-template-columns: 1fr 1fr; }
  .section-head { flex-direction: column; align-items: start; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .nav ul li:not(:last-child) { display: none; }
  .hero { padding: 40px 0 72px; }
  .hero .lede { font-size: 18px; }
  .stats { gap: 24px; }
  .stat b { font-size: 32px; }
  .icon-field { gap: 14px; }
  .section { padding: 80px 0; }
  .flagship { border-radius: 24px; }
  .flagship .copy { padding: 36px 24px 0; }
  .flagship .rating b { font-size: 44px; }
  .card.showcase { grid-template-columns: 1fr; }
  .card.showcase .body { padding: 28px 24px 0; }
  .card.showcase .stage { height: 340px; margin-top: 28px; overflow: hidden; }
  .phone { left: 50%; transform: translateX(-50%); width: 220px; top: 32px; }
  .card:hover .phone { transform: translateX(-50%) translateY(-8px); }
  .card.wide .body { padding: 28px 24px; }
  .card.wide .shot { padding: 0 0 28px 24px; }
  .compact-grid { grid-template-columns: 1fr; }
  .card.compact { padding: 24px; }
  .quote p { font-size: 21px; }
}

/* ---------- Spacious layout (v2) ---------- */
.section { padding: 136px 0; }
.section-head { margin-bottom: 64px; }
.flagship { min-height: 620px; }
.flagship .copy { padding: 80px 72px; }

.grid { gap: 32px; margin-top: 32px; }
.grid.showcases { grid-template-columns: 1fr; }

.card.showcase {
  grid-template-columns: 1fr 1fr;
  min-height: 600px;
  border-radius: 32px;
}
.card.showcase .body { padding: 72px 64px; justify-content: center; }
.card.showcase .body .links { margin-top: 0; padding-top: 36px; }
.card.showcase .tagline { font-size: clamp(36px, 3.6vw, 50px); line-height: 1.04; margin-top: 36px; max-width: 14ch; }
.card.showcase .desc { font-size: 17px; max-width: 40ch; margin-top: 20px; }
.card.showcase .card-head .app-icon { width: 68px; }
.card.showcase h3 { font-size: 24px; }

.card.showcase .stage { overflow: hidden; }
.card.showcase:nth-child(even) .stage { order: -1; }
.card.showcase .stage::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 45% at 50% 40%, rgba(255,255,255,.28), transparent 70%);
  pointer-events: none;
}
.card.showcase .phone {
  left: 50%; top: 72px; width: 300px; z-index: 1;
  border-radius: 46px; padding: 9px;
  transform: translateX(-50%);
}
.card.showcase .phone img { border-radius: 38px; }
.card.showcase:hover .phone { transform: translateX(-50%) translateY(-12px); }

.card.wide { border-radius: 32px; min-height: 540px; }
.card.wide .body { padding: 72px 64px; }
.card.wide .tagline { font-size: clamp(34px, 3.4vw, 46px); line-height: 1.05; margin-top: 32px; }

.compact-grid { gap: 32px; margin-top: 32px; }
.card.compact { padding: 44px 40px; border-radius: 28px; }
.card.compact .desc { margin-top: 24px; }

.group-label { margin: 96px 0 0; }

@media (max-width: 980px) {
  .card.showcase { grid-template-columns: 1fr; min-height: 0; }
  .card.showcase:nth-child(even) .stage { order: 0; }
  .card.showcase .body { padding: 56px 48px 0; }
  .card.showcase .stage { height: 520px; margin-top: 48px; }
  .compact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .section { padding: 88px 0; }
  .section-head { margin-bottom: 40px; }
  .grid, .compact-grid { gap: 20px; }
  .card.showcase, .card.wide, .flagship { border-radius: 24px; }
  .card.showcase .body { padding: 32px 24px 0; }
  .card.showcase .tagline { font-size: 34px; margin-top: 24px; }
  .card.showcase .stage { height: 400px; margin-top: 32px; }
  .card.showcase .phone { width: 240px; top: 40px; border-radius: 38px; padding: 7px; }
  .card.showcase .phone img { border-radius: 32px; }
  .card.wide .body { padding: 32px 24px; }
  .card.compact { padding: 28px 24px; }
  .group-label { margin-top: 64px; }
  .flagship .copy { padding: 40px 24px 0; }
}

/* ---------- Dark mode ambience ---------- */
@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(1200px 700px at 85% -5%, rgba(40, 170, 215, .22), transparent 60%),
      radial-gradient(900px 600px at -10% 20%, rgba(110, 90, 230, .16), transparent 60%),
      radial-gradient(1000px 800px at 50% 105%, rgba(30, 120, 200, .18), transparent 60%),
      linear-gradient(180deg, #0b1424 0%, #0a1220 45%, #08101c 100%);
    background-attachment: fixed;
  }
  .card, .quote {
    background: linear-gradient(180deg, rgba(25, 40, 64, .72), rgba(16, 27, 45, .72));
    border-color: rgba(160, 200, 255, .10);
    box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 20px 50px -20px rgba(0, 0, 0, .6);
  }
  .card:hover { border-color: rgba(120, 210, 240, .22); }
  .tint-appdesk { background: linear-gradient(120deg, rgba(25, 40, 64, .8) 40%, rgba(255, 75, 62, .14)); }
  .reviews { background: rgba(8, 16, 30, .45); }
  .nav { background: color-mix(in srgb, #0a1220 70%, transparent); }
  .chips span { background: rgba(160, 200, 255, .07); }
  .hero h1 em, .display em {
    background: linear-gradient(90deg, #5fd6f0, #9b8cff);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .icon-field::before { background: radial-gradient(closest-side, rgba(60, 195, 226, .35), transparent 70%); }
}

/* ---------- FAQ ---------- */
.faq-list { max-width: 820px; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 26px 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex: none; font-weight: 400; font-size: 26px; line-height: 1;
  color: var(--accent-ink); transition: transform .25s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 0 28px; color: var(--ink-2); max-width: 64ch; }
@media (max-width: 640px) { .faq-item summary { font-size: 17px; padding: 22px 0; } }
