/*
   Component styles that are easier to read as CSS than as class lists: the navbar's pieces, the
   hero, the device frames and the manual's copy helpers. Unlayered, so
   it beats every Tailwind layer. Colors are the tokens tailwind.css defines per display mode
   (--color-*); nothing here names a literal site color.
*/

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/archivo-latin-wght.woff2) format("woff2");
}

:root {
  --nav-h: 64px;
  --img-dim: 1;
}

/* Night dims imagery the way the app dims the chart, so a screenshot is never the brightest thing. */
:root[data-theme="night"] {
  --img-dim: 0.72;
}

body {
  margin: 0;
  padding: 0;
  padding-top: var(--nav-h);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  font-kerning: normal;
}

img {
  filter: brightness(var(--img-dim));
}

/* ---- Icons: one-color glyphs drawn as masks, so they take the current text color. ---- */

.ico {
  display: inline-block;
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}

.ico-day {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2.5M12 19.5V22M2 12h2.5M19.5 12H22M4.9 4.9l1.8 1.8M17.3 17.3l1.8 1.8M4.9 19.1l1.8-1.8M17.3 6.7l1.8-1.8'/%3E%3C/svg%3E");
}

.ico-dusk {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 16a5 5 0 0 1 10 0M2 16h20M5 20.5h14M12 4v3M4.6 8.6l1.8 1.8M19.4 8.6l-1.8 1.8'/%3E%3C/svg%3E");
}

.ico-night {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z'/%3E%3C/svg%3E");
}

.ico-menu {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E");
  width: 1.5rem;
  height: 1.5rem;
}

.ico-close {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  width: 1.5rem;
  height: 1.5rem;
}

/* The sail-and-moon mark, cut from the logo so it can take the mode's accent. */
.brand-mark {
  display: inline-block;
  width: 1.75rem;
  height: 2.1rem;
  flex: none;
  background-color: var(--color-accent);
  -webkit-mask: url(/images/logo_mark.png) center / contain no-repeat;
  mask: url(/images/logo_mark.png) center / contain no-repeat;
}

/* ---- Day / Dusk / Night switch: the site's theme and the chart's, one setting. ---- */

.theme-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--color-rule);
  border-radius: 999px;
  background: var(--color-surface);
}

.theme-switch button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0 0.45rem;
  justify-content: center;
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-switch button:hover {
  color: var(--color-ink);
}

.theme-switch button[aria-checked="true"] {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.theme-switch.with-labels button {
  padding: 0 0.9rem 0 0.7rem;
  height: 2.25rem;
}

/* ---- Contour field: depth contours behind a band, drawn in the accent at low strength. ---- */

.contour-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.contour-band::before,
.contour-band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.contour-band::before {
  background-color: var(--color-accent);
  opacity: 0.16;
  -webkit-mask: url(/images/contours.svg) center / cover no-repeat;
  mask: url(/images/contours.svg) center / cover no-repeat;
}

/* A soft bloom behind the device, and a fade so the lines never fight the copy. */
.contour-band::after {
  background:
    radial-gradient(60% 70% at 78% 45%, var(--color-glow), transparent 70%),
    linear-gradient(to right, var(--color-page) 0%, transparent 55%),
    linear-gradient(to top, var(--color-page) 0%, transparent 30%);
}

.hero-title {
  font-size: clamp(2.6rem, 1.5rem + 5.2vw, 5.25rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}

/* ---- Device frames. The screenshots carry their own bezel and a transparent surround. ---- */

.phone {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(var(--img-dim)) drop-shadow(0 28px 36px rgb(4 24 28 / 0.28)) drop-shadow(0 4px 8px rgb(4 24 28 / 0.18));
}

.hero-phone {
  width: auto;
  max-width: 100%;
  max-height: min(680px, 78vh);
  margin-inline: auto;
}

.mode-card {
  display: block;
  width: 100%;
  padding: 0;
  text-align: center;
  color: var(--color-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.mode-card:hover,
.mode-card[aria-pressed="true"] {
  color: var(--color-ink);
}

.mode-card[aria-pressed="true"] {
  transform: translateY(-8px);
}

.mode-card-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
}

.mode-card[aria-pressed="true"] .mode-card-label {
  border-bottom-color: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
  .mode-card {
    transition: none;
  }
}

/* ---- The closing band: the sail photograph under deep water. Always dark. ---- */

.closing-band {
  color: var(--color-on-deep);
  background:
    linear-gradient(to right, color-mix(in srgb, var(--color-deep) 94%, transparent) 0%, color-mix(in srgb, var(--color-deep) 62%, transparent) 100%),
    url(/images/bg_top.webp) center / cover no-repeat,
    var(--color-deep);
}

/* ---- Store badges. Both are SVGs with preserveAspectRatio="none", so one box size fits both:
   180x56 sits between the two badges' native aspect ratios (3.4:1 and 3.0:1), and neither is
   stretched by more than about 7%. Google's 60px minimum width for digital use is met. ---- */

.play_badge,
.app_store_badge {
  width: 180px;
  height: 56px;
}

.app_store_badge {
  opacity: 0.45;
  filter: grayscale(1) brightness(var(--img-dim));
  pointer-events: none;
}

/* Both badges on one line where they fit, stacked where they don't. */
.store_badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.store_badge_pending {
  display: inline-flex;
  flex-wrap: wrap; /* the note sits beside the badge where it fits, under it where it doesn't */
  align-items: center;
  gap: 4px 10px;
}

.store_badge_note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* ---- The manual's copy helpers. ---- */

.manual-body h2 {
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-rule);
}

.manual-body h4 {
  margin-top: 2rem;
}

.manual-body h5 {
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.5;
}

.note {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--color-accent);
  border-radius: 0 6px 6px 0;
  background: var(--color-raised);
  font-size: 0.9375rem;
  font-weight: 500;
}

.map_point {
  width: 16px;
  height: 16px;
}

.vessel_icon {
  height: 28px;
  width: auto;
  vertical-align: middle;
  margin: 0 4px;
}

.standard_margin {
  margin-top: 16px;
}

.standard_margin_bottom {
  margin-bottom: 16px;
}

.standard_margin_top_bottom {
  margin-top: 16px;
  margin-bottom: 16px;
}

.screenshot {
  width: 250px;
}
