/* Home page. Colours and fonts come from shared/tokens.css. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--soon); outline-offset: 2px; }
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }

.top, main > section, .foot { padding-left: max(20px, calc((100vw - 1160px) / 2)); padding-right: max(20px, calc((100vw - 1160px) / 2)); }

/* ---------- header ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 6px;
}
.brand { font-size: 18px; font-weight: 800; }
.top nav { margin-left: auto; display: flex; gap: 22px; font-size: 14px; font-weight: 600; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 64px;
  align-items: center;
  padding-top: 36px;
  padding-bottom: 48px;
}
.tag {
  display: inline-block;
  margin-bottom: 16px;
  padding: 2px 6px 0;
  border: 1px solid var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
h1 { font-size: clamp(34px, 4.6vw, 56px); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
.lead { font-size: 18px; line-height: 1.5; margin-top: 18px; max-width: 62ch; }
.lead b { font-weight: 800; }
.cta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; max-width: 660px; }
.btn {
  display: block;
  padding: 16px 18px 13px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  text-decoration: none;
}
.btn b { display: block; font-size: 18px; font-weight: 800; }
.btn span { display: block; font-size: 13px; line-height: 1.35; margin-top: 2px; color: var(--ink-2); }
.btn.primary { background: var(--ink); color: var(--ground); }
.btn.primary span { color: inherit; opacity: 0.75; }
.btn:hover b { text-decoration: underline; }

/* the space line names the EU programmes above the fold */
.eu { font-size: 14px; line-height: 1.45; color: var(--ink-2); margin-top: 12px; max-width: 660px; }

/* before the breach: one value line, the map key of the app, two links */
.before {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin-top: 14px;
  max-width: 660px;
  padding: 10px 14px 9px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 15px;
}
.before .val { flex: 1 1 100%; }
.before .val b { font-weight: 800; }
.before .key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--ink-2); }
.before .key > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.before .ln { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--road-later); }
.before .ln.never { border-color: var(--road-never); }
.before .go { display: flex; gap: 18px; margin-left: auto; font-size: 14px; font-weight: 700; }

.phone { justify-self: end; }
.screen {
  width: 300px;
  height: 642px; /* 860 px of the app, scaled: the frame ends just under its offline status line */
  border: 8px solid var(--ink);
  border-radius: 30px;
  overflow: hidden;
  background: var(--ground);
}
.screen iframe { width: 390px; height: 860px; border: 0; transform: scale(0.7282); transform-origin: 0 0; display: block; }
figcaption { font-size: 12px; color: var(--ink-2); margin-top: 10px; text-align: center; max-width: 300px; }

/* ---------- hindcast story and EU space strip ---------- */
.story { border-top: 1px solid var(--rule); padding-top: 18px; padding-bottom: 18px; }
.story p { font-size: 18px; font-weight: 700; line-height: 1.4; max-width: 70ch; }
.story p.more { font-size: 16px; font-weight: 400; color: var(--ink-2); margin-top: 4px; }
.story p.more b { color: var(--ink); font-weight: 800; }

.space { border-top: 1px solid var(--rule); padding-top: 20px; padding-bottom: 28px; }
.space h2 { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 12px; color: var(--ink-2); }
.space-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px; }
.space-items a { display: block; border-top: 2px solid var(--ink); padding: 10px 0 4px; text-decoration: none; }
.space-items a:hover b { text-decoration: underline; }
.space-items b { display: block; font-size: 16px; font-weight: 800; }
.space-items span { display: block; font-size: 14px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
.space-items span.do { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.space-items span.do::after { content: " →"; }

/* ---------- sections ---------- */
.band { border-top: 1px solid var(--rule); padding-top: 44px; padding-bottom: 52px; }
h2 { font-size: 28px; font-weight: 800; line-height: 1.15; margin-bottom: 24px; }
h3 { font-size: 17px; font-weight: 800; line-height: 1.25; }

.steps { list-style: none; counter-reset: n; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; }
.steps li { counter-increment: n; border-top: 2px solid var(--ink); padding-top: 12px; }
.steps li::before { content: counter(n); display: block; font-size: 44px; font-weight: 800; line-height: 1; margin-bottom: 8px; }
.steps p { margin-top: 6px; font-size: 15px; color: var(--ink-2); }

.who { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; }
.who > div { border-top: 2px solid var(--ink); padding-top: 12px; }
.who p { margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.who .cmp { margin-top: 10px; }
.who .cmp.new { color: var(--ink); }
.who .k { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.who .cmp.new .k { color: var(--ink); }
.delivery { margin-top: 24px; font-size: 15px; font-weight: 700; max-width: 70ch; }

.try { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; border-top: 2px solid var(--ink); }
.try a {
  display: block;
  padding: 14px 28px 12px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  position: relative;
}
.try a::after { content: "→"; position: absolute; right: 2px; top: 13px; font-weight: 800; }
.try a:hover b { text-decoration: underline; }
.try b { display: block; font-size: 16px; font-weight: 800; }
.try span { display: block; font-size: 14px; color: var(--ink-2); line-height: 1.4; }

.sub { font-size: 16px; color: var(--ink-2); max-width: 70ch; margin: -12px 0 22px; }
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 28px; }
.cases .case { border-top: 2px solid var(--ink); padding: 12px 0 18px; display: flex; flex-direction: column; }
.cases .kind { width: 28px; height: 8px; margin-bottom: 10px; background: var(--act); }
.cases .k-last { background: var(--act); }
.cases .k-leave { background: var(--soon); }
.cases .k-nowhere, .cases .k-refuge { background: var(--ink); }
.cases .k-dry { background: transparent; box-shadow: inset 0 0 0 2px var(--soon-ink); }
.cases .k-safe { background: var(--way); }
.cases b { font-size: 17px; font-weight: 800; line-height: 1.25; }
.cases .where { font-size: 14px; margin-top: 2px; }
.cases p { font-size: 14px; color: var(--ink-2); line-height: 1.4; margin-top: 6px; flex: 1; }
.cases .go { display: flex; gap: 18px; margin-top: 10px; font-size: 14px; font-weight: 700; }

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  padding-bottom: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  font-size: 12px;
  color: var(--ink-2);
}
.foot span:first-child { color: var(--ink); font-weight: 700; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 32px; padding-bottom: 40px; }
  /* the live preview sits below the buttons, smaller; a tap on it does not trap the page scroll */
  .phone { justify-self: center; }
  .screen { width: 240px; height: 510px; border-radius: 26px; }
  .screen iframe { transform: scale(0.5744); pointer-events: none; }
  figcaption { max-width: 240px; margin-left: auto; margin-right: auto; }
  .steps, .who { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .space-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
  .try { grid-template-columns: minmax(0, 1fr); }
  .top nav a:not(:last-child) { display: none; }
}
@media (max-width: 560px) {
  .cta { grid-template-columns: minmax(0, 1fr); }
  /* on a phone the resident app comes first and gets the filled style */
  .cta #open-citizen { order: -1; background: var(--ink); color: var(--ground); }
  .cta #open-citizen span { color: inherit; opacity: 0.75; }
  .cta #open-console { background: transparent; color: var(--ink); }
  .cta #open-console span { color: var(--ink-2); opacity: 1; }
  .space-items { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
