/* Beaufort website. The page is a Beaufort scale: each section is the sky at a higher force. */

@font-face {
  font-family: "Barlow";
  src: url("fonts/Barlow-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/Barlow-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/BarlowCondensed-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #12303f;
  --paper: #ffffff;
  --windsock: #ff6a13;
  --f0: #cfe4ec;
  --f2: #a9d3e3;
  --f4: #4f9cc0;
  --f6: #24648f;
  --f8: #2b3a6b;
  --f10: #4a2a5e;
  --measure: 34rem;
  --gutter: clamp(16px, 5vw, 64px);
  /* Barlow for Latin text and every numeral; the system fills in Arabic and Japanese. */
  --text: "Barlow", system-ui, sans-serif;
  --display: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--f0);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--text);
  font-variant-numeric: tabular-nums;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 3px solid var(--windsock); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-weight: 600; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 1rem; }
p { margin: 0 0 1rem; max-width: var(--measure); }

.numerals { font-family: var(--display); font-weight: 600; letter-spacing: 0; }

/* ---------- top bar ---------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 18px var(--gutter);
  background: var(--f0);
  color: var(--ink);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 1.6rem/1 "Barlow Condensed", sans-serif;
  text-decoration: none;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.bar nav { display: flex; align-items: center; gap: 1.25rem; font-size: 1rem; }
.bar nav a { text-decoration: none; }
.bar nav a:hover { text-decoration: underline; }

/* The language picker: the language names in their own scripts, on a quiet pill. */
.lang { position: relative; display: inline-flex; align-items: center; }
.lang select {
  appearance: none;
  -webkit-appearance: none;
  font: 600 .95rem/1 var(--text);
  color: var(--ink);
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(18, 48, 63, .25);
  border-radius: 999px;
  padding-block: .45rem;
  padding-inline: .85rem 1.9rem;
  cursor: pointer;
}
.lang::after {
  content: "";
  position: absolute;
  inset-inline-end: .8rem;
  top: 50%;
  width: .4rem;
  height: .4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* ---------- force sections ---------- */

.force {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0 2rem;
  padding: clamp(56px, 9vw, 120px) var(--gutter);
}
.force .mark { align-self: start; padding-top: .35rem; }
.force .mark b {
  display: block;
  font: 600 clamp(3.5rem, 7vw, 5.5rem)/.85 "Barlow Condensed", sans-serif;
}
.force .mark span { font-size: .95rem; opacity: .85; }

.f0 { background: var(--f0); color: var(--ink); }
.f2 { background: var(--f2); color: var(--ink); }
.f4 { background: var(--f4); color: var(--ink); }
.f6 { background: var(--f6); color: var(--paper); }
.f8 { background: var(--f8); color: var(--paper); }
.f10 { background: var(--f10); color: var(--paper); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
}

/* ---------- hero ---------- */

.hero { padding-top: clamp(24px, 4vw, 48px); }
.hero h1 {
  font: 600 clamp(2.6rem, 6.4vw, 5rem)/.98 var(--display);
  margin-bottom: 1.25rem;
  max-width: 14ch;
}
.hero .lede { font-size: 1.25rem; }
.reading {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  margin: 0 0 .25rem;
  font: 600 clamp(4.5rem, 12vw, 9rem)/.9 "Barlow Condensed", sans-serif;
}
.reading small { font-size: .3em; }
.reading-label { margin-bottom: 2rem; font-weight: 600; }

.stores { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.store {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.1rem;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
}
.store small { display: block; font-weight: 400; font-size: .8rem; opacity: .8; }

.phone {
  border-radius: 34px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(18, 48, 63, .45);
  max-width: 340px;
  justify-self: center;
  background: var(--paper);
}
.phone.pair { max-width: 300px; }
.tablet {
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .55);
}

.stage { display: grid; place-items: center; }

.pairs { display: flex; gap: clamp(16px, 3vw, 32px); justify-content: center; }
.pairs .phone:nth-child(2) { margin-top: 48px; }

.facts { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .9rem; max-width: var(--measure); }
.facts li { padding-inline-start: 1.4rem; position: relative; }
.facts li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .62em;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--windsock);
}

.meters { display: grid; gap: 1rem; margin-top: 1.5rem; max-width: 44rem; }
.meter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .25rem 1rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
}
.meter b { font-weight: 600; }
.meter .status { font-size: .95rem; white-space: nowrap; }
.meter .status.yes { color: #9be7a1; }
.meter p { grid-column: 1 / -1; margin: 0; font-size: 1rem; opacity: .85; }

footer {
  background: var(--f10);
  color: var(--paper);
  padding: 32px var(--gutter) 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  font-size: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .15);
}
footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* ---------- document pages (privacy, support) ---------- */

.doc { background: var(--paper); }
.doc main { padding: clamp(32px, 6vw, 72px) var(--gutter) 96px; }
.doc article { max-width: 40rem; }
.doc h1 { font: 600 clamp(2.4rem, 5vw, 3.4rem)/1 var(--display); margin-bottom: .5rem; }
.doc h2 { font-size: 1.5rem; margin: 2.5rem 0 .75rem; }
.doc .updated { opacity: .7; margin-bottom: 2rem; }
.doc li { margin-bottom: .5rem; max-width: var(--measure); }
.doc .bar { background: var(--f0); }
.doc .note { padding: .9rem 1.1rem; border-radius: 12px; background: var(--f0); max-width: var(--measure); }

/* ---------- other scripts ---------- */

h1, h2 { text-wrap: balance; }
/* Arabic and Japanese need more room between lines than condensed Latin headlines. */
:lang(ar) h1, :lang(ar) h2, :lang(ja) h1, :lang(ja) h2 { line-height: 1.3; }
:lang(ar) .hero h1, :lang(ja) .hero h1 { line-height: 1.25; max-width: 18em; font-size: clamp(2.2rem, 5vw, 3.8rem); }
:lang(ar) body { line-height: 1.75; }
:lang(ja) body { line-height: 1.8; }
:lang(ja) .hero h1 { max-width: 12em; }
/* Break Japanese headlines between phrases, not inside them. */
:lang(ja) h1, :lang(ja) h2 { word-break: auto-phrase; }
/* Italic is not used in Arabic or Japanese; the app's labels are set in bold instead. */
:lang(ar) i, :lang(ja) i { font-style: normal; font-weight: 600; }
/* The meter's model reads left to right in every language. */
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .force { grid-template-columns: minmax(0, 1fr); }
  .force .mark { display: flex; align-items: baseline; gap: .75rem; margin-bottom: 1.25rem; }
  .force .mark b { font-size: 3rem; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .pairs .phone { max-width: 46%; }
  .pairs .phone:nth-child(2) { margin-top: 24px; }
  .bar nav { gap: .9rem; }
  .bar nav .wide { display: none; }
}
@media (max-width: 420px) {
  .bar nav .mid { display: none; }
}
