/* Epilogue: shared tokens and elements.
   Fonts are loaded in each page's <head> from Google Fonts. */

:root {
  /* Grounds, in the order the page plays them: quiet to loud to quiet */
  --slate: #1c2326;
  --slate-deep: #141a1c;
  --tide: #26363d;
  --amber: #efb13a;
  --amber-deep: #d99a22;
  --dusk: #2e2638;

  /* Ink */
  --fog: #dadfd8;
  --fog-dim: #9ca9a7;
  --fog-faint: rgba(218, 223, 216, 0.16);
  --ink: #1c2326;
  --ink-soft: #4a3f1e;

  --font-display: "Anybody", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Epilogue", "Helvetica Neue", Arial, sans-serif;

  /* Type scale (1.25 ratio) */
  --step--1: 0.85rem;
  --step-0: 1.0625rem;
  --step-1: 1.33rem;
  --step-2: 1.66rem;
  --step-3: clamp(2rem, 4vw, 2.6rem);
  --step-4: clamp(2.6rem, 7vw, 5.5rem);

  /* Space */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2.5rem;
  --s-5: 4rem;
  --s-6: clamp(5rem, 12vw, 10rem);

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--slate);
  color: var(--fog);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
p,
ol,
ul,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
}

::selection {
  background: var(--amber);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

html {
  scrollbar-color: var(--fog-dim) var(--slate-deep);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--slate-deep);
}

::-webkit-scrollbar-thumb {
  background: #3a474b;
  border-radius: 10px;
  border: 2px solid var(--slate-deep);
}

[hidden] {
  display: none !important;
}

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

/* ---------- Fields: a single rule underneath, like a flat line waiting for signal ---------- */

.field-label {
  display: block;
  font-size: var(--step--1);
  color: var(--fog-dim);
  margin-bottom: var(--s-1);
}

.field-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--fog-dim);
  transition: border-color 0.3s var(--ease-out);
}

.field-row:focus-within {
  border-bottom-color: var(--fog);
}

.field-row input {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding: 0.5rem 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--fog);
  font: inherit;
  font-size: var(--step-1);
  caret-color: var(--amber);
}

.field-row input::placeholder {
  color: var(--fog-dim);
  opacity: 1;
}

.field-row input:focus {
  outline: none;
}

.field-row input:-webkit-autofill {
  -webkit-text-fill-color: var(--fog);
  -webkit-box-shadow: 0 0 0 100px var(--slate) inset;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 3rem;
  padding: 0 0 0 1.25rem;
  background: none;
  border: 0;
  color: var(--fog);
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-variation-settings: "wdth" 110, "wght" 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s var(--ease-out);
}

.btn:hover {
  color: var(--amber);
}

.btn[disabled],
.btn[aria-busy="true"] {
  color: var(--fog-dim);
  cursor: progress;
}

.btn svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  transition: transform 0.35s var(--ease-out);
}

.btn:hover svg {
  transform: translateX(3px);
}

.form-status {
  min-height: 1.6em;
  margin-top: var(--s-1);
  font-size: var(--step--1);
  color: var(--fog-dim);
}

.form-status[data-tone="ok"] {
  color: var(--fog);
}

.form-status[data-tone="error"] {
  color: #ffb4a3;
}

/* Honeypot: off-screen for people, still there for bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Plain message pages (no-JavaScript form replies, 404) ---------- */

.message-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}

.message-page main {
  max-width: 34rem;
}

.message-page h1 {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 70, "wght" 300;
  font-size: var(--step-4);
  line-height: 1;
  margin-bottom: var(--s-3);
}

.message-page p + p {
  margin-top: var(--s-2);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
