/* The landing page: tokens, type, the hero, the phone and the App Store line. Loaded after site.css.
   Sections are in sections.css, motion in motion.css. */

:root {
  --ink: var(--bone);
  --red-display: var(--red);
  --line-strong: rgba(236, 232, 225, .3);
  --grid: rgba(236, 232, 225, .045);
  --glow-strength: 46%;
  --state-mix: 100%;
  --shadow: 0 2.2rem 3.4rem -1.2rem rgba(2, 3, 4, .85);
  --gutter: clamp(18px, 5vw, 44px);
  --out: cubic-bezier(.16, 1, .3, 1);
}

/* Light: site.css swaps the shared tokens; these are the landing page's own. Phones stay as they are; they are the app. */
@media (prefers-color-scheme: light) {
  :root {
    --red-display: #D92638;
    --line-strong: rgba(15, 20, 25, .42);
    --grid: rgba(15, 20, 25, .05);
    --glow-strength: 52%;
    --state-mix: 74%;
    --shadow: 0 2.2rem 3.4rem -1.4rem rgba(15, 20, 25, .5);
  }
}

html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body { font-size: 1.0625rem; }

.wrap.landing { max-width: calc(72rem + 2 * var(--gutter)); padding-bottom: 56px; overflow-x: clip; }

.landing :focus-visible { outline: 2px solid var(--red-text); outline-offset: 4px; }
.landing .caps { font-size: .75rem; }
.landing header { flex-wrap: wrap; }
.landing header nav a { margin-block: -.5rem; padding-block: .85rem; }

/* Type. Headings size by the viewport under their cap, so a large text setting can't push a word off a phone. */
.landing h1, .landing h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font: 800 1rem/.9 var(--display);
  letter-spacing: .005em;
  text-transform: uppercase;
  text-wrap: balance;
}
.landing h1 { font-size: min(18.4vw, 6rem); line-height: .86; }
.landing h1 span { display: block; }
.landing h2 { display: block; font-size: min(13.4vw, 4.5rem); }
.landing h2::after { content: none; }
.landing h1 em, .landing h2 em { display: inline; font-style: normal; color: var(--red-display); }

.kicker {
  display: flex;
  align-items: baseline;
  gap: .7em;
  margin: 0 0 1.1rem;
  color: var(--body);
  font: 600 .75rem/1.3 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.kicker .slash { letter-spacing: .02em; font-style: italic; }

.lede, .pitch { color: var(--ink); font-size: 1.25rem; line-height: 1.4; text-wrap: pretty; }
.landing p { max-width: 34rem; text-wrap: pretty; }

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 3rem;
  padding: clamp(2.25rem, 7vw, 4.5rem) 0 0;
}
/* Protocol's faint grid, fading out under the headline. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--gutter) * -1) 0;
  z-index: -1;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 3.5rem,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 50% 0 / 3.5rem 100%;
  -webkit-mask-image: linear-gradient(#000, transparent 82%);
  mask-image: linear-gradient(#000, transparent 82%);
}
.hero .lede { margin: 1.5rem 0 0; }

/* The App Store line */
.get { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 2rem; }
.get-text { flex: 1 1 11rem; min-width: 0; }
.get-icon {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px var(--line);
}
.get p { margin: 0; }
.store-soon {
  color: var(--ink);
  font: 700 .875rem/1.25 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.get-note { margin-top: .3rem !important; color: var(--muted); font-size: .9375rem; line-height: 1.4; }
.store-live { display: none; width: fit-content; margin: .2rem 0 .6rem; line-height: 0; text-decoration: none; }
.store-live img { display: block; width: auto; height: 3rem; min-height: 40px; }
/* Live only once the placeholder URL is gone; a browser without :has stays on "Coming soon". */
:root[data-store="live"]:not(:has(.store-live[href*="APP_STORE_URL"])) .store-live { display: block; }
:root[data-store="live"]:not(:has(.store-live[href*="APP_STORE_URL"])) .store-soon { display: none; }

/* A phone: the app's capture in a plain dark body, a tier-coloured glow behind it and Protocol's corner
   ticks around it, as on the store frames. */
.shot { position: relative; isolation: isolate; margin: 0; width: var(--phone, min(76vw, 19rem)); }
.shot::before {
  content: "";
  position: absolute;
  inset: -4% -34%;
  z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) var(--glow-strength), transparent), transparent);
  pointer-events: none;
}
.phone {
  position: relative;
  padding: 1.7%;
  border-radius: 16.6% / 7.75%;
  background: #05070A;
  box-shadow: 0 0 0 1px rgba(236, 232, 225, .3), var(--shadow);
}
.phone img { display: block; width: 100%; height: auto; border-radius: 15.7% / 7.22%; background: #0F1419; }
.phone::after {
  --tick: 1.4rem;
  content: "";
  position: absolute;
  inset: -1.1rem;
  border: 2px solid var(--line-strong);
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) 0 0 / var(--tick) var(--tick) no-repeat,
    linear-gradient(#000 0 0) 100% 0 / var(--tick) var(--tick) no-repeat,
    linear-gradient(#000 0 0) 0 100% / var(--tick) var(--tick) no-repeat,
    linear-gradient(#000 0 0) 100% 100% / var(--tick) var(--tick) no-repeat;
  mask:
    linear-gradient(#000 0 0) 0 0 / var(--tick) var(--tick) no-repeat,
    linear-gradient(#000 0 0) 100% 0 / var(--tick) var(--tick) no-repeat,
    linear-gradient(#000 0 0) 0 100% / var(--tick) var(--tick) no-repeat,
    linear-gradient(#000 0 0) 100% 100% / var(--tick) var(--tick) no-repeat;
}

.hero-shot { justify-self: center; }
.hero-shot figcaption {
  max-width: 21rem;
  margin: 2.4rem auto 0;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}

/* What's inside: six names under hairlines. Columns fall to one when the text is set large. */
.inside { display: block; margin-top: clamp(3rem, 8vw, 5rem); border-bottom: 1px solid var(--line); }
.inside ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(8.5rem, 100%), 1fr));
  column-gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.inside li { margin: 0; padding: 0; border-top: 1px solid var(--line); }
.inside a {
  display: flex;
  align-items: center;
  min-height: 3.25rem;
  padding: .6rem 0;
  border: 0;
  color: var(--ink);
  font: 700 .75rem/1.3 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.inside a:hover { color: var(--red-text); }

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: 2rem;
    padding-top: 4rem;
  }
  .landing h1 { font-size: min(9.6vw, 8.75rem); }
  .landing h2 { font-size: min(7vw, 5.25rem); }
  :where(.landing) p { font-size: 1.125rem; }
  .landing .lede, .landing .pitch { font-size: 1.5rem; line-height: 1.35; }
  .hero .lede { max-width: 33rem; }
  .landing .get-note { font-size: 1rem; }
  .hero-shot { --phone: 21rem; justify-self: end; margin-right: 3.5rem; }
  .hero-shot figcaption { margin-top: 2.2rem; }
  .inside { border-top: 1px solid var(--line); }
  .inside ul { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 1.5rem; }
  .inside li { border: 0; }
}
