/* Rain Drop website, from the RAIN DROP Figma file (Website page: Frame 1 = home, Frame 2 = sign-up). */
:root {
  --navy: #0a234a;        /* text */
  --blue: #0d89c3;        /* buttons, logo square, dashed borders */
  --sky: #17b9ff;         /* sign-up box border */
  --mint: #a7f1eb;        /* header */
  --sun: #f5f777;         /* button hover (the Figma's button hover, 59:168) */
  --white: #ffffff;
  --sans: "ABC Areal", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "ABC Areal Semi Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --page: 1340px;         /* Frame 1: content 86 px in from each side of 1512, three 420 px columns */
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--white);
  color: var(--navy);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }

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

/* Header: mint sky, sitting on the white cloud of the page (its edge drifts slowly) */
.site-header { position: relative; background: var(--mint); overflow: hidden; }
.header-inner {
  position: relative;
  z-index: 2;
  max-width: calc(var(--page) + 2 * var(--gutter) + 160px);
  margin: 0 auto;
  padding: 20px var(--gutter) 74px 24px;  /* 144 px in all; room between the logo and the tops of the back cloud */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: block; flex: 0 1 260px; min-width: 0; }
.brand-logo { width: 100%; max-width: 260px; height: auto; }

.cloud {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: calc(100% + 900px);
  height: 48px;
  background-repeat: repeat-x;
  background-size: 900px 48px;  /* the 1200 x 64 strips at 3/4 */
  will-change: transform;
}
.cloud--back { background-image: url("assets/cloud-back.svg"); bottom: 5px; animation: drift 140s linear infinite; }
.cloud--front { background-image: url("assets/cloud-front.svg"); animation: drift 90s linear infinite; }
@keyframes drift { to { transform: translateX(-900px); } }

.button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: var(--white);
  font-family: var(--sans);
  font-weight: 500;  /* ABC Areal Medium */
  font-size: 20px;
  line-height: 1;
  padding: 8px 20px 9px 21px;
  min-height: 37px;
  cursor: pointer;
  white-space: nowrap;
}
/* Hover: the yellow fades in and the text turns navy */
.button { transition: background-color 0.3s ease, color 0.3s ease; }
.button:hover, .button:focus-visible { background: var(--sun); color: var(--navy); }
.button:disabled { cursor: progress; opacity: 0.7; }
.button:focus-visible, .example-link:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* Page body */
.page { max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 76px var(--gutter) 80px; }  /* about Frame 1's gap below the wave, from the cloud tops */
/* Frame 1 (updated 13 Nov): 1.4 line spacing, 1.2 px tracking, a blank line between paragraphs, ~61 px to the button */
.intro p { font-size: 24px; line-height: 1.4; letter-spacing: 0.05em; margin: 0 0 1.4em; max-width: 1297px; }
.intro .button { margin-top: 28px; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin-top: 80px;      /* Frame 1: 80 px from the button to the boxes */
  align-items: stretch;  /* every dashed box as tall as the tallest, */
  grid-auto-rows: 1fr;    /* in every row */
}
.card { min-width: 0; display: flex; flex-direction: column; }
/* One line each, 22 px as designed; script.js shrinks all three together only when a column is too narrow */
.card-title { font-family: var(--mono); font-weight: 700; font-size: 22px; white-space: nowrap; margin: 0 0 8px; }
.card-box { flex: 1; border: 1px dashed var(--blue); padding: 12px 15px; }
/* Text in the dashed boxes: 18 px, below the 22 px titles and the 24 px intro */
.card-box--text p { font-size: 18px; letter-spacing: 0.05em; line-height: 1.4; margin: 0 0 1.4em; }
.card-box--text p:last-child { margin-bottom: 0; }

.card-box--postcode { padding: 12px 15px 16px; }  /* first line level with the other two boxes */
.postcode-form label { display: block; font-size: 18px; letter-spacing: 0.05em; line-height: 1.4; margin-bottom: 14px; }
.postcode-row { display: flex; gap: 10px; }
.postcode-row input {
  flex: 1; min-width: 0; width: 100%; height: 44px; padding: 0 12px;
  border: 2px dashed var(--blue); border-radius: 0; background: var(--white);
  font-family: var(--mono); font-size: 18px; color: var(--navy);
}
.button--small { font-size: 18px; min-height: 44px; }
.postcode-result { font-size: 18px; letter-spacing: 0.05em; line-height: 1.4; margin: 18px 0 0; }
.postcode-result strong { font-weight: 700; }
.postcode-gauge { font-size: 18px; letter-spacing: 0.05em; line-height: 1.4; margin: 12px 0 0; }
.postcode-note { font-size: 13px; line-height: 1.4; color: #4a5d7a; margin: 12px 0 0; }

.card-box--example { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.example-label { font-size: 18px; letter-spacing: 0.05em; color: #000; margin: 0; }
.example-link { display: block; width: 100%; max-width: 353px; }
.example-video { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid #e4eef4; background: #fff; }

/* Text boxes: a solid line instead of a box around them when typing */
input:focus { outline: none; border-style: solid; }

/* Sign-up box (Frame 2): a white card on the page, which fades to 70% white behind it */
.signup {
  border: 2px solid var(--sky);
  border-radius: 10px;
  padding: 0;
  width: min(412px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  color: #000;
}
.signup::backdrop { background: rgba(255, 255, 255, 0.7); }
.signup-form { position: relative; padding: 24px 48px 40px; display: flex; flex-direction: column; }
.signup-close {
  position: absolute; top: 8px; right: 12px;
  border: 0; background: none; font-size: 28px; line-height: 1; color: var(--navy); cursor: pointer; padding: 4px 8px;
}
.signup-close:focus { outline: none; }
.signup-close:hover, .signup-close:focus-visible { color: var(--blue); }
.field { display: flex; flex-direction: column; margin-bottom: 14px; }
.field label { font-family: var(--mono); font-size: 24px; line-height: 1.321; margin-bottom: 2px; }
.field input {
  height: 56px; width: 100%; padding: 0 12px;
  border: 2px dashed var(--blue); background: var(--white); border-radius: 0;
  font-family: var(--mono); font-size: 18px; color: var(--navy);
}
/* The address finder's suggestions: straight under the box, in the same dashed line */
.address-results { border: 2px dashed var(--blue); border-top: 0; background: var(--white); }
.address-list { list-style: none; margin: 0; padding: 4px 0; }
.address-list li { padding: 8px 12px; font-family: var(--mono); font-size: 16px; line-height: 1.35; cursor: pointer; }
.address-list li:hover, .address-list li[aria-selected="true"] { background: var(--mint); }
.address-credit { margin: 0; padding: 2px 12px 6px; font-size: 12px; color: #4a5d7a; }
.field-row { display: flex; gap: 30px; }
.field--lat { width: 129px; }
.field--lon { width: 144px; }
.or { font-family: var(--mono); font-size: 24px; margin: 0 0 6px; text-align: center; padding-right: 40px; }
.form-error { min-height: 1.3em; margin: 4px 0 8px; color: #b3261e; font-size: 16px; }
.form-error a { color: inherit; }
.button--enter {
  align-self: flex-start; width: 239px; max-width: 100%; min-height: 58px; font-weight: 400; font-size: 24px;
  letter-spacing: 0.1em; text-align: left; padding: 8px 21px; margin-left: -8px;
}
.signup-thanks { font-size: 20px; line-height: 1.35; margin: 0; color: var(--navy); }
.privacy { font-size: 14px; line-height: 1.4; color: #4a5d7a; margin: 14px 0 0; }

/* Footer: what we do on the left, the email on the right */
/* Sticky: always on screen at the bottom while scrolling; the page scrolls under it */
.site-footer { position: sticky; bottom: 0; z-index: 5; background: var(--white); border-top: 1px dashed var(--blue); }
.footer-inner {
  /* The header's container: the left edge in line with the logo, the right with the sign-up button */
  max-width: calc(var(--page) + 2 * var(--gutter) + 160px); margin: 0 auto; padding: 14px var(--gutter) 16px 24px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap;
}
.footer-summary { font-family: var(--mono); font-weight: 500; font-size: 16px; letter-spacing: 0.05em; margin: 0; }
.footer-email { font-size: 16px; letter-spacing: 0.05em; color: var(--blue); text-decoration: none; }
.footer-email:hover, .footer-email:focus-visible { text-decoration: underline; }

/* Tablet: two columns, then one */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .header-inner { padding: 14px 16px 62px; }
  .footer-inner { padding-left: 16px; padding-right: 16px; }
  .brand { flex-basis: 190px; }
  .page { padding-top: 40px; }
  .intro p { font-size: 20px; }
  .intro .button { margin-top: 12px; }
  .cards { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: 28px; margin-top: 56px; }
  .signup-form { padding: 24px 24px 32px; }
  .field-row { gap: 16px; }
  .field--lat, .field--lon { width: 50%; }
}
@media (max-width: 420px) {
  .footer-inner { flex-wrap: nowrap; padding: 10px 16px 12px; }
  .footer-summary, .footer-email { font-size: 13px; letter-spacing: 0.02em; }
  .brand { flex-basis: 160px; }
  .site-header .button { font-size: 16px; padding: 7px 12px; min-height: 32px; }
}

/* No drifting cloud or autoplaying video for people who ask their device for less motion */
@media (prefers-reduced-motion: reduce) {
  .cloud { animation: none; }
  .button { transition: none; }
}
