:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --ink: #101215;
  --muted: #6b7078;
  --line: rgba(16, 18, 21, 0.1);
  --surface: #ffffff;
  --accent: #0a84ff;
  --shadow: 0 24px 60px rgba(16, 18, 21, 0.08);
  --serif: "New York", ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
p,
figure {
  margin: 0;
}

img {
  max-width: 100%;
}

/* Hero */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: clamp(32px, 7vw, 110px);
  align-items: center;
  justify-content: center;
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
  padding: 120px 0 72px;
  position: relative;
}

.nav {
  position: absolute;
  inset: 28px 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  font-weight: 650;
}

.brand img,
.footer-brand img {
  border-radius: 9px;
  box-shadow: 0 0 0 1px var(--line);
}

.nav-link {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 560;
}

.nav-link:hover {
  color: var(--ink);
}

.store-badge-link,
.badge-button {
  display: inline-flex;
  width: 120px;
  height: 40px;
}

.store-badge-link img,
.badge-button img {
  display: block;
  width: 120px;
  height: 40px;
}

.eyebrow,
.section-kicker {
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 8vw, 6rem);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lede {
  margin-top: 22px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}

.intro {
  max-width: 460px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}

.secondary-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--surface);
}

.secondary-button:hover {
  border-color: rgba(16, 18, 21, 0.24);
}

.hero-video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 886 / 1920;
  border-radius: 36px;
  background: var(--ink);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

a:focus-visible,
video:focus-visible {
  outline: 2px solid rgba(10, 132, 255, 0.5);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Sections */
main {
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
}

.section-head {
  margin-bottom: 36px;
}

h2 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.points {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 56px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.points h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.points p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.screens {
  padding: 56px 0 40px;
}

.screen-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.screen-row figure {
  overflow: hidden;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

.screen-row img {
  display: block;
  width: 100%;
  height: auto;
}

.more-apps {
  padding: 72px 0 96px;
}

.more-app-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.more-app-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow 160ms ease;
}

.more-app-card:hover {
  box-shadow: 0 0 0 1px rgba(16, 18, 21, 0.22);
}

.more-app-card img {
  border-radius: 12px;
  flex: none;
}

.more-app-card span {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.more-app-card strong {
  color: var(--ink);
  font-size: 1rem;
}

.footer {
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
  padding: 28px 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: 22px;
}

.footer-links a:hover {
  color: var(--ink);
}

/* Responsive */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 112px;
  }

  .hero-video {
    width: min(100%, 300px);
  }

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

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

@media (max-width: 560px) {
  .nav .nav-link[href="#screens"],
  .nav .nav-link[href="index.html#screens"],
  .nav .store-badge-link {
    display: none;
  }

  .points,
  .more-app-list {
    grid-template-columns: 1fr;
  }

  .screen-row {
    display: flex;
    gap: 14px;
    margin: 0 -20px;
    padding: 0 20px 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .screen-row figure {
    flex: 0 0 78%;
    scroll-snap-align: center;
  }
}

/* Packs carousel */
.packs {
  padding: 96px 0 40px;
}

.packs-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.carousel-buttons {
  display: flex;
  gap: 8px;
}

.carousel-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.carousel-button:hover:not(:disabled) {
  border-color: rgba(16, 18, 21, 0.24);
}

.carousel-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.pack-track {
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 0 0 12px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.pack-track::-webkit-scrollbar {
  display: none;
}

.pack-card {
  flex: 0 0 min(260px, 72%);
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  scroll-snap-align: start;
}

.pack-type {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pack-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.15;
  font-weight: 600;
}

.pack-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Policy and support pages */
.page-hero {
  position: relative;
  width: min(100% - 40px, 760px);
  margin: 0 auto;
  padding: 140px 0 40px;
}

.page-copy h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
}

.page-copy .eyebrow {
  color: var(--muted);
}

.policy-main,
.support-main {
  width: min(100% - 40px, 760px);
  margin: 0 auto;
  padding-bottom: 80px;
}

.policy-main section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.policy-main h2 {
  margin-bottom: 14px;
  font-size: 1.5rem;
}

.policy-main h3 {
  margin: 22px 0 8px;
  font-size: 1rem;
  font-weight: 650;
}

.policy-main p,
.policy-main li {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.policy-main p + p {
  margin-top: 12px;
}

.policy-main ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.policy-main a {
  color: var(--accent);
}

.support-form {
  display: grid;
  gap: 20px;
  max-width: 560px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  font-size: 0.88rem;
  font-weight: 600;
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.field-group input:focus,
.field-group textarea:focus {
  outline: 2px solid rgba(10, 132, 255, 0.35);
  border-color: transparent;
}

.support-submit {
  width: fit-content;
  min-height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.support-submit:hover {
  opacity: 0.88;
}

@media (max-width: 560px) {
  .nav {
    gap: 14px;
  }

  .pack-card {
    flex-basis: 78%;
  }
}

/* ===== Flags! – bold layer ===== */
.flags-page {
  --navy: #06183c;
  --navy-2: #0a3478;
  --red: #d0141c;
  --yellow: #ffc20e;
  --blue: #0b4fc4;
  --accent: #0b4fc4;
  --display: Impact, "Haettenschweiler", "Arial Narrow Bold", "Avenir Next Condensed", sans-serif;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
}

.flags-page main {
  width: 100%;
}

/* Hero: navy with signal-flag stripes */
.hero-wrap {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.035) 0 28px, transparent 28px 56px),
    radial-gradient(900px 600px at 80% 40%, var(--navy-2), transparent 70%),
    var(--navy);
}

.hero-wrap::before {
  content: "";
  position: absolute;
  inset: 0 -6% 0 auto;
  width: 30%;
  background: linear-gradient(90deg, var(--red) 0 33%, var(--yellow) 33% 66%, var(--blue) 66%);
  transform: skewX(-14deg);
  opacity: 0.55;
  pointer-events: none;
}

.hero-wrap .hero {
  position: relative;
}

.hero-wrap .brand,
.hero-wrap .nav-link:hover {
  color: #fff;
}

.hero-wrap .nav-link {
  color: rgba(255, 255, 255, 0.75);
}

.hero-wrap .brand img {
  box-shadow: none;
}

.hero-wrap .eyebrow {
  color: var(--yellow);
}

.hero-wrap h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4rem, 12vw, 8.2rem);
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.hero-wrap h1 span {
  color: var(--yellow);
}

.hero-wrap .lede {
  color: #fff;
  font-family: inherit;
  font-weight: 650;
}

.hero-wrap .intro {
  color: rgba(255, 255, 255, 0.78);
}

.hero-wrap .secondary-button {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
}

.hero-wrap .secondary-button:hover {
  border-color: #fff;
}

.hero-wrap .hero-video video {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.hero-wrap a:focus-visible,
.hero-wrap video:focus-visible {
  outline-color: var(--yellow);
}

/* Count blocks */
.counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.count {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: clamp(36px, 7vw, 72px) 16px;
  font-family: var(--display);
  text-transform: uppercase;
  text-align: center;
}

.count strong {
  font-weight: 400;
  font-size: clamp(4.5rem, 14vw, 9rem);
  line-height: 0.95;
}

.count span {
  font-size: clamp(0.9rem, 2.2vw, 1.5rem);
  letter-spacing: 0.04em;
}

.count-red { background: var(--red); color: #fff; }
.count-yellow { background: var(--yellow); color: var(--navy); }
.count-blue { background: var(--blue); color: #fff; }

/* Flag marquee */
.marquee {
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 28px;
  padding: 24px 14px;
  animation: marquee 60s linear infinite;
}

.marquee-track img {
  width: 72px;
  height: 72px;
  flex: none;
  object-fit: contain;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

.flags-page .points {
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
  border-top: 0;
}

.flags-page .points h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Spell it */
.spell {
  padding: clamp(56px, 9vw, 96px) 0;
  color: #fff;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.035) 0 28px, transparent 28px 56px),
    var(--navy);
}

.spell-inner {
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
}

.spell .section-kicker {
  color: var(--yellow);
}

.spell h2,
.flag-gallery h2,
.everything h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.spell-field input {
  width: 100%;
  max-width: 560px;
  padding: 16px 20px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spell-field input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  text-transform: none;
  letter-spacing: 0;
}

.spell-field input:focus {
  outline: none;
  border-color: var(--yellow);
}

.spell-out {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 10px;
  min-height: 150px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.spell-out li {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: clamp(64px, 11vw, 96px);
}

.spell-out li.gap {
  width: clamp(24px, 5vw, 44px);
}

.spell-out img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  animation: pop 320ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.spell-out li.num img {
  aspect-ratio: 3 / 2;
  align-self: center;
}

.spell-out span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.6) rotate(-8deg); }
}

.spell-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-top: 28px;
}

.spell-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.spell-button:disabled {
  opacity: 0.7;
  cursor: default;
}

.lamp {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(6, 24, 60, 0.3);
}

.lamp.on {
  background: #fff;
  box-shadow: 0 0 0 3px var(--navy), 0 0 18px 6px #fff;
}

.spell-note {
  max-width: 420px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Flag gallery */
.flag-gallery {
  padding: clamp(56px, 9vw, 96px) 0 40px;
}

.flag-gallery .section-kicker,
.everything .section-kicker {
  color: var(--red);
}

.flag-card {
  flex: 0 0 min(220px, 66%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  scroll-snap-align: start;
}

.flag-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  margin-bottom: 6px;
}

.flag-card .pack-type {
  color: var(--red);
}

.flag-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 650;
}

.flag-card .morse {
  margin-top: auto;
  color: var(--muted);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
}

/* Everything */
.everything {
  padding: clamp(40px, 7vw, 72px) 0;
  background: var(--yellow);
}

.everything .section-kicker {
  color: var(--navy);
}

.everything h2 {
  max-width: 14em;
  color: var(--navy);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}

.fineprint {
  margin-top: 24px;
  color: rgba(6, 24, 60, 0.7);
  font-size: 0.85rem;
}

.flags-page .more-apps {
  padding: 72px 0 96px;
}

@media (max-width: 860px) {
  .hero-wrap::before {
    width: 40%;
    opacity: 0.4;
  }

  .hero-wrap .hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }
}

@media (max-width: 560px) {
  .counts {
    grid-template-columns: 1fr;
  }

  .count {
    padding: 28px 16px;
  }

  .hero-wrap .nav-link[href$="#spell"],
  .hero-wrap .nav-link[href$="#flags"],
  .hero-wrap .studio-link,
  .hero-wrap .support-link,
  .hero-wrap .store-badge-link {
    display: none;
  }

  .hero-wrap .nav {
    inset: 20px 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
  }

  .spell-out img {
    animation: none;
  }
}

/* Support / privacy pages inherit the app palette */
.policy-page,
.support-page {
  --accent: #0b4fc4;
}
