/* ============================================================
   cover.css  -  The front door: the cover, the code page, privacy.

   A quiet broadsheet with Apple restraint. White, near-black ink,
   greys; red only for an error. The nameplate is Fraunces at one
   fixed optical size, set to fill its column; a thick-thin rule and
   a tracked dateline make the masthead. Every class is cv-.
   (Chosen from three designs by three judges, 2026-10-17.)
   ============================================================ */

.cv-body {
  --cv-ink: #1d1d1f;
  --cv-ink-2: #424245;
  --cv-ink-3: #6e6e73;
  --cv-line: #d2d2d7;
  --cv-field: #86868b;          /* Apple's own field border: reads as a field */
  --cv-paper: #ffffff;
  --cv-red: #d70015;
  --cv-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  margin: 0;
  background: var(--cv-paper);
  color: var(--cv-ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.cv-body *,
.cv-body *::before,
.cv-body *::after { box-sizing: border-box; }

/* Page frame, clear of the notch and the home indicator */
.cv-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
}
.cv-main {
  flex: 1;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  /* phones: high on the screen, so the field and button stay above the keyboard */
  padding-top: calc(env(safe-area-inset-top) + clamp(2.5rem, 13vh, 7rem));
}
.cv-page--step .cv-main { padding-top: calc(env(safe-area-inset-top) + clamp(1.5rem, 6vh, 3.5rem)); }

/* Masthead: the nameplate fills the column, then a double rule and the dateline */
.cv-masthead {
  container-type: inline-size;
  text-align: center;
  overflow: clip;               /* a fallback font before Fraunces loads never scrolls the page */
}
.cv-nameplate {
  margin: 0;
  padding-left: 0.02em;         /* optical centring: cancels the trailing negative tracking */
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-variation-settings: "opsz" 96;   /* one drawing at every width */
  font-size: 3.25rem;
  font-size: calc(100cqi / 6.1);
  line-height: 1;
  letter-spacing: -0.02em;
  word-spacing: 0.04em;
  white-space: nowrap;
  text-rendering: optimizeLegibility;
  color: var(--cv-ink);
}
.cv-nameplate a { color: inherit; text-decoration: none; }
.cv-rule {
  height: 5px;                  /* hairlines are deliberately px: a 2px and a 1px rule */
  margin-top: 1rem;
  margin-top: calc(100cqi * 0.04);
  border-top: 2px solid var(--cv-ink);
  border-bottom: 1px solid var(--cv-ink);
}
.cv-dateline {
  margin: 0;
  padding: 0.6875rem 0 0.625rem;
  border-bottom: 1px solid var(--cv-line);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cv-ink-3);
}

/* The one line under the masthead */
.cv-lede {
  margin: 1.5rem 0 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.4;
  letter-spacing: -0.005em;
  text-align: center;
  text-wrap: balance;
  color: var(--cv-ink-2);
}

/* The form */
.cv-form { margin: 2rem 0 0; }
.cv-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cv-float { position: relative; }
/* The label sits in the field and rises once there is something in it */
.cv-label {
  position: absolute;
  top: 0;
  left: 1rem;
  font-size: 1.0625rem;
  line-height: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--cv-ink-3);
  transform: translateY(1.125rem);
  transform-origin: left top;
  pointer-events: none;
  transition: transform 0.22s var(--cv-ease);
}
.cv-field:focus + .cv-label,
.cv-field.cv-filled + .cv-label,
.cv-field:-webkit-autofill + .cv-label { transform: translateY(0.5rem) scale(0.75); }
.cv-field:autofill + .cv-label { transform: translateY(0.5rem) scale(0.75); }
.cv-field {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 3.5rem;
  margin: 0;
  padding: 1.375rem 1rem 0.5rem;
  border: 1px solid var(--cv-field);
  border-radius: 0.75rem;
  background: var(--cv-paper);
  color: var(--cv-ink);
  font: inherit;
  font-size: 1.0625rem;
  line-height: 1.25rem;
  letter-spacing: -0.01em;
  transition: border-color 0.2s var(--cv-ease), box-shadow 0.2s var(--cv-ease);
}
/* Autofill keeps the field white instead of painting it yellow or blue */
.cv-field:-webkit-autofill,
.cv-field:-webkit-autofill:hover,
.cv-field:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--cv-ink);
  -webkit-box-shadow: 0 0 0 100px var(--cv-paper) inset;
  transition: background-color 600000s 0s, border-color 0.2s var(--cv-ease);
}
.cv-field:focus {
  outline: 2px solid transparent;   /* still visible in forced-colours mode */
  border-color: var(--cv-ink);
  box-shadow: 0 0 0 1px var(--cv-ink);
}
.cv-field[aria-invalid="true"] { border-color: var(--cv-red); }
.cv-field[aria-invalid="true"]:focus { box-shadow: 0 0 0 1px var(--cv-red); }
.cv-error {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--cv-red);
}
.cv-error svg { flex: none; width: 1rem; height: 1rem; margin-top: 0.05rem; }
.cv-error:empty { display: none; }
.cv-button {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  height: 3.5rem;
  margin: 0;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--cv-ink);
  color: #fff;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.16s var(--cv-ease), background-color 0.2s var(--cv-ease);
}
.cv-button:active { transform: scale(0.97); transition-duration: 0.08s; }
.cv-button:focus-visible { outline: 2px solid var(--cv-ink); outline-offset: 3px; }

/* The check-your-email step */
.cv-step { margin-top: 2rem; text-align: center; text-wrap: balance; }
.cv-headline {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 2.25rem;
  font-optical-sizing: auto;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--cv-ink);
}
.cv-text {
  margin: 0.625rem 0 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--cv-ink-2);
}
.cv-address { color: var(--cv-ink); font-weight: 600; overflow-wrap: anywhere; }
.cv-step .cv-form { margin-top: 1.75rem; text-align: left; }
.cv-field--code {
  font-size: 1.375rem;
  letter-spacing: 0.24em;
  font-variant-numeric: tabular-nums;
}
.cv-aside { margin: 0.75rem 0 0; text-align: center; }
.cv-quiet {
  display: inline-block;
  padding: 0.875rem 0.75rem;    /* a 44px target */
  font-size: 0.9375rem;
  color: var(--cv-ink-3);
  text-decoration: underline;
  text-decoration-color: var(--cv-line);
  text-underline-offset: 0.25em;
  transition: color 0.2s var(--cv-ease), text-decoration-color 0.2s var(--cv-ease);
}

/* Reading pages (privacy) in the same frame */
.cv-prose { margin-top: 2rem; }
.cv-prose .cv-headline { text-align: center; }
.cv-prose p {
  margin: 1rem 0 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--cv-ink-2);
}
.cv-prose .cv-headline + p { margin-top: 1.5rem; }

/* Footer */
.cv-footer {
  padding: 2rem 0 calc(env(safe-area-inset-bottom) + 0.5rem);
  text-align: center;
}
.cv-link {
  display: inline-block;
  padding: 0.875rem 0.75rem;    /* a 44px target */
  font-size: 0.8125rem;
  color: var(--cv-ink-3);
  text-decoration: none;
  transition: color 0.2s var(--cv-ease);
}
.cv-quiet:focus-visible,
.cv-link:focus-visible,
.cv-nameplate a:focus-visible { outline: 2px solid var(--cv-ink); outline-offset: 2px; border-radius: 0.375rem; }

/* Hover only where there is a pointer that hovers */
@media (hover: hover) and (pointer: fine) {
  .cv-field:hover:not(:focus):not([aria-invalid="true"]) { border-color: var(--cv-ink-3); }
  .cv-button:hover { background: #000; }
  .cv-quiet:hover { color: var(--cv-ink); text-decoration-color: currentColor; }
  .cv-link:hover { color: var(--cv-ink); }
}

/* Wider screens: field and button share a line, the masthead grows, and the
   whole block sits at the optical centre of the page */
@media (min-width: 40rem) {
  .cv-row { flex-direction: row; align-items: flex-start; }
  .cv-cell { flex: 1; min-width: 0; }
  .cv-lede { font-size: 1.375rem; margin-top: 1.75rem; }
  .cv-form { margin-top: 2.75rem; }
  .cv-headline { font-size: 2.75rem; }
  .cv-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 3rem;
    padding-bottom: 9vh;
  }
  .cv-page--step .cv-main { padding-top: 3rem; }
}
@media (min-width: 64rem) {
  .cv-main { max-width: 44rem; }
}

/* Short screens (a phone on its side): pull everything up so the field shows */
@media (max-height: 32rem) {
  .cv-main,
  .cv-page--step .cv-main {
    max-width: 30rem;
    justify-content: flex-start;
    padding-top: calc(env(safe-area-inset-top) + 1.5rem);
    padding-bottom: 0;
  }
  .cv-lede { margin-top: 1rem; }
  .cv-form { margin-top: 1.5rem; }
  .cv-step { margin-top: 1.5rem; }
}

/* Entrance: the rule is drawn from the centre, the page settles in */
@media (prefers-reduced-motion: no-preference) {
  .cv-page--enter .cv-nameplate,
  .cv-page--enter .cv-dateline,
  .cv-page--enter .cv-lede,
  .cv-page--enter .cv-form { animation: cv-rise 0.7s var(--cv-ease) both; }
  .cv-page--enter .cv-rule { animation: cv-draw 0.8s var(--cv-ease) both; }
  .cv-page--enter .cv-dateline { animation-delay: 0.12s; }
  .cv-page--enter .cv-lede { animation-delay: 0.2s; }
  .cv-page--enter .cv-form { animation-delay: 0.28s; }
  .cv-page--step .cv-step,
  .cv-page--step .cv-prose { animation: cv-rise 0.5s var(--cv-ease) both; }
}
@keyframes cv-rise { from { opacity: 0; transform: translateY(0.5rem); } }
@keyframes cv-draw { from { transform: scaleX(0); } }

/* Reduced motion: feedback stays, movement goes */
@media (prefers-reduced-motion: reduce) {
  .cv-label,
  .cv-field,
  .cv-button,
  .cv-quiet,
  .cv-link { transition: none; }
  .cv-button:active { transform: none; opacity: 0.8; }
}

/* More contrast when asked for */
@media (prefers-contrast: more) {
  .cv-body { --cv-ink-3: #424245; --cv-line: #6e6e73; --cv-field: #1d1d1f; }
}
