/* Soapstone website: the Facet brand (MIST-62). Flat color, crisp edges, no gradients, glows, or shadows.
   Rules: orange is never text on white; orange fills always carry charcoal text; never white text on orange. */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* Message text only (share pages, MIST-63). Declared here; browsers download it only when a page uses it. */
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --orange: #fa961e;
  --on-orange: #1c1d20;
  --bg: #ffffff;
  --surface: #f5f4f3;
  --border: #e4e2e0;
  --text: #1c1d20;
  --text-secondary: #3a3c42;
  --text-muted: #5c5f66;
  --link-text: #26211d;
  --link-underline: #fa961e;
  --focus: #1c1d20;

  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-message: "Source Serif 4", Georgia, serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 44px;
  --space-9: 56px;

  --radius-button: 10px;
  --radius-card: 12px;
  --radius-panel: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1d20;
    --surface: #26272b;
    --border: #34363b;
    --text: #f5f5f4;
    --text-secondary: #c9cbd0;
    --text-muted: #a9acb3;
    --link-text: #fa961e;
    --link-underline: #fa961e;
    --focus: #fa961e;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link-text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link-underline) 70%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: none; /* Prevents the browser from chopping up the line */
}

/* Hover strengthens and thickens the underline (it grows downward, so nothing shifts). */
a:hover {
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 3px;
}

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  background: var(--bg);
  padding: var(--space-2) var(--space-3);
}

.skip-link:focus {
  top: var(--space-2);
}

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

.wrap--text {
  max-width: 720px;
}

/* --- Header --- */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
  flex-wrap: wrap;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.mark img {
  width: 32px;
  height: 32px;
}

.site-nav {
  display: flex;
  gap: var(--space-5);
  font-size: 15px;
  font-weight: 600;
}

/* --- Type --- */

h1,
h2,
h3 {
  color: var(--text);
  margin: 0 0 var(--space-4);
}

.display {
  font-size: 44px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
}

h3 {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 700;
}

p {
  margin: 0 0 var(--space-4);
  color: var(--text-secondary);
}

.label {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
}

.lead {
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.muted {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
}

/* --- Buttons --- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-button);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

/* <button>s start from the browser's own look; links don't. :where() keeps this from outranking the variants. */
:where(button.button) {
  appearance: none;
  border: 0;
  margin: 0;
}

.button--primary {
  background: var(--orange);
  color: var(--on-orange);
}

/* Hover darkens 15% toward the label's charcoal: a visible change, and the label stays above 5.5:1. */
.button--primary:hover {
  background: color-mix(in srgb, var(--orange) 85%, var(--on-orange));
}

.button--secondary {
  background: transparent;
  border: 1.5px solid var(--text);
  color: var(--text);
}

.button--secondary:hover {
  background: var(--surface);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  margin: var(--space-6) 0 0;
}

/* --- Landing --- */

.section {
  padding: var(--space-9) 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.hero .wrap {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

.hero__icon {
  width: 160px;
  justify-self: start;
}

/* The globe (MIST-111): its video on its poster, in a panel of its own background (the render's, not the page's). */
.hero__globe {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1;
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: #f5f4f3;
}

.hero__globe img,
.hero__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.hero__video--dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .hero__globe {
    background: #0b0c0f;
  }

  .hero__video--light {
    display: none;
  }

  .hero__video--dark {
    display: block;
  }
}

/* The sources already won't load with reduced motion; this covers browsers that ignore a source's media. */
@media (prefers-reduced-motion: reduce) {
  .hero__video,
  .hero__video--dark {
    display: none;
  }
}

/* A readable measure, aligned with the rest of the page (capping .wrap itself would center the column). */
.prose > * {
  max-width: 640px;
}

.features {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-6);
}

.feature h3 {
  margin-bottom: var(--space-2);
}

.feature p {
  margin: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: var(--space-7) var(--space-6);
}

.panel__note {
  margin: var(--space-4) 0 0;
}

.press-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --- Message showcase (MIST-67) --- */

.showcase__layout {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

/* A snapshot is 2:1. Frames stack so a new one can fade in over the old. */
.showcase__map {
  position: relative;
  aspect-ratio: 2 / 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: var(--surface);
}

.showcase__map[hidden] {
  display: none;
}

.showcase__frame,
.showcase__frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase__frame {
  transition: opacity 600ms ease;
}

/* The settle (MIST-74): the script zooms each map in by its --focus-scale about its --focus-origin (the server's data
   attributes, app/maps.py Focus), toward the marker, which ends centered. The origin keeps Apple's logo wholly in the
   frame, and a zoom of 1 or more never shows an edge. */
.showcase__frame img {
  transform-origin: var(--focus-origin, center);
  transform: scale(var(--focus-scale, 1));
  transition: transform 1800ms ease-out;
}

.showcase__frame.is-entering {
  opacity: 0;
}

.showcase__card [data-showcase-text],
.showcase__card [data-showcase-meta] {
  transition: opacity 300ms ease;
}

.showcase__card.is-changing [data-showcase-text],
.showcase__card.is-changing [data-showcase-meta] {
  opacity: 0;
}

/* Room for two lines of message, so the controls stay put as most messages change. */
.showcase__card .message {
  min-height: 2.5em;
}

.showcase__controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.showcase__controls[hidden],
.showcase__controls [hidden] {
  display: none;
}

/* Message text: Source Serif 4, as messages appear everywhere (the app, share pages). */
.message {
  font-family: var(--font-message);
  font-weight: 600;
  font-optical-sizing: auto;
  font-size: 28px;
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 var(--space-3);
}

@media (prefers-reduced-motion: reduce) {
  .showcase__frame,
  .showcase__frame img {
    transition: none;
  }

  /* No settle: the whole snapshot, as without the script. */
  .showcase__frame img {
    transform: none;
  }

  .showcase__card [data-showcase-text],
  .showcase__card [data-showcase-meta] {
    transition: none;
  }
}

/* --- Share pages (MIST-63): one message, its map above it --- */

.share__layout {
  display: grid;
  gap: var(--space-6);
  max-width: 720px;
}

.share__map {
  aspect-ratio: 2 / 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: var(--surface);
}

.share__map[hidden] {
  display: none;
}

.share__map img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share__badge {
  margin-bottom: var(--space-2);
}

.message.share__text {
  font-size: 36px;
  line-height: 1.2;
  margin-bottom: var(--space-3);
}

/* --- Long-form text (privacy, terms, support) --- */

.legal {
  padding: var(--space-8) 0 var(--space-9);
}

.legal h1 {
  margin-bottom: var(--space-2);
}

.legal h2 {
  margin-top: var(--space-8);
}

.legal h3 {
  margin-top: var(--space-6);
}

.legal ul {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-6);
  color: var(--text-secondary);
}

.legal li {
  margin-bottom: var(--space-2);
}

.legal strong {
  color: var(--text);
}

.legal a strong {
  color: inherit;
}

/* --- The feedback form (/support, MIST-83) --- */

.feedback-form {
  display: grid;
  gap: var(--space-5);
  margin: var(--space-6) 0 0;
}

.feedback-form label,
.feedback-form legend {
  display: block;
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

.feedback-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.feedback-form .choice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 400;
  margin: 0 0 var(--space-2);
}

.feedback-form textarea,
.feedback-form input[type="email"] {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-button);
  padding: var(--space-3);
}

.feedback-form textarea {
  min-height: 9em;
  resize: vertical;
}

.feedback-form textarea:focus,
.feedback-form input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.feedback-form .hint {
  margin: var(--space-1) 0 0;
}

.form-error {
  border: 1.5px solid var(--orange);
  border-radius: var(--radius-card);
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
}

/* The honeypot: off screen for people (and aria-hidden, untabbable), still in the form for bots. */
.feedback-form .trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Footer --- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-7) 0 var(--space-8);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
  font-size: 15px;
  font-weight: 600;
}

.site-footer p {
  margin: 0 0 var(--space-2);
}

/* --- Wider screens --- */

@media (min-width: 720px) {
  .hero .wrap {
    grid-template-columns: 1fr auto;
  }

  .hero__icon {
    width: 240px;
    justify-self: end;
  }

  .hero__globe {
    width: 420px;
    justify-self: end;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 860px) {
  /* Side by side only when there's a map to show. */
  .showcase__layout:has(> .showcase__map:not([hidden])) {
    grid-template-columns: 3fr 2fr;
    gap: var(--space-8);
  }
}

@media (min-width: 1000px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}
