/* BSHSPM. The name in maritime signal flags, on a line across a pale sky. */

@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --sky: #EDF2F5;
  --sky-2: #DFE7EC;
  --navy: #14213D;
  --navy-2: #1F3160;
  --muted: #4A566B;
  --line: rgba(20, 33, 61, 0.16);
  --flag-red: #D62828;
  --flag-blue: #1D4E89;
  --flag-white: #FFFFFF;
  --rope: #7D8796;
  --on-navy: #F1F4F8;
  --on-navy-muted: #BCC7D8;
  --error: #A11D1D;
  --error-light: #FFC4C0;

  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sky);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, dl, dd, figure { margin: 0; }
h1, h2 { font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
a { color: inherit; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; top: 12px; left: 12px; z-index: 10; padding: 10px 14px; background: var(--navy); color: var(--on-navy); border-radius: 4px; transform: translateY(-160%); }
.skip:focus { transform: none; }
:focus-visible { outline: 3px solid var(--flag-blue); outline-offset: 3px; }

/* ---------- bar ---------- */
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }
.brand { font-weight: 800; font-size: 1.375rem; line-height: 1; letter-spacing: 0.08em; text-decoration: none; }
.bar-go { font-size: 1rem; font-weight: 600; text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* ---------- hero ---------- */
.hero { padding-bottom: clamp(64px, 10vh, 112px); }
.hero-in { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: clamp(8px, 3vh, 40px); }

/* the signal line */
.signal { width: min(100%, 880px); }
.flags { display: block; width: 100%; height: auto; overflow: visible; }
.line { fill: none; stroke: var(--rope); stroke-width: 2.4; stroke-linecap: round; }
.red { fill: var(--flag-red); }
.blue { fill: var(--flag-blue); }
.white { fill: var(--flag-white); }
.edge { fill: none; stroke: rgba(20, 33, 61, 0.22); stroke-width: 1; }
.saltire { stroke: var(--flag-white); stroke-width: 14; }
.letter { font-family: var(--sans); font-weight: 800; font-size: 20px; text-anchor: middle; fill: var(--navy); }
.caption { margin-top: 10px; font-size: 0.9375rem; color: var(--muted); }

/* One motion: the flags are run up onto the line one by one and sway to rest. */
.flag { transform-box: fill-box; transform-origin: 50% 0; }
.js .flag { opacity: 0; animation: hoist 1s cubic-bezier(.25, .8, .3, 1) both; }
.js g:nth-of-type(1) > .flag { animation-delay: 0.2s; }
.js g:nth-of-type(2) > .flag { animation-delay: 0.32s; }
.js g:nth-of-type(3) > .flag { animation-delay: 0.44s; }
.js g:nth-of-type(4) > .flag { animation-delay: 0.56s; }
.js g:nth-of-type(5) > .flag { animation-delay: 0.68s; }
.js g:nth-of-type(6) > .flag { animation-delay: 0.8s; }
@keyframes hoist {
  0% { opacity: 0; transform: translateY(-14px) rotate(-10deg); }
  25% { opacity: 1; }
  45% { transform: translateY(0) rotate(5deg); }
  70% { transform: rotate(-2deg); }
  100% { opacity: 1; transform: none; }
}

.hero h1 {
  margin-top: clamp(32px, 5vh, 52px);
  font-size: clamp(2.25rem, 1.3rem + 3vw, 3.75rem);
  line-height: 1.04;
  max-width: 14em;
}
.hero .lede { margin-top: 18px; max-width: 30rem; font-size: 1.25rem; line-height: 1.5; color: var(--muted); }
.hero .join { margin-top: 30px; width: min(100%, 32rem); }
.hero .done-line { justify-content: center; }

/* ---------- form ---------- */
.row { display: flex; gap: 8px; }
.field {
  flex: 1 1 auto; min-width: 0; height: 56px; padding: 0 16px;
  font: inherit; font-size: 1.0625rem; color: var(--navy);
  background: #FFFFFF; border: 2px solid #9AA6B8; border-radius: 4px;
}
.field::placeholder { color: #5F6B80; }
.field:focus-visible { border-color: var(--flag-blue); outline-offset: 2px; }
.field[aria-invalid="true"] { border-color: var(--error); }
.btn {
  flex: none; height: 56px; padding: 0 24px;
  font: inherit; font-size: 1.0625rem; font-weight: 700;
  color: var(--on-navy); background: var(--navy); border: 0; border-radius: 4px; cursor: pointer;
}
.btn:hover { background: var(--navy-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: progress; opacity: 0.8; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.fine { margin-top: 14px; font-size: 0.9375rem; color: var(--muted); }
.oops { margin-top: 10px; font-size: 0.9375rem; font-weight: 600; color: var(--error); }
.oops:empty { display: none; }
.nojs { display: none; margin-top: 8px; font-size: 0.9375rem; font-weight: 600; color: var(--error); }
html:not(.js) .nojs { display: block; }
.done-line { display: flex; align-items: center; gap: 10px; font-size: 1.125rem; }
.done-line b { font-weight: 700; }
.tick { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--navy); stroke-width: 1.8; }
.tick path { stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.again { padding: 0; font: inherit; color: inherit; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.when-joined { display: none; }
.is-joined .when-open { display: none; }
.is-joined .when-joined { display: inline; }

/* ---------- facts and questions ---------- */
.band { padding-block: clamp(72px, 11vw, 136px); }
#facts { background: var(--sky-2); }
.band h2 { font-size: clamp(1.875rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1.1; }
.cols { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 40rem); justify-content: space-between; gap: 40px; }

.facts { border-top: 2px solid var(--navy); }
.fact { display: grid; grid-template-columns: 8.5rem 1fr; gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.fact dt { color: var(--muted); }
.fact dd { font-weight: 600; }

.qs { border-top: 2px solid var(--navy); }
.q { border-bottom: 1px solid var(--line); }
.q summary { position: relative; padding: 20px 44px 20px 0; font-weight: 600; cursor: pointer; list-style: none; }
.q summary::-webkit-details-marker { display: none; }
.q summary::before, .q summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 16px; height: 2px; background: var(--navy); transition: transform 0.2s ease; }
.q summary::after { transform: rotate(90deg); }
.q[open] summary::after { transform: rotate(0deg); }
.q p { padding-bottom: 22px; max-width: 36rem; color: var(--muted); }

/* ---------- close ---------- */
.close { padding-block: clamp(80px, 12vw, 144px); background: var(--navy); color: var(--on-navy); }
.close h2 { color: var(--on-navy); font-size: clamp(1.875rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1.1; max-width: 18em; }
.close .lede { margin-top: 14px; color: var(--on-navy-muted); }
.close .join { margin-top: 32px; max-width: 32rem; }
.close .field { color: var(--on-navy); background: #1B2B4F; border-color: #5D6E92; }
.close .field::placeholder { color: #AEB9CC; }
.close .field:focus-visible { border-color: var(--on-navy); }
.close .btn { color: var(--navy); background: var(--flag-white); }
.close .btn:hover { background: var(--sky); }
.close .fine { color: var(--on-navy-muted); }
.close .oops, .close .nojs { color: var(--error-light); }
.close .tick { stroke: var(--on-navy); }
.close :focus-visible { outline-color: var(--on-navy); }

.foot { background: var(--navy); color: var(--on-navy-muted); font-size: 0.9375rem; }
.foot-in { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 32px; padding-block: 26px 34px; border-top: 1px solid rgba(241, 244, 248, 0.14); }
.foot .brand-name { font-weight: 800; letter-spacing: 0.08em; color: var(--on-navy); }
.foot a { text-underline-offset: 3px; }
.foot :focus-visible { outline-color: var(--on-navy); }

/* ---------- smaller screens ---------- */
@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 600px) {
  /* the line runs edge to edge, and the letters grow so they stay readable */
  .signal { width: calc(100% + 2 * clamp(20px, 5vw, 48px)); margin-inline: calc(-1 * clamp(20px, 5vw, 48px)); }
  .letter { font-size: 34px; transform: translateY(10px); }
  .flags { margin-bottom: 14px; }
  .caption { padding-inline: clamp(20px, 5vw, 48px); }
}
@media (max-width: 460px) {
  .row { flex-direction: column; }
  .btn { width: 100%; }
  .hero h1 { font-size: 2.25rem; }
  .hero .lede { font-size: 1.125rem; }
  .fact { grid-template-columns: 6.5rem 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .flag { animation: none; opacity: 1; }
  .q summary::before, .q summary::after { transition: none; }
  .btn:active { transform: none; }
}
