/* SKA Synergy - main stylesheet. Tokens and rules are documented in docs/UI_SYSTEM.md. */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader.62981321d9a3.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-italic.48bc8861b9b2.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3.7a19a7027e12.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-italic.9a15dafc2c2b.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Colour: Sussex downland - chalk, flint, moss, lichen, iron oxide */
  --chalk: #EDEBE4;      /* page ground */
  --paper: #F6F5F0;      /* raised surfaces (rare) */
  --flint: #2B2A25;      /* body text, footer ground */
  --moss: #3D4934;       /* headings, feature band */
  --lichen: #CDD1BC;     /* text and focus on moss */
  --oxide: #8E4128;      /* links and the one action colour */
  --oxide-deep: #7A3721; /* button hover only */
  --shingle: #5F5B53;    /* secondary text */
  --rule: #C9C5BA;       /* hairlines (decorative only) */

  /* Type */
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --step--1: clamp(0.9375rem, 0.92rem + 0.1vw, 1rem);
  --step-0: clamp(1.0625rem, 1.03rem + 0.17vw, 1.1875rem);
  --step-1: clamp(1.25rem, 1.18rem + 0.35vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.37rem + 0.65vw, 2rem);
  --step-3: clamp(1.875rem, 1.6rem + 1.35vw, 2.75rem);
  --step-display: clamp(2.75rem, 1.9rem + 4.2vw, 5.75rem);

  /* Space */
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: clamp(3rem, 2.2rem + 4vw, 6rem);
  --space-2xl: clamp(4rem, 2.5rem + 7vw, 9rem);

  /* Layout */
  --container: 78rem;
  --measure: 38rem;
  --gutter: clamp(1rem, 0.4rem + 3vw, 3rem);
  --radius: 2px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--flint);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-kerning: normal;
}
a[href^="mailto:"] { overflow-wrap: anywhere; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 450;
  line-height: 1.12;
  color: var(--moss);
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 var(--space-s); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
cite { font-style: italic; }

a { color: var(--oxide); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--oxide); outline-offset: 3px; border-radius: var(--radius); }

.skip-link {
  position: absolute; left: var(--gutter); top: -10rem;
  background: var(--flint); color: var(--chalk);
  padding: var(--space-xs) var(--space-s); z-index: 10;
}
.skip-link:focus { top: var(--space-xs); }

/* ---------- Header ---------- */
.site-header__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-m) var(--gutter);
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: var(--space-2xs) var(--space-l);
}
.wordmark {
  font-family: var(--font-serif);
  font-size: var(--step-1);
  font-weight: 560;
  letter-spacing: -0.01em;
  color: var(--moss);
  text-decoration: none;
  padding-block: var(--space-2xs);
}
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0 var(--space-m);
}
.site-nav a {
  display: inline-block;
  padding-block: 0.625rem; /* 44px+ tap target */
  color: var(--flint);
  text-decoration: none;
  font-size: var(--step-0);
}
.site-nav a:hover { text-decoration: underline; text-decoration-color: var(--oxide); }
.site-nav a[aria-current="page"] {
  text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--oxide);
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-l) var(--gutter) var(--space-l);
  display: grid;
  gap: var(--space-l);
}
.hero__title {
  font-size: var(--step-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 11ch;
}
.hero__lede {
  margin-top: var(--space-l);
  max-width: 30rem;
  font-size: var(--step-1);
  line-height: 1.5;
}
.hero__lede p { margin-bottom: var(--space-xs); }
.hero__portrait { margin: 0; }
.hero__portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (min-width: 48em) {
  .hero { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: end; }
  .hero__title { font-size: clamp(2.75rem, 1rem + 4.6vw, 5.75rem); }
  .hero__portrait { justify-self: end; width: 100%; }
}
@media (min-width: 60em) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-xl); }
  .hero__title { font-size: var(--step-display); }
  .hero__text { padding-bottom: var(--space-m); }
  .hero__portrait { max-width: 34rem; }
}

/* ---------- Split sections (margin heading + reading column) ---------- */
.split {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-xl) var(--gutter);
  display: grid;
  gap: var(--space-m);
}
.split + .split { padding-top: 0; }
.split__heading {
  font-size: var(--step-2);
  padding-top: var(--space-m);
  border-top: 2px solid var(--moss);
  align-self: start;
}
.split__body { max-width: var(--measure); }
@media (min-width: 60em) {
  .split { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-xl); }
  .split__body { padding-top: var(--space-m); border-top: 1px solid var(--rule); }
}

.prose__lead {
  font-family: var(--font-serif);
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--flint);
}
.prose__meta { color: var(--shingle); }
.text-link { font-weight: 600; }

/* ---------- Ways in (ruled list, not cards) ---------- */
.ways { list-style: none; margin: 0; padding-left: 0; }
.ways__item { padding-block: var(--space-m); border-bottom: 1px solid var(--rule); }
.ways__item:first-child { padding-top: 0; }
.ways__title { font-size: var(--step-2); margin-bottom: var(--space-2xs); }
.ways__title a { color: var(--moss); text-decoration-color: var(--oxide); }
.ways__item p { color: var(--shingle); max-width: 34rem; }

/* ---------- Feature band (moss) ---------- */
.band { background: var(--moss); color: var(--chalk); }
.band__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-xl) var(--gutter);
  display: grid; gap: var(--space-m); justify-items: start;
}
.band__body { display: grid; gap: var(--space-m); justify-items: start; }
@media (min-width: 60em) {
  .band__inner { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-xl); }
}
.band__title { color: var(--chalk); font-size: var(--step-3); }
.band__text { font-size: var(--step-1); max-width: 30rem; color: var(--lichen); }
.band :focus-visible { outline-color: var(--lichen); }

/* ---------- Buttons ---------- */
.button {
  display: inline-block; min-height: 2.75rem;
  padding: 0.75rem 1.25rem; line-height: 1.25;
  font-family: var(--font-sans); font-size: var(--step-0); font-weight: 600;
  text-decoration: none; border-radius: var(--radius);
  background: var(--oxide); color: var(--chalk);
}
.button:hover { background: var(--oxide-deep); text-decoration: none; }
.button--on-dark { background: var(--chalk); color: var(--moss); }
.button--on-dark:hover { background: var(--paper); text-decoration: underline; }

/* ---------- Placeholder pages (prototype only) ---------- */
.placeholder {
  max-width: var(--container); margin-inline: auto;
  padding: var(--space-xl) var(--gutter) var(--space-2xl);
}
.placeholder > * { max-width: var(--measure); }
.placeholder__title { font-size: var(--step-3); margin-bottom: var(--space-m); }

/* ---------- Footer ---------- */
.site-footer { background: var(--flint); color: var(--chalk); }
.site-footer__inner {
  max-width: var(--container); margin-inline: auto;
  padding: var(--space-xl) var(--gutter) var(--space-l);
  display: grid; gap: var(--space-m);
}
.site-footer__name { font-family: var(--font-serif); font-size: var(--step-2); }
.site-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2xs); }
.site-footer a { color: var(--chalk); }
.site-footer :focus-visible { outline-color: var(--lichen); }
.site-footer__legal { color: var(--lichen); font-size: var(--step--1); }
@media (min-width: 60em) {
  .site-footer__inner { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-m) var(--space-xl); align-items: start; }
  .site-footer__legal { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Warm portrait-led redesign (UI_SYSTEM §12) ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.wordmark { font-size: var(--step-2); }
.hero { padding-block: var(--space-xl); }
.hero__title {
  font-size: clamp(2.75rem, 1.9rem + 3.8vw, 5.25rem);
  max-width: 12ch;
  line-height: 1.06;
}

/* ---------- Inner pages and writing (UI_SYSTEM §13) ---------- */
.reading { max-width: var(--container); margin-inline: auto; padding: var(--space-xl) var(--gutter) var(--space-2xl); overflow-wrap: anywhere; }
.reading > * { max-width: var(--measure); }
.reading__title { font-size: var(--step-3); margin-bottom: var(--space-m); text-wrap: pretty; }
.reading__meta { color: var(--shingle); font-size: var(--step--1); margin-bottom: var(--space-l); }
.reading__body h2 { font-size: var(--step-2); margin: var(--space-l) 0 var(--space-m); padding-top: var(--space-m); border-top: 1px solid var(--rule); }
.reading__body h3 { font-size: var(--step-1); margin-block: var(--space-m) var(--space-s); }
.reading__body ul, .reading__body ol { padding-left: var(--space-m); }
.reading__body li { margin-bottom: var(--space-xs); }
.reading__body a { overflow-wrap: anywhere; }
.reading__next { margin-top: var(--space-xl); padding-top: var(--space-m); border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: var(--space-s) var(--space-m); }
.contact-email { font-family: var(--font-serif); font-size: var(--step-2); margin-block: var(--space-l); }
.testimonial { margin: 0 0 var(--space-l); padding-bottom: var(--space-l); border-bottom: 1px solid var(--rule); }
.testimonial blockquote { margin: 0 0 var(--space-s); font-family: var(--font-serif); font-size: var(--step-1); line-height: 1.5; }
.testimonial figcaption { color: var(--shingle); }
.post-list { list-style: none; padding: 0 !important; margin-top: var(--space-l); }
.post-list li { border-top: 1px solid var(--rule); padding-block: var(--space-m); }
.post-list h2 { padding: 0; margin: 0 0 var(--space-s); border: 0; }
.post-list .reading__meta { margin: 0; }
.review-note { background: var(--paper); border-left: 2px solid var(--moss); padding: var(--space-m); margin-bottom: var(--space-l); }
.hero__lede { font-size: var(--step-0); max-width: 29rem; margin-top: var(--space-m); }
.hero__action { margin-top: var(--space-m); }
.hero__portrait { background: var(--lichen); padding: var(--space-xs); border-radius: var(--radius); }
.introduction { background: var(--paper); }
@media (min-width: 48em) {
  .hero { align-items: center; }
  .hero__title { font-size: clamp(2.75rem, 1rem + 4.6vw, 5.25rem); }
}
@media (min-width: 60em) {
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); }
  .hero__title { font-size: clamp(2.75rem, 1.9rem + 3.8vw, 5.25rem); }
  .hero__text { padding-bottom: 0; }
  .hero__portrait { max-width: 30rem; }
}
