/*
 * Borr — landing site.
 *
 * One stylesheet for all three pages. The palette below is the app's dark
 * theme (lib/theme.ts) pushed a shade deeper for the web: the app's base is
 * #0A0A0B, the page bottoms out nearer #050505 so the app's own black reads as
 * a lit surface sitting on top of it.
 *
 * The accent (--sage) is the app's one accent and is used exactly three times
 * on the landing page: the two submit buttons and the tick beside "One tap".
 * A fourth use would flatten the other three. Success text borrows it, but only
 * after someone has acted — nothing on the page at rest.
 */

:root {
  --ink: #050505; /* the deepest point; page edges fall to this */
  --base: #08080a; /* the page */
  --raise: #0e0e10; /* dark glass panels */
  --hair: rgba(255, 255, 255, 0.07); /* every border on the page */
  --hair-strong: rgba(255, 255, 255, 0.13);

  --text: #f4f4f2; /* headlines */
  --dim: #97979d; /* body copy */
  --faint: #66666c; /* footnotes, footer */

  --sage: #7fa382;
  --sage-deep: #6c8f70;
  --on-sage: #08080a;

  --danger: #e4736a;

  /* Modern grotesk. On the phones this page is selling, this is SF Pro. */
  --grotesk: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI',
    'Helvetica Neue', Inter, Arial, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --measure: 34rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--grotesk);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/*
 * Tonal variation rather than flat black. Three very soft radial pools —
 * one behind the hero, one at each of the lower sections — laid over a
 * vertical fall from --base to --ink. None of them is bright enough to name a
 * colour; they just stop the page reading as a single sheet.
 */
.field {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(120vw 70vh at 50% -10vh, rgba(255, 255, 255, 0.052), transparent 60%),
    radial-gradient(90vw 60vh at 12% 42%, rgba(255, 255, 255, 0.026), transparent 62%),
    radial-gradient(90vw 60vh at 88% 78%, rgba(255, 255, 255, 0.022), transparent 62%),
    linear-gradient(180deg, var(--base) 0%, var(--ink) 55%, var(--base) 100%);
}

/* Grain. Fine, fixed, and low enough that you notice its absence, not it. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

/* ---------------------------------------------------------------- type --- */

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: clamp(3rem, 10.5vw, 8rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(2.25rem, 6.5vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

h3 {
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.lede {
  max-width: var(--measure);
  font-size: clamp(1.0625rem, 1.9vw, 1.3125rem);
  line-height: 1.55;
  letter-spacing: -0.011em;
  color: var(--dim);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* -------------------------------------------------------------- chrome --- */

.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.5rem, 3.5vw, 2.5rem) var(--gutter);
}

.mark {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}

.mast .eyebrow {
  font-size: 0.6875rem;
}

.wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------------------------------------------------------------- hero --- */

.hero {
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(4rem, 13vh, 9rem) var(--gutter) clamp(3rem, 8vh, 6rem);
}

.hero h1 {
  margin: clamp(1.25rem, 3vw, 2rem) 0 clamp(1.5rem, 3vw, 2.25rem);
  max-width: 15ch;
}

.hero .lede {
  margin-bottom: clamp(2.25rem, 5vw, 3.25rem);
}

.hero-note {
  margin-top: 1.125rem;
  font-size: 0.875rem;
  color: var(--faint);
}

/* ------------------------------------------------------------- devices --- */

/*
 * A screenshot is presented as the phone itself, suspended: no frame, no
 * mockup furniture. What sells it is the light — a soft pool behind it, a
 * hairline rim on the glass edge, and four stacked shadows that get wider and
 * softer as they go, the way a real object's contact and ambient shadows do.
 */
.stage {
  display: flex;
  justify-content: center;
  padding: clamp(2rem, 6vw, 5rem) var(--gutter);
}

.device {
  position: relative;
  width: min(360px, 76vw);
  margin: 0;
  border-radius: 12.5% / 5.77%;
  will-change: transform;
}

/* The hero phone carries the page, so it is the largest thing on it. */
.stage--hero .device {
  width: min(420px, 80vw);
}

.device::before {
  content: '';
  position: absolute;
  inset: -22% -34%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    closest-side ellipse at 50% 40%,
    rgba(255, 255, 255, 0.105),
    rgba(255, 255, 255, 0.032) 52%,
    transparent 76%
  );
}

.device img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  background: var(--base);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 10px 24px rgba(0, 0, 0, 0.5),
    0 34px 70px rgba(0, 0, 0, 0.55),
    0 80px 150px rgba(0, 0, 0, 0.6);
}

/* The rim: bright along the top edge, fading to nothing by the bottom. */
.device::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  padding: 1px;
  background: linear-gradient(
    170deg,
    rgba(255, 255, 255, 0.34),
    rgba(255, 255, 255, 0.09) 22%,
    rgba(255, 255, 255, 0.03) 55%,
    rgba(255, 255, 255, 0.11) 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.device figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ------------------------------------------------------------ sections --- */

.section {
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(5rem, 14vh, 10rem) var(--gutter);
}

/* Typography-led: the heading alone, given room. */
.section--type {
  max-width: 64rem;
}

.section--type h2 {
  max-width: 16ch;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

/* Screenshot-led: copy and device side by side above 62rem, stacked below. */
.section--split {
  display: grid;
  gap: clamp(3rem, 7vw, 5.5rem);
  align-items: center;
}

.section--split h2 {
  max-width: 13ch;
  margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
}

.section--split .stage {
  padding: 0;
}

@media (min-width: 62rem) {
  .section--split {
    grid-template-columns: 1fr 1fr;
  }

  /* Alternating: the second split section puts its device on the left. */
  .section--split.is-flipped .copy {
    order: 2;
  }
}

/* The one tick. Sage, once. */
.tick {
  display: block;
  width: 2rem;
  height: 2rem;
  margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
  color: var(--sage);
}

/* ------------------------------------------------------------- closing --- */

.closing {
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(5rem, 14vh, 10rem) var(--gutter) clamp(4rem, 10vh, 7rem);
}

.closing h2 {
  max-width: 12ch;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.closing .signup {
  margin-top: clamp(2.25rem, 5vw, 3.25rem);
}

/* ---------------------------------------------------------------- form --- */

.signup {
  max-width: 30rem;
}

.form-label {
  margin-bottom: 0.875rem;
  font-size: 0.9375rem;
  color: var(--dim);
}

/*
 * A dark glass panel — one of two on the page. The input and button live
 * inside a single bordered shell so they read as one object.
 */
.signup-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.4375rem;
  border: 1px solid var(--hair);
  border-radius: 0.875rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 34px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.signup-row:focus-within {
  border-color: var(--hair-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 12px 34px rgba(0, 0, 0, 0.5);
}

.signup input[type='email'] {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.75rem 0.75rem 0.875rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  letter-spacing: -0.008em;
}

.signup input[type='email']::placeholder {
  color: var(--faint);
}

.signup input[type='email']:focus {
  outline: none;
}

.signup button {
  flex: none;
  padding: 0.75rem 1.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--sage);
  color: var(--on-sage);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  cursor: pointer;
  transition: background 0.25s var(--ease), opacity 0.25s var(--ease);
}

.signup button:hover {
  background: var(--sage-deep);
}

.signup button:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Off-screen honeypot. Bots fill it; people never see it. */
.gotcha {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.signup-msg {
  min-height: 1.375rem;
  margin-top: 0.875rem;
  font-size: 0.875rem;
  line-height: 1.375rem;
  color: var(--dim);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.signup-msg.is-shown {
  opacity: 1;
  transform: none;
}

.signup-msg.is-ok {
  color: var(--sage);
}

.signup-msg.is-bad {
  color: var(--danger);
}

:focus-visible {
  outline: 2px solid var(--hair-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

/* -------------------------------------------------------------- footer --- */

.foot {
  border-top: 1px solid var(--hair);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  align-items: baseline;
  justify-content: space-between;
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) var(--gutter);
  font-size: 0.875rem;
  color: var(--faint);
}

.foot nav {
  display: flex;
  gap: 1.75rem;
}

.foot a {
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.foot a:hover {
  color: var(--text);
}

/* ----------------------------------------------------------- documents --- */

/* /support and /privacy. Same darkness, no devices, one column. */
.doc {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 6rem) var(--gutter) clamp(4rem, 10vh, 7rem);
}

.doc h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.doc h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0.875rem;
}

.doc p,
.doc li {
  max-width: 40rem;
  color: var(--dim);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.doc p + p,
.doc ul + p {
  margin-top: 1rem;
}

.doc ul {
  margin: 1rem 0 0;
  padding-left: 1.125rem;
}

.doc li + li {
  margin-top: 0.625rem;
}

.doc .updated {
  margin-top: clamp(3rem, 6vw, 4rem);
  font-size: 0.875rem;
  color: var(--faint);
}

/* A single dark glass panel for the contact address. */
.contact {
  margin-top: 1.75rem;
  padding: clamp(1.5rem, 4vw, 2rem);
  border: 1px solid var(--hair);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 50px rgba(0, 0, 0, 0.4);
}

.contact a {
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--hair-strong);
  padding-bottom: 2px;
  transition: border-color 0.25s var(--ease);
}

.contact a:hover {
  border-bottom-color: var(--sage);
}

.back {
  display: inline-block;
  margin-bottom: clamp(2rem, 5vw, 3rem);
  font-size: 0.875rem;
  color: var(--faint);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.back:hover {
  color: var(--text);
}

/* -------------------------------------------------------------- motion --- */

/*
 * Reveals are opacity and a short lift, on a decelerating curve with no
 * overshoot. .is-in is added by borr.js; without JS the .no-js rule below
 * leaves everything visible, so the page never depends on script to be read.
 */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.no-js .reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .device {
    transform: none !important;
  }
}
