/* ==========================================================================
   Peter Jevtic — website styles
   Source of truth: PJ_DESIGN_SYSTEM.md v1.0 (tokens, type scale, spacing, components)
   Plain CSS, mobile-first. Breakpoints: 640px, 1024px (+ 1440px type cap).
   ========================================================================== */

/* ---------- Fonts (self-hosted, Latin subset, variable) ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Metric-adjusted fallback so the swap from Arial to Inter shifts layout less */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.4%;
  ascent-override: 90.2%;
  descent-override: 22.5%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
  /* Brand (from the brief, do not change) */
  --color-bg: #F4F1EA;
  --color-text: #212121;
  --color-accent: #3267C8;

  /* Derived neutrals and states */
  --color-surface: #EBE7DD;
  --color-surface-raised: #FAF8F3;
  --color-surface-sunken: #E4E0D5;
  --color-text-secondary: #55524B;
  --color-text-muted: #6B685F;
  --color-text-quiet: #8A867D;
  --color-accent-hover: #2A57AD;
  --color-accent-active: #234A94;
  --color-accent-on-dark: #8CABEB;
  --color-border: #D9D4C7;
  --color-border-strong: #8A867D;
  --color-dark: #212121;
  --color-dark-text: #F4F1EA;
  --color-dark-text-secondary: #B8B4AA;
  --color-dark-muted: #9B978D;
  --color-dark-border: #3A3A3A;
  --color-dark-surface: #2E2E2E;
  --color-error: #B3261E;
  --color-error-bg: #F6E3E0;
  --color-success: #2F6B3F;

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --radius-chip: 6px;
  --radius-field: 12px;
  --radius-card: 20px;
  --radius-panel: 28px;
  --radius-pill: 999px;

  --container: 1240px;
  --margin: 20px;
  --section-gap: 64px;
  --head-gap: 32px;
  --nav-h: 56px;

  --dur-fast: 150ms;
  --dur-base: 200ms;
  --dur-menu: 250ms;
  --dur-reveal: 600ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 640px) {
  :root { --margin: 32px; --section-gap: 96px; --head-gap: 48px; }
}
@media (min-width: 1024px) {
  :root { --margin: 48px; --section-gap: 128px; --head-gap: 64px; --nav-h: 64px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 96px;
  interpolate-size: allow-keywords;
  background: var(--color-bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
@media (min-width: 640px) {
  body { font-size: 1.0625rem; line-height: 1.65; }
}
html.menu-open { overflow: hidden; }

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}
.on-dark :focus-visible { outline-color: var(--color-accent-on-dark); }

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

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; outline-offset: 3px; }

.container {
  width: min(var(--container), calc(100% - 2 * var(--margin)));
  margin-inline: auto;
}

/* ---------- Typography ---------- */
.display, .h2, .h1-prose, .wordmark, .mobile-menu-link {
  font-family: var(--font-serif);
  font-weight: 500;
  font-optical-sizing: auto;
  text-wrap: balance;
}

.display {
  font-size: 3rem;
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.h2 {
  font-size: 2.25rem;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.lead {
  font-size: 1.125rem;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--color-text-secondary);
}
.small {
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: 0.005em;
  color: var(--color-text-muted);
}
p { text-wrap: pretty; }

@media (min-width: 640px) {
  .display { font-size: 4.5rem; line-height: 1; letter-spacing: -0.035em; }
  .h2 { font-size: 3.25rem; line-height: 1.04; letter-spacing: -0.03em; }
  .h3 { font-size: 1.625rem; line-height: 1.2; }
  .h4 { font-size: 1.25rem; }
  .lead { font-size: 1.1875rem; }
}
@media (min-width: 1024px) {
  .display { font-size: clamp(5.5rem, 1.5rem + 6.25vw, 6.5rem); line-height: 0.98; }
  .h2 { font-size: clamp(3.25rem, 0.25rem + 4.69vw, 4rem); line-height: 1.02; }
  .h3 { font-size: 1.75rem; }
  .lead { font-size: 1.25rem; }
}

/* ---------- Shared components ---------- */

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-chip);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex: none;
}
.chip--dark { background: var(--color-dark-surface); color: var(--color-dark-text); }
.chip--dark::before { background: var(--color-accent-on-dark); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.btn--primary { background: var(--color-accent); color: var(--color-bg); }
.btn--primary:hover { background: var(--color-accent-hover); }
.btn--primary:active { background: var(--color-accent-active); transform: scale(0.98); }
.btn--primary[disabled] {
  background: var(--color-surface-sunken);
  color: var(--color-text-muted);
  cursor: not-allowed;
  transform: none;
}
.btn--sm { height: 44px; padding: 0 20px; font-size: 15px; }
.btn--secondary {
  background: var(--color-surface-raised);
  color: var(--color-text);
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
}
.btn--secondary:hover { background: var(--color-bg); }
.btn .arrow { width: 16px; height: 16px; transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }
.btn--primary[disabled] .arrow { transform: none; }

/* Text link */
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color var(--dur-base) var(--ease-out), text-decoration-thickness var(--dur-base) var(--ease-out);
}
.link:hover { color: var(--color-accent); text-decoration-thickness: 2px; }
.link .arrow { width: 16px; height: 16px; flex: none; transition: transform var(--dur-base) var(--ease-out); }
.link:hover .arrow { transform: translateX(3px); }

/* Inline body link (blue, only where contrast allows) */
.link-inline {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-base) var(--ease-out);
}
.link-inline:hover { color: var(--color-accent-hover); }

/* Section scaffolding */
.section { padding-top: var(--section-gap); }
.section--end { padding-bottom: var(--section-gap); }

.section-head {
  display: grid;
  margin-bottom: var(--head-gap);
}
.section-head .chip { justify-self: start; margin-bottom: var(--space-4); }
.section-head .intro { margin-top: var(--space-4); max-width: 34rem; }
@media (min-width: 640px) {
  .section-head .chip { margin-bottom: var(--space-5); }
  .section-head .intro { margin-top: var(--space-5); }
}
@media (min-width: 1024px) {
  .section-head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
  }
  .section-head .chip { grid-column: 1 / -1; }
  .section-head .h2 { grid-column: 1 / 7; }
  .section-head .intro { grid-column: 8 / 13; margin-top: 0; align-self: end; }
}
@media (min-width: 1280px) {
  .section-head .h2 { grid-column: 1 / 8; }
  .section-head .intro { grid-column: 9 / 13; }
}
.section-head--center {
  justify-items: center;
  text-align: center;
}
.section-head--center .chip { justify-self: center; }
.section-head--center .intro { margin-inline: auto; }
@media (min-width: 1024px) {
  .section-head--center { display: grid; grid-template-columns: 1fr; }
  .section-head--center .chip,
  .section-head--center .h2,
  .section-head--center .intro { grid-column: 1; }
  .section-head--center .intro { margin-top: var(--space-5); align-self: auto; }
}

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky;
  top: 16px;
  z-index: 100;
  height: 0;
}
.nav-capsule {
  position: relative;
  z-index: 2;
  width: min(var(--container), calc(100% - 2 * var(--margin)));
  height: var(--nav-h);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 6px 6px 6px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}
.wordmark {
  justify-self: start;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:focus-visible { outline-offset: 6px; border-radius: 4px; }

.nav-links, .nav-cta { display: none; }

.menu-toggle { justify-self: end; }
.menu-toggle:focus-visible { outline-offset: 2px; }

@media (min-width: 1024px) {
  .nav-capsule {
    grid-template-columns: 1fr auto 1fr;
    padding: 10px 10px 10px 24px;
  }
  .wordmark { font-size: 26px; }
  .nav-links {
    display: flex;
    align-items: center;
    gap: 0;
    height: 44px;
    padding: 4px;
    background: var(--color-surface-raised);
    border-radius: var(--radius-pill);
  }
  .nav-link {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: var(--color-text);
    text-decoration: none;
    transition: background-color var(--dur-fast) var(--ease-out);
  }
  .nav-link:hover { background: color-mix(in srgb, var(--color-surface) 60%, transparent); }
  .nav-link[aria-current="location"] { background: var(--color-surface); }
  .nav-link:focus-visible { outline-offset: 2px; }
  .nav-cta { display: inline-flex; justify-self: end; }
  .menu-toggle { display: none; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1;
  padding: calc(16px + var(--nav-h) + 16px) var(--margin) var(--space-6);
  background: var(--color-bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transition: opacity var(--dur-menu) var(--ease-out);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu.is-open { opacity: 1; }
.mobile-menu-inner { width: min(var(--container), 100%); margin-inline: auto; }
.mobile-menu-link {
  display: flex;
  align-items: center;
  min-height: 72px;
  border-bottom: 1px solid var(--color-border);
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--color-text);
  text-decoration: none;
}
.mobile-menu-link:first-child { border-top: 1px solid var(--color-border); }
.mobile-menu .btn { width: 100%; margin-top: var(--space-6); }
@media (min-width: 640px) {
  .mobile-menu-link { font-size: 2.5rem; }
}
@media (min-width: 1024px) {
  .mobile-menu { display: none !important; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  padding-top: 112px;
  padding-bottom: var(--space-6);
}
.hero > .container { display: flex; flex-direction: column; }
.hero-main { margin-top: auto; max-width: 58rem; }
.hero .chip { margin-bottom: var(--space-4); }
.hero .display { margin-bottom: var(--space-5); }
.hero .lead { max-width: 34rem; margin-bottom: var(--space-6); }
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-4);
}
.hero-actions .link { align-self: flex-start; }
.hero-foot {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.exp-note {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-muted);
}
.exp-note::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex: none;
}
@media (min-width: 640px) {
  .hero { padding-top: 128px; }
  .hero .display { margin-bottom: var(--space-5); }
  .hero .lead { margin-bottom: var(--space-6); }
  .hero-actions { flex-direction: row; align-items: center; gap: var(--space-5); }
  .hero-actions .link { align-self: auto; }
}
@media (min-width: 1024px) {
  .hero { padding-top: 160px; padding-bottom: var(--space-7); }
  .hero .chip { margin-bottom: var(--space-5); }
  .hero .display { margin-bottom: var(--space-6); }
  .hero .lead { margin-bottom: 40px; }
}

/* ---------- Why work with me ---------- */
.why-list { border-bottom: 1px solid var(--color-border); }
.why-row {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--color-border);
}
.why-row p { color: var(--color-text-secondary); max-width: 62ch; }
@media (min-width: 640px) {
  .why-row { padding: var(--space-6) 0; }
}
@media (min-width: 1024px) {
  .why-row {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    align-items: baseline;
  }
  .why-row .h3 { grid-column: 1 / 5; }
  .why-row p { grid-column: 6 / 12; }
}

/* ---------- Selected work ---------- */
.projects { display: grid; gap: var(--space-7); }
.project-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-card);
  overflow: hidden;
}
.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  outline: 1px solid var(--color-border);
  outline-offset: -1px;
  border-radius: inherit;
}
.project-caption { padding-top: var(--space-4); }
.project-caption-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
.project-title { display: grid; gap: 4px; }
.project-category { font-size: 1rem; line-height: 1.4; color: var(--color-text-muted); }
.project-caption .chip { margin-top: 2px; }
.project-desc { margin-top: var(--space-3); }
.work-note {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.work-note p { max-width: 62ch; }
@media (min-width: 640px) {
  .project-caption { padding-top: var(--space-4); }
}
@media (min-width: 1024px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .project-caption { padding-top: var(--space-5); }
}

/* Image placeholders (replace with an <img>, see README) */
.placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--color-surface-sunken);
  border: 1px dashed var(--color-border-strong);
  border-radius: inherit;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

/* ---------- Services ---------- */
.services {
  display: grid;
  background: var(--color-surface);
  border-radius: var(--radius-card);
}
.service {
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
}
.service + .service { border-top: 1px solid var(--color-border); }
.service p { margin-top: var(--space-3); color: var(--color-text-secondary); }
.service .link { margin-top: var(--space-6); align-self: flex-start; }
@media (min-width: 640px) {
  .service { padding: var(--space-6); }
}
@media (min-width: 1024px) {
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service { padding: var(--space-7); }
  .service + .service { border-top: 0; border-left: 1px solid var(--color-border); }
  .service .link { margin-top: auto; }
  .service p { margin-bottom: var(--space-6); }
}

/* ---------- Process (dark panel) ---------- */
.process-panel {
  padding: var(--space-6);
  background: var(--color-dark);
  color: var(--color-dark-text);
  border-radius: var(--radius-panel);
}
.process-panel .chip { margin-bottom: var(--space-4); }
.process-panel .h2 { color: var(--color-dark-text); }
.process-panel .intro { margin-top: var(--space-4); color: var(--color-dark-text-secondary); }
.process-panel .timeline-note { margin-top: var(--space-6); max-width: 30rem; color: var(--color-dark-text-secondary); }
.steps { margin-top: var(--space-7); }
.step {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--color-dark-border);
}
.step:last-child { border-bottom: 1px solid var(--color-dark-border); }
.step-num {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-dark-muted);
  font-variant-numeric: tabular-nums;
}
.step .h3 { color: var(--color-dark-text); }
.step p { margin-top: var(--space-2); color: var(--color-dark-text-secondary); }
@media (min-width: 640px) {
  .process-panel { padding: var(--space-7); }
  .step { padding: var(--space-6) 0; }
}
@media (min-width: 1024px) {
  .process-panel {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    padding: var(--space-8);
  }
  .process-head { grid-column: 1 / 6; }
  .process-panel .chip { margin-bottom: var(--space-5); }
  .process-panel .intro { margin-top: var(--space-5); }
  .steps { grid-column: 7 / 13; margin-top: 0; }
  .step {
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 0;
    row-gap: 0;
    align-items: baseline;
  }
  .step-body { grid-column: 2; }
  .step:first-child { margin-top: 0; }
}

/* ---------- About ---------- */
.about-grid { display: grid; gap: var(--space-6); }
.about-media {
  width: 112px; height: 112px;
  margin-bottom: var(--space-6);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.about-media img { width: 100%; height: 100%; object-fit: cover; }
.about-intro .chip { margin-bottom: var(--space-4); }
.about-text { display: grid; gap: var(--space-5); }
.about-text .link { justify-self: start; margin-top: var(--space-2); }
@media (min-width: 640px) {
  .about-media { width: 144px; height: 144px; }
  .about-intro .chip { margin-bottom: var(--space-5); }
}
@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    align-items: start;
  }
  .about-intro { grid-column: 1 / 6; }
  .about-text { grid-column: 7 / 13; padding-top: 0; }
}

/* ---------- FAQ ---------- */
.faq-list {
  width: min(880px, 100%);
  margin-inline: auto;
  padding: var(--space-2);
  display: grid;
  gap: var(--space-2);
  background: var(--color-surface);
  border-radius: var(--radius-card);
}
@media (min-width: 640px) {
  .faq-list { padding: var(--space-4); }
}
.faq-item {
  background: var(--color-surface-raised);
  border-radius: var(--radius-field);
}
.faq-item::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size var(--dur-menu) var(--ease-out), content-visibility var(--dur-menu) allow-discrete;
}
.faq-item[open]::details-content { block-size: auto; }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
  padding: 20px 16px;
  list-style: none;
  cursor: pointer;
  border-radius: var(--radius-field);
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:focus-visible { outline-offset: 2px; }
.faq-q h3 { flex: 1; text-wrap: pretty; }
.faq-icon {
  width: 20px; height: 20px;
  flex: none;
  stroke: var(--color-text);
  transition: transform var(--dur-base) var(--ease-out), stroke var(--dur-base) var(--ease-out);
}
.faq-q:hover .faq-icon { stroke: var(--color-accent); }
.faq-item[open] .faq-icon { transform: rotate(45deg); }
.faq-a { padding: 0 16px 20px; max-width: 62ch; color: var(--color-text-secondary); }
@media (min-width: 640px) {
  .faq-q { padding: 24px 32px; }
  .faq-a { padding: 0 32px 24px; }
}

/* ---------- Contact ---------- */
.contact-form-wrap { width: min(640px, 100%); margin-inline: auto; }
.form-grid { display: grid; gap: var(--space-5); }
.form-grid[hidden] { display: none; }
.field { display: grid; gap: var(--space-2); align-content: start; }
.field label { font-size: 14px; font-weight: 500; line-height: 1.4; }
.field { scroll-margin-top: 112px; } /* keeps a focused field and its label clear of the sticky nav */
.field input,
.field textarea {
  width: 100%;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-field);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.field input { height: 56px; padding: 0 16px; }
.field textarea { min-height: 160px; padding: 16px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--color-text-muted); opacity: 1; }
.field input:hover,
.field textarea:hover { border-color: var(--color-text); }
.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--color-accent);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.field.has-error input,
.field.has-error textarea { border-color: var(--color-error); }
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-error);
}
.field-error[hidden] { display: none; }
.field-error svg { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.trap {
  position: absolute !important;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: var(--space-4);
  background: var(--color-error-bg);
  color: var(--color-error);
  border-radius: var(--radius-field);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}
.form-alert[hidden] { display: none; }
.form-alert svg { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.form-alert a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.form-actions { display: grid; gap: var(--space-4); }
.form-actions .btn { width: 100%; }
.form-help { color: var(--color-text-muted); }
.form-success {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-surface-raised);
  border-radius: var(--radius-card);
}
.form-success[hidden] { display: none; }
.form-success:focus { outline: none; }
.form-success:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.form-success svg { width: 24px; height: 24px; flex: none; margin-top: 3px; color: var(--color-success); }
.form-success p { color: var(--color-text); }
.contact-alt { margin-top: var(--space-7); text-align: center; color: var(--color-text-muted); }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-5); }
  .field--full, .form-alert, .form-actions { grid-column: 1 / -1; }
  .form-actions .btn { width: auto; justify-self: start; }
}
.contact-section { padding-bottom: var(--section-gap); }

/* ---------- Footer ---------- */
.site-footer {
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
  border-top: 1px solid var(--color-border);
}
.footer-grid { display: grid; gap: var(--space-7) var(--space-5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-brand { grid-column: 1 / -1; }
.footer-wordmark {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.footer-tag { margin-top: var(--space-3); color: var(--color-text-muted); }
.footer-heading {
  margin-bottom: var(--space-4);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--color-text-muted);
}
.footer-list { display: grid; gap: var(--space-3); }
.footer-list a,
.footer-link {
  display: inline-block;
  font-size: 16px;
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--dur-base) var(--ease-out);
}
.footer-list a:hover, .footer-link:hover { color: var(--color-accent); }
.footer-legal { margin-top: var(--space-7); }
@media (max-width: 479px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
.footer-bottom {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
@media (min-width: 640px) {
  .site-footer { padding-top: var(--space-8); padding-bottom: var(--space-6); }
  .footer-wordmark { font-size: 2rem; }
}
@media (min-width: 1024px) {
  .site-footer { padding-top: var(--space-9); padding-bottom: var(--space-7); }
  .footer-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
  .footer-brand { grid-column: 1 / 6; }
  .footer-wordmark { font-size: 2.5rem; }
  .footer-nav { grid-column: 7 / 10; }
  .footer-contact { grid-column: 10 / 13; }
  .footer-bottom { margin-top: var(--space-8); }
}

/* ---------- Privacy page ---------- */
.prose-page { padding: 128px 0 var(--section-gap); }
.prose { width: min(720px, 100%); margin-inline: auto; }
.h1-prose {
  font-size: 2.5rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.prose .updated { margin-top: var(--space-4); }
.prose-intro { margin-top: var(--space-6); }
.prose h2 {
  margin: var(--space-7) 0 var(--space-3);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.prose p { font-size: 1rem; line-height: 1.65; }
.prose p + p { margin-top: var(--space-4); }
.todo {
  border-bottom: 1px dashed var(--color-border-strong);
  color: var(--color-text-secondary);
}
@media (min-width: 640px) {
  .prose-page { padding-top: 144px; }
  .h1-prose { font-size: 3rem; }
  .prose h2 { font-size: 1.375rem; }
  .prose p { font-size: 1.0625rem; line-height: 1.7; }
}
@media (min-width: 1024px) {
  .prose-page { padding-top: 160px; }
  .h1-prose { font-size: 3.5rem; }
  .prose h2 { font-size: 1.5rem; }
}

/* ---------- Motion ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .mobile-menu { transition: none; }
  .faq-item::details-content { transition: none; }
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}

/* Copy-to-clipboard feedback */
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  z-index: 300;
  padding: var(--space-3) var(--space-5);
  background: var(--color-dark);
  color: var(--color-dark-text);
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.copy-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.copy-toast.is-error { background: var(--color-error-bg); color: var(--color-error); }
