/* Rhinograph — home page.
 *
 * Layout, palette and motion adapted from "Landing page: GSAP Carousel /
 * gallery" by Deckard — https://codepen.io/dermalhealth/pen/KwNNbYZ — MIT.
 * The browser cards are drawn in CSS rather than photographed, so the page
 * carries no third-party imagery and shows the thing the product makes.
 */

:root {
  --bg: #f5efe2;
  --bg-2: #ede6d6;
  --ink: #141416;
  --ink-soft: #2b2b30;
  --mute: #8b847a;
  --line: #dad2bf;
  --ghost: #c5bfae;
  --orange-1: #d9351f;
  --orange-2: #e85a2b;
  --orange-3: #f58b4e;
  --orange-4: #fdc68a;
  --shell: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  background: radial-gradient(120% 70% at 50% 0%, #f8f3e7 0%, #f2ead6 60%, #e9dec3 100%);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.1  0 0 0 0 0.1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ── Nav ──────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem clamp(1.1rem, 4vw, 3rem);
  background: rgba(245, 239, 226, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }

.logo {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.03em;
  color: var(--ink);
  text-decoration: none;
}

.nav-right { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.9rem); }
.nav-right a { color: var(--ink-soft); text-decoration: none; font-size: .9rem; transition: color .2s; }
.nav-right a:hover { color: var(--orange-1); }

.nav-cta {
  background: var(--ink);
  color: var(--bg) !important;
  padding: .55rem 1.05rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: .85rem !important;
}
.nav-cta:hover { background: var(--orange-1); }

@media (max-width: 720px) {
  .nav-right a:not(.nav-cta) { display: none; }
}

/* ── Hero ─────────────────────────────────────────────── */

.hero {
  min-height: 100svh;
  padding: clamp(7rem, 14vh, 10rem) clamp(1.1rem, 4vw, 3rem) 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.line-1 {
  font-size: clamp(2.4rem, 9vw, 6.5rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: .95;
}

/* Each word sits in a clipping box so it can rise into view. */
.word { display: inline-block; overflow: hidden; vertical-align: bottom; }
.word > span { display: inline-block; }

.big-wrap { overflow: hidden; margin-top: -.1em; }

.big {
  font-size: clamp(3rem, 15vw, 12rem);
  font-weight: 800;
  letter-spacing: -.06em;
  line-height: .9;
  color: var(--ink);
  /* Letters are positioned against this box so each one can carry the slice
   * of the gradient that belongs to it. */
  position: relative;
}
.big .letter { display: inline-block; }

/* The gradient cannot live on .big: background-clip:text only paints the text
 * of the element holding the background, and every letter here is a child, so
 * the parent would clip a gradient onto nothing and the children would render
 * transparent. Each letter carries the gradient instead, stretched to the full
 * width of the word (--bw) and slid back by its own offset (--bx), which makes
 * the ramp continuous across the line. Ink is the fallback, so the word stays
 * readable if the script never runs. */
.paint .big .letter {
  background-image: linear-gradient(95deg, var(--orange-1), var(--orange-2) 35%, var(--orange-3) 65%, var(--orange-4));
  background-size: var(--bw, 100%) 100%;
  background-position: var(--bx, 0) 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subline { margin-top: 1.5rem; max-width: 46ch; overflow: hidden; }
.subline-text { display: inline-block; color: var(--mute); font-size: clamp(.95rem, 1.6vw, 1.1rem); }

/* ── Fanned browser cards ─────────────────────────────── */

.cards-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(.4rem, 1.4vw, 1.1rem);
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  perspective: 1200px;
  width: 100%;
}

.card {
  width: clamp(88px, 13vw, 186px);
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  background: #fffdf8;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -22px rgba(20, 20, 22, .5);
  overflow: hidden;
  flex: none;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.chrome {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.chrome i { width: 5px; height: 5px; border-radius: 50%; background: var(--ghost); flex: none; }
.chrome b {
  font-size: 6.5px;
  font-weight: 500;
  color: var(--mute);
  margin-left: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: .02em;
}

.shot { flex: 1; padding: 9px; display: flex; flex-direction: column; gap: 6px; }
.shot .bar { height: 5px; border-radius: 3px; background: var(--line); display: block; }
.shot .bar.w80 { width: 80%; } .shot .bar.w70 { width: 70%; }
.shot .bar.w60 { width: 60%; } .shot .bar.w50 { width: 50%; }
.shot .bar.w40 { width: 40%; } .shot .bar.w30 { width: 30%; }
.shot .block { height: 34%; border-radius: 6px; background: linear-gradient(135deg, var(--orange-3), var(--orange-4)); }
.shot .block.tall { height: 52%; }
.shot .cols { display: flex; gap: 6px; flex: 1; }
.shot .cols span { flex: 1; border-radius: 5px; background: var(--bg-2); border: 1px solid var(--line); }
.shot .cols.three span:nth-child(2) { background: var(--orange-4); border-color: var(--orange-4); }
.shot-b .block { background: linear-gradient(135deg, var(--orange-1), var(--orange-3)); }
.shot-e .block { background: linear-gradient(135deg, var(--ghost), var(--bg-2)); }

@media (max-width: 560px) {
  .card-1, .card-6 { display: none; }
}

.hero-cta { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; margin-top: clamp(2rem, 5vw, 3.2rem); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: .9rem 1.7rem;
  border-radius: 100px;
  transition: background .2s, transform .12s;
}
.btn:hover { background: var(--orange-1); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; }

/* ── Shared section furniture ─────────────────────────── */

section { padding: clamp(4rem, 10vw, 8rem) clamp(1.1rem, 4vw, 3rem); }

.eyebrow {
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: .9rem;
}

h2 {
  font-size: clamp(1.7rem, 4.4vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1.04;
}
h2 em, .cta h2 em { font-style: italic; color: var(--orange-1); }

.how-head {
  max-width: var(--shell);
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: end;
}
.how-head p { color: var(--mute); max-width: 42ch; }
@media (max-width: 800px) { .how-head { grid-template-columns: 1fr; align-items: start; } }

/* ── Steps ────────────────────────────────────────────── */

.steps {
  max-width: var(--shell);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
}
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

.step { border-top: 1px solid var(--line); padding-top: 1.4rem; }
.step-n { font-size: .78rem; color: var(--orange-1); letter-spacing: .12em; margin-bottom: .8rem; }
.step h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; margin-bottom: .4rem; }
.step p { color: var(--mute); font-size: .93rem; }

/* ── Cards grid ───────────────────────────────────────── */

.grid {
  max-width: var(--shell);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(.8rem, 2vw, 1.4rem);
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

.g-card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem;
  transition: transform .25s, box-shadow .25s;
}
.g-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -24px rgba(20, 20, 22, .5); }
.g-card h3 { font-size: 1.06rem; font-weight: 600; letter-spacing: -.02em; margin-bottom: .45rem; }
.g-card p { color: var(--mute); font-size: .92rem; }

/* ── Stats ────────────────────────────────────────────── */

.stats { background: var(--ink); color: var(--bg); border-radius: clamp(20px, 3vw, 34px); margin: 0 clamp(.6rem, 2vw, 1.6rem); }
.stats-inner {
  max-width: var(--shell);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 2rem;
  align-items: end;
}
@media (max-width: 900px) { .stats-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .stats-inner { grid-template-columns: 1fr; } }

.stats h3 { font-size: clamp(1.5rem, 3.4vw, 2.6rem); font-weight: 500; letter-spacing: -.04em; line-height: 1.05; }
.stats h3 em { font-style: italic; color: var(--orange-3); }
.num { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.num small { font-size: .4em; font-weight: 500; margin-left: .1em; color: var(--orange-3); }
.lbl { color: rgba(245, 239, 226, .55); font-size: .84rem; margin-top: .5rem; max-width: 22ch; }

/* ── CTA + footer ─────────────────────────────────────── */

.cta { text-align: center; display: flex; flex-direction: column; align-items: center; }
.cta p { color: var(--mute); margin: 1rem 0 1.9rem; max-width: 44ch; }

.foot { border-top: 1px solid var(--line); padding: 2.5rem clamp(1.1rem, 4vw, 3rem); }
.foot-in {
  max-width: var(--shell);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
  justify-content: space-between;
}
.foot nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.foot a { color: var(--mute); text-decoration: none; font-size: .88rem; }
.foot a:hover { color: var(--ink); }
.foot .small { color: var(--ghost); font-size: .8rem; }

/* Anything that animates in starts hidden — but only when the script is
 * there to reveal it, so a failed CDN never leaves a blank page. */
.js .reveal { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
