/* ============================================================
   Gainwisely marketing site.
   Palette and type are the portal's (updates/portal/styles.css):
   paper, ink, one gold accent, Geist + Geist Mono. The app's lime
   lives only inside the app screenshots.
   ============================================================ */
:root {
  --paper: #FAFAF7;
  --paper-2: #F3F3EC;
  --ink: #0A0A0A;
  --text: #2A2A25;
  --muted: #66665E;
  --line: #E4E4DA;
  --line-strong: #D0D0C4;
  --gold: #F5C518;
  --gold-strong: #E0B100;
  --gold-soft: #FFF1B8;
  --night: #0B0B0A;
  --night-text: #D8D8CF;
  --night-muted: #9A9A90;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1240px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.kicker {
  font: 500 12px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(250, 250, 247, .9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 18px; letter-spacing: -.01em; }
.brand img { display: block; width: 38px; height: 38px; border-radius: 10px; }
.nav-links { display: flex; gap: 26px; margin-left: 12px; font-size: 14.5px; color: var(--muted); }
.nav-links a { text-decoration: none; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 14.5px; }
.nav-right .plain { color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav-right .plain:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px; border-radius: 8px;
  background: var(--gold); color: var(--ink);
  font: 600 15px/1 var(--sans); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--gold-strong);
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: #FFD23F; }
.btn:active { transform: translateY(1px); }
.btn.sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--paper-2); }
.link-arrow { font-weight: 550; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.link-arrow:hover { text-decoration-color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 9vw, 112px) 0 0; }
.hero h1 {
  max-width: 15ch;
  font: 600 clamp(42px, 7vw, 92px)/1.0 var(--sans);
  letter-spacing: -.045em;
  color: var(--ink);
  text-wrap: balance;
}
h1 mark {
  background: linear-gradient(transparent 62%, var(--gold) 62%, var(--gold) 92%, transparent 92%);
  color: inherit; padding: 0 .04em;
  background-repeat: no-repeat; background-size: 100% 100%;
}
.hero-sub { max-width: 58ch; margin-top: 28px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: var(--text); text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 34px; }
.fine { margin-top: 18px; font-size: 14px; color: var(--muted); }

.hero-visual { position: relative; margin-top: clamp(44px, 6vw, 72px); padding-bottom: clamp(36px, 5vw, 60px); }
.browser {
  border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: #fff;
  box-shadow: 0 40px 90px -30px rgba(10, 10, 10, .28), 0 2px 6px rgba(10, 10, 10, .06);
}
.browser img { display: block; width: 100%; }
.hero-visual .phone { position: absolute; right: 2.5%; bottom: 0; width: clamp(120px, 19%, 240px); }
.caption { margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.hero-visual .caption { max-width: calc(100% - 24%); }

.phone {
  background: var(--night); border-radius: clamp(24px, 3.4vw, 40px); padding: clamp(4px, .6vw, 7px);
  box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08) inset;
}
.phone img { display: block; width: 100%; border-radius: clamp(20px, 2.9vw, 34px); }

/* ---------- sections ---------- */
section { padding: clamp(72px, 10vw, 128px) 0; }
.rule { border-top: 1px solid var(--line); }
.row { display: grid; gap: clamp(32px, 5vw, 72px); align-items: center; }
h2 {
  font: 600 clamp(30px, 4.2vw, 52px)/1.06 var(--sans);
  letter-spacing: -.035em; color: var(--ink); text-wrap: balance;
}
.row .kicker { display: block; margin-bottom: 20px; }
.row p { margin-top: 22px; max-width: 54ch; text-wrap: pretty; }
.row p + p { margin-top: 16px; }
.facts { margin-top: 28px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.facts li { display: flex; gap: 18px; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.facts b { font-weight: 600; color: var(--ink); white-space: nowrap; }
.facts span { color: var(--muted); text-align: right; }

.crop {
  border: 1px solid var(--line-strong); border-radius: 14px; background-color: #fff;
  background-repeat: no-repeat;
  aspect-ratio: 2.02 / 1; /* status bar down to staff coverage, from the dashboard screenshot */
  background-image: url("img/portal-dashboard.jpg");
  background-size: 120% auto; background-position: 96% 86.7%;
  box-shadow: 0 30px 70px -28px rgba(10, 10, 10, .25), 0 2px 6px rgba(10, 10, 10, .05);
}

@media (min-width: 900px) {
  .row { grid-template-columns: minmax(0, 9fr) minmax(0, 15fr); }
  .row.flip { grid-template-columns: minmax(0, 15fr) minmax(0, 9fr); }
  .row.flip .row-text { order: 2; }
}

/* ---------- the app (dark band) ---------- */
.night { background: var(--night); color: var(--night-text); }
.night h2 { color: #fff; }
.night .kicker { color: var(--gold); }
.night .lede { margin-top: 22px; max-width: 58ch; color: var(--night-text); text-wrap: pretty; }
.phones { display: grid; gap: 40px 24px; grid-template-columns: repeat(2, 1fr); margin-top: clamp(44px, 6vw, 72px); }
.phones figure { max-width: 300px; }
.phones .phone { box-shadow: 0 0 0 1px #2B2B27, 0 30px 60px -20px rgba(0, 0, 0, .8); background: #151513; }
.phones figcaption { margin-top: 20px; font-size: 15px; line-height: 1.55; color: var(--night-muted); }
.phones figcaption b { display: block; margin-bottom: 4px; color: #fff; font-weight: 600; font-size: 16px; }
@media (min-width: 900px) { .phones { grid-template-columns: repeat(4, 1fr); } }

/* ---------- closing ---------- */
.closing { text-align: left; }
.closing .box {
  display: grid; gap: 28px; align-items: center;
  padding: clamp(32px, 5vw, 64px); border-radius: 16px;
  background: var(--gold); color: var(--ink);
}
.closing h2 { max-width: 18ch; }
.closing p { max-width: 50ch; margin-top: 16px; color: #2B2400; }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.dark:hover { background: #262621; }
@media (min-width: 900px) { .closing .box { grid-template-columns: 1fr auto; } }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 36px 0 48px; font-size: 14.5px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 36px; align-items: center; justify-content: space-between; }
footer .brand { font-size: 16px; }
footer .brand img { width: 30px; height: 30px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .nav-links { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .nav-right .plain { display: none; }
  .nav .wrap { height: 58px; }
  .brand img { width: 36px; height: 36px; }
  .btn.sm { min-height: 44px; }
  .link-arrow { display: inline-flex; align-items: center; min-height: 44px; }
  .foot-links { gap: 0 20px; }
  .foot-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .hero-visual .phone { right: 0; width: 30%; }
  .hero-visual .caption { max-width: 66%; }
  .facts li { flex-direction: column; gap: 4px; }
  .facts span { text-align: left; }
}

/* ---------- long-form pages (privacy, support) ---------- */
.doc { padding: clamp(48px, 7vw, 88px) 0 clamp(64px, 9vw, 120px); }
.doc .narrow { width: min(760px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.doc h1 { font: 600 clamp(34px, 5vw, 56px)/1.05 var(--sans); letter-spacing: -.04em; color: var(--ink); }
.doc .updated { margin-top: 14px; font: 500 13px/1.4 var(--mono); color: var(--muted); letter-spacing: .03em; }
.doc h2 { margin-top: 52px; font: 600 24px/1.2 var(--sans); letter-spacing: -.02em; }
.doc h3 { margin-top: 28px; font: 600 17px/1.3 var(--sans); color: var(--ink); }
.doc p, .doc li { max-width: 68ch; }
.doc p { margin-top: 14px; }
.doc ul { margin-top: 12px; padding-left: 22px; }
.doc li { margin-top: 8px; }
.doc a { text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.doc a:hover { text-decoration-color: var(--ink); }
.doc .lead { margin-top: 22px; font-size: 19px; color: var(--text); }
.doc .callout { margin-top: 28px; padding: 18px 20px; border-left: 3px solid var(--gold); background: var(--paper-2); border-radius: 0 8px 8px 0; }
.doc table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th { font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lost { min-height: 62vh; display: grid; align-content: center; padding: 80px 0; }
.lost h1 { font: 600 clamp(48px, 9vw, 120px)/.95 var(--sans); letter-spacing: -.05em; color: var(--ink); }
.lost p { max-width: 44ch; margin-top: 20px; font-size: 19px; }
.lost .hero-actions { margin-top: 28px; }
.doc .btn { margin-top: 24px; }
.doc .btn:hover { text-decoration: none; }

/* very small phones (320-360px): keep the nav from crowding */
@media (max-width: 360px) {
  .nav .wrap { gap: 10px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .btn.sm { padding: 0 12px; font-size: 13.5px; }
}

/* ---------- motion ----------
   Everything below is progressive: with no JS, a failed script (.reveal-all),
   or prefers-reduced-motion, all content is simply visible. */

/* nav button: only shown once the hero button has scrolled out of view,
   so "Request access" is never on screen twice */
.js .nav[data-cta="scroll"] .nav-cta { opacity: 0; visibility: hidden; transform: translateY(-4px); }
.js .nav[data-cta="scroll"].show-cta .nav-cta,
.js.reveal-all .nav[data-cta="scroll"] .nav-cta { opacity: 1; visibility: visible; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  .js .nav[data-cta="scroll"] .nav-cta {
    transition: opacity .25s ease, transform .25s ease, background .15s ease, visibility 0s linear .25s;
  }
  .js .nav[data-cta="scroll"].show-cta .nav-cta { transition-delay: 0s; }

  /* hero: plays on load, in sequence */
  [data-load] { animation: rise .8s cubic-bezier(.22, 1, .36, 1) both; animation-delay: var(--d, 0ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(20px); } }
  h1 mark { animation: marker .9s cubic-bezier(.65, 0, .35, 1) .55s both; }
  @keyframes marker { from { background-size: 0% 100%; } }

  /* everything else: rises into place once, as it scrolls into view */
  .js [data-reveal] {
    opacity: 0; transform: translateY(22px);
    transition: opacity .7s cubic-bezier(.22, 1, .36, 1), transform .7s cubic-bezier(.22, 1, .36, 1);
    transition-delay: var(--d, 0ms);
  }
  .js [data-reveal].in, .js.reveal-all [data-reveal] { opacity: 1; transform: none; }

  .phones .phone { transition: transform .4s cubic-bezier(.22, 1, .36, 1); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .phones figure:hover .phone { transform: translateY(-8px); }
}
