/* ============================================================
   DISCONNEC.TECH — Handcrafted Stylesheet
   Sections: Reset · Tokens · Base · Typography · Layout ·
             Nav · Sections · Utilities · Responsive
   ============================================================ */

/* ─── Reset ─────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

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

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

input,
button,
textarea,
select {
  font: inherit;
}

/* ─── Tokens ─────────────────────────────────────────────── */

:root {
  /* Colors */
  --color-paper: #f5f1e8;
  --color-paper-shade: #eae2d3;
  --color-ink: #1f1d1a;
  --color-muted: #5f5a52;
  --color-olive: #6f7b5b;
  --color-olive-strong: #3e4b32;
  --color-clay: #a06a4b;
  --color-rule: #d5ccba;

  /* Typography */
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-sans:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.375rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.25rem;
  --text-3xl: 3rem;
  --text-4xl: 3.75rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --content-width: 68ch;
  --content-padding: var(--space-6);

  /* Borders */
  --rule-color: var(--color-rule);
  --rule-width: 1px;

  /* Body copy */
  --body-text-size: var(--text-base);
  --body-line-height: 1.8;
}

/* ─── Base ───────────────────────────────────────────────── */

html {
  font-size: 18px;
  background-color: var(--color-paper);
  color: var(--color-ink);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  background-color: var(--color-paper);
  color: var(--color-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Typography ─────────────────────────────────────────── */

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: normal;
  line-height: 1.2;
  color: var(--color-ink);
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-2xl);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-lg);
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

p {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-ink);
}

a {
  color: var(--color-olive);
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition:
    text-decoration-color 0.15s ease,
    color 0.15s ease;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--color-olive);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ─── Layout ─────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--content-padding);
}

.section {
  padding-block: var(--space-20);
  border-top: var(--rule-width) solid var(--rule-color);
}

.section:first-of-type {
  border-top: none;
}

/* ─── Site Nav ───────────────────────────────────────────── */

.site-nav {
  margin-top: var(--space-10);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
}

.nav-list a {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: underline dotted;
  text-decoration-color: var(--color-rule);
  text-underline-offset: 3px;
  transition:
    text-decoration-color 0.15s ease,
    text-decoration-style 0.15s ease,
    color 0.15s ease;
}

.nav-list a:hover {
  color: var(--color-olive);
  text-decoration-style: solid;
  text-decoration-color: currentColor;
}

.nav-list a:focus-visible {
  outline: 2px solid var(--color-olive);
  outline-offset: 3px;
  border-radius: 2px;
  text-decoration-style: solid;
  text-decoration-color: currentColor;
}

.nav-list a[aria-current="true"] {
  color: var(--color-olive);
  text-decoration-color: var(--color-olive);
}

/* Flex row break (mobile only): keeps Principles + Manifesto on one line */
.nav-list__break {
  display: none;
}

/* ─── Section Labels ─────────────────────────────────────── */

.section-label {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-olive-strong);
  margin-bottom: var(--space-6);
}

.section-lead {
  font-size: var(--body-text-size);
  line-height: var(--body-line-height);
  color: var(--color-muted);
  margin-top: var(--space-6);
  max-width: 62ch;
}

.section h2 + .section-lead {
  margin-top: 0;
}

/* ─── Hero ───────────────────────────────────────────────── */

.hero {
  padding-block: var(--space-32) var(--space-10);
}

.site-label {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-8);
}

.hero-headline {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-4xl));
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--color-ink);
  max-width: 18ch;
}

.hero-subhead {
  margin-top: var(--space-6);
  font-size: var(--text-md);
  color: var(--color-muted);
  line-height: 1.65;
  max-width: 46ch;
}

/* ─── Definition ─────────────────────────────────────────── */

.section--definition h2 {
  margin-bottom: var(--space-6);
  max-width: 28ch;
}

.trait-list {
  list-style: none;
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.trait-list li {
  position: relative;
  padding-left: var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--body-text-size);
  line-height: var(--body-line-height);
  color: var(--color-muted);
  font-weight: 600;
}

.trait-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--color-olive);
  font-family: var(--font-sans);
  font-weight: 600;
}

/* ─── Paradigm Shift ─────────────────────────────────────── */

.section--shift {
  background-color: var(--color-paper-shade);
}

.section--shift h2 {
  margin-bottom: var(--space-6);
}

.shift-list {
  list-style: none;
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.shift-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: var(--rule-width) solid var(--rule-color);
  font-family: var(--font-sans);
  font-size: var(--body-text-size);
  line-height: var(--body-line-height);
}

.shift-item:first-child {
  border-top: var(--rule-width) solid var(--rule-color);
}

.shift-more {
  color: var(--color-ink);
  font-weight: 500;
}

.shift-sep {
  color: var(--color-rule);
  font-family: var(--font-serif);
  user-select: none;
}

.shift-less {
  color: var(--color-muted);
}

/* ─── Theory of Change ───────────────────────────────────── */

.section--theory h2 {
  margin-bottom: var(--space-8);
  max-width: 32ch;
}

.prose {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 62ch;
}

.prose p {
  font-size: var(--body-text-size);
  line-height: var(--body-line-height);
}

/* ─── Principles ─────────────────────────────────────────── */

.section--principles {
  background-color: var(--color-paper-shade);
}

.section--principles h2 {
  margin-bottom: var(--space-4);
}

.principles-list {
  list-style: none;
  counter-reset: principles;
  margin-top: var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.principles-list > li {
  counter-increment: principles;
  display: flex;
  gap: var(--space-6);
  align-items: start;
}

.principles-list > li::before {
  content: counter(principles, decimal-leading-zero);
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  color: var(--color-olive);
  line-height: 1.4;
  padding-top: 0.2em;
  flex: 0 0 2rem;
  text-align: right;
}

.principles-list .principle-body {
  flex: 1 1 0;
  min-width: 0;
}

.principles-list h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-ink);
}

.principles-list p {
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: 1.7;
}

/* ─── Closing ────────────────────────────────────────────── */

.section--closing {
  padding-block: var(--space-24);
}

.closing-headline {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-12);
  color: var(--color-ink);
}

.manifesto-lines {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-10);
  border-left: 2px solid var(--color-olive);
  padding-left: var(--space-6);
}

.manifesto-lines li {
  font-family: var(--font-serif);
  font-size: var(--body-text-size);
  line-height: var(--body-line-height);
  color: var(--color-ink);
  font-style: italic;
}

.closing-coda {
  font-family: var(--font-sans);
  font-size: var(--body-text-size);
  line-height: var(--body-line-height);
  color: var(--color-muted);
  font-style: normal;
  margin-bottom: var(--space-4);
  max-width: 62ch;
}

/* ─── Version Note ───────────────────────────────────────── */

.version-note {
  border-top: var(--rule-width) solid var(--rule-color);
  padding-block: var(--space-10) var(--space-16);
}

.version-note .rule {
  display: none;
}

.version-meta {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.version-note-text {
  font-size: var(--text-xs);
  color: var(--color-muted);
  max-width: 52ch;
  line-height: 1.7;
}

.footer-connect {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: var(--rule-width) solid var(--color-rule);
}

.footer-connect__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

.footer-connect__link {
  display: inline-flex;
  color: var(--color-muted);
  text-decoration: none;
  border-radius: 2px;
  padding: var(--space-1);
  margin: calc(-1 * var(--space-1));
  transition: color 0.15s ease;
}

.footer-connect__link:hover {
  color: var(--color-olive);
}

.footer-connect__link:focus-visible {
  outline: 2px solid var(--color-olive);
  outline-offset: 2px;
}

.footer-connect__icon {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}

/* ─── Utilities ──────────────────────────────────────────── */

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

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 640px) {
  :root {
    --content-padding: var(--space-4);
  }

  html {
    font-size: 16px;
  }

  .hero {
    padding-block: var(--space-20) var(--space-8);
  }

  .hero-headline {
    font-size: var(--text-3xl);
  }

  .section {
    padding-block: var(--space-16);
  }

  .section h2:not(.closing-headline) {
    font-size: var(--text-xl);
  }

  .closing-headline {
    font-size: var(--text-2xl);
  }

  .shift-item {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }

  .shift-sep {
    display: none;
  }

  .shift-less {
    padding-left: var(--space-2);
  }

  .principles-list > li {
    gap: var(--space-3);
  }

  .principles-list > li::before {
    flex: 0 0 1.5rem;
  }

  .nav-list {
    justify-content: space-evenly;
    gap: var(--space-2) var(--space-4);
  }

  .nav-list__break {
    display: block;
    flex-basis: 100%;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    list-style: none;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  :root {
    --content-padding: var(--space-8);
  }

  .nav-list {
    font-size: var(--text-xs);
  }

  .hero {
    padding-block: var(--space-24) var(--space-8);
  }
}
