/* REDXCTED — landing page (approved A1 Aperture identity, Pass 0.7 refinements)
   Brand colours live here only; everything below reads these tokens. */
:root {
  /* Brand palette (approved) */
  --color-bg: #101014;            /* charcoal — primary background */
  --color-accent: #d95a32;        /* Vivid Vermilion — 4.9:1 on bg, so safe for links, focus and marks */
  --color-text: #f1ece7;          /* warm ivory — primary text */
  --color-text-muted: #a6a0a0;    /* secondary text */
  --color-rule: rgba(241, 236, 231, 0.08);

  /* Wordmark: 657.21 x 115.57 viewBox of the A1 SVG, padded 6 units each side */
  --wordmark-w: 10.25rem;

  /* Type */
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, Cambria, "Times New Roman", serif;

  /* Space */
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p, h1 { margin: 0; }

::selection {
  background: var(--color-accent);
  color: var(--color-bg);
}

/* Letterboxed frame: header / centred hero / footer */
.frame {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.masthead {
  padding: clamp(1.5rem, 4vw, 2.75rem) 0;
  border-bottom: 1px solid var(--color-rule);
}

.wordmark { line-height: 0; }

/* The A1 SVG carries 6 units of padding (0.913% of its width) that is pulled back so the R sits flush with the page edge. */
.wordmark__img {
  display: block;
  width: var(--wordmark-w);
  height: auto;
  margin-left: calc(var(--wordmark-w) * -0.00913);
}

.hero {
  align-self: center;
  max-width: 46rem;
  padding: clamp(4rem, 12vh, 8rem) 0;
}

/* Redaction bar — the single accent mark */
.hero__bar {
  display: block;
  width: 3.5rem;
  height: 0.375rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
  background: var(--color-accent);
}

.hero__headline {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 1.4rem + 4.2vw, 4.75rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--color-text);
  text-wrap: balance;
}

.hero__lede {
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
  max-width: 36rem;
  font-size: clamp(1.1875rem, 1.07rem + 0.4vw, 1.375rem);
  line-height: 1.65;
  color: var(--color-text-muted);
  text-wrap: pretty;
}

/* A status line, not a control: no fill, border or padding, just an indicator light and a label. */
.status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: clamp(2.25rem, 5vw, 3.25rem);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text);
}

.status__mark {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-accent);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.75rem 0 clamp(1.75rem, 4vw, 2.5rem);
  border-top: 1px solid var(--color-rule);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.link {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

.link:hover { color: var(--color-text); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

@media (max-width: 30rem) {
  :root { --wordmark-w: 8rem; }
  .footer { flex-direction: column; }
}

@media (forced-colors: active) {
  /* The logo is light-on-dark artwork; keep its own dark ground so it stays visible on any forced canvas. */
  .wordmark__img {
    forced-color-adjust: none;
    background: var(--color-bg);
    padding: 0.5rem 0.75rem;
    margin-left: 0;
  }
  .hero__bar,
  .status__mark { background: CanvasText; }
}

/* ---- Contact (Pass 0.8): button under the status line, and modal dialog. Same palette and square, restrained style as the page. ---- */
:root { color-scheme: dark; }

.hero__contact {
  display: inline-block;
  margin-top: clamp(1.5rem, 3vw, 2rem);
  min-height: 2.75rem;
  padding: 0.7rem 1.5rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text);
  background: transparent;
  border: 1px solid rgba(241, 236, 231, 0.5);
  border-radius: 0;
  cursor: pointer;
}

.hero__contact[hidden] { display: none; }   /* stays hidden until contact.js confirms <dialog> support */

.hero__contact:hover { color: var(--color-bg); background: var(--color-text); border-color: var(--color-text); }

.contact {
  width: min(32rem, calc(100% - 2 * var(--gutter)));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid rgba(241, 236, 231, 0.22);
}

.contact::backdrop { background: rgba(0, 0, 0, 0.74); }

html:has(dialog.contact[open]) { overflow: hidden; }

.contact__panel { padding: clamp(1.25rem, 4vw, 2rem); }

.contact__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* Approved A1 wordmark, unmodified; the SVG's built-in 6-unit padding is pulled back so it sits flush with the panel text. */
.contact__logo {
  display: block;
  width: 7rem;
  height: auto;
  margin-left: calc(7rem * -0.00913);
}

.contact__title { margin-bottom: 0.5rem; }

.contact__title,
.contact__done-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.625rem, 1.3rem + 1vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.contact__title:focus,
.contact__done:focus { outline: none; }          /* focus is moved here programmatically so screen readers announce it */

.contact__close {
  padding: 0.25rem 0;
  font: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

.contact__close:hover { color: var(--color-text); }

.contact__intro {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.contact__done-title { margin-bottom: 0.75rem; }

.field { margin-bottom: 1.125rem; }

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.field__opt { color: var(--color-text-muted); }

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.8rem;
  font: inherit;
  font-size: 1rem;              /* 16px: stops iOS zooming into the field */
  line-height: 1.4;
  color: var(--color-text);
  background: rgba(241, 236, 231, 0.05);
  border: 1px solid rgba(241, 236, 231, 0.5);
  border-radius: 0;
}

.field textarea { min-height: 7.5rem; resize: vertical; }
.field select option { color: var(--color-text); background: var(--color-bg); }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.contact__submit:focus-visible,
.contact__close:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { border-color: var(--color-text); }

.field [aria-invalid="true"] { border-color: var(--color-accent); box-shadow: inset 3px 0 0 var(--color-accent); }

.field__error {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--color-accent);
}

/* Honeypot: off-screen rather than display:none, so simple bots still fill it; hidden from people and assistive tech. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.contact__privacy {
  margin: 0.25rem 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.contact__error {
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--color-accent);
  border-left: 3px solid var(--color-accent);
}

.contact__submit {
  min-height: 2.75rem;
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-bg);
  background: var(--color-accent);
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.contact__submit:hover { background: var(--color-text); }
.contact__submit[aria-disabled="true"] { opacity: 0.65; cursor: progress; }
.contact__submit[aria-disabled="true"]:hover { background: var(--color-accent); }

.contact__status {
  min-height: 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Short screens (small phones, landscape): keep more of the form in view. */
@media (max-height: 720px) {
  .contact__panel { padding-block: 1.25rem; }
  .contact__head { margin-bottom: 0.9rem; }
  .contact__intro { margin-bottom: 1rem; }
  .field { margin-bottom: 0.9rem; }
  .field textarea { height: 5.5rem; min-height: 5.5rem; }
  .contact__privacy { margin-bottom: 1rem; }
}

@media (forced-colors: active) {
  .contact__submit { border: 1px solid ButtonText; }
  .field [aria-invalid="true"] { border-color: Mark; }
  .contact__error { border-left-color: CanvasText; }
}
