/* ============================================================
   Manens — manensmemory.com
   Single dark theme. All colour lives in the :root block below.
   ============================================================ */

/* ---------- Self-hosted fonts (SIL OFL 1.1 — see fonts/README.md) ---------- */

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 600;          /* variable weight axis */
  font-display: swap;
  src: url('fonts/source-sans-3-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
                 U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
                 U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  /* Surfaces — warm near-black, so the page reads as paper at night */
  --bg:            #15140F;
  --bg-raised:     #1C1A14;
  --surface:       #201E17;

  /* Ink */
  --text:          #F2F0E8;
  --muted:         #A8A396;

  /* Lines */
  --border:        #343027;
  --border-strong: #4A463A;

  /* Accent — deep teal */
  --accent:        #2FB8A8;
  --accent-fill:   #0E7A70;
  --accent-hover:  #12897E;
  --accent-dim:    rgba(47, 184, 168, 0.10);

  /* Type */
  --font-sans:  'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-mono:  ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

  /* Rhythm */
  --shell:   1060px;
  --gutter:  16px;
  --radius:  6px;
  --section: 60px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

a { color: inherit; }

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

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

/* ---------- Layout ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section);
  border-top: 1px solid var(--border);
  scroll-margin-top: 72px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent-fill);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
  font-size: 14px;
}
.skip-link:focus { left: 0; }

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.06;
}

h1.display { font-size: clamp(2.5rem, 7vw, 4.1rem); }
h2.display { font-size: clamp(1.9rem, 4.4vw, 2.85rem); margin-bottom: 30px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 54ch;
}

.section-lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 58ch;
  margin-top: -16px;
  margin-bottom: 38px;
}

.footnote {
  font-size: 0.9rem;
  color: var(--muted);
}

.pullout {
  margin-top: 30px;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  font-size: 1.05rem;
  color: var(--text);
  max-width: 62ch;
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-fill);
  color: #ffffff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-sm { font-size: 0.9rem; padding: 9px 16px; }

.link-arrow {
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: border-color 0.15s ease;
}
.link-arrow:hover { border-color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(21, 20, 15, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.wordmark-mark { width: 20px; height: 20px; color: var(--accent); flex: none; }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(52px, 8vw, 92px) clamp(48px, 7vw, 76px);
}
.hero .lede { margin-top: 22px; }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 34px;
  margin-bottom: 20px;
}

/* ---------- Problem cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.card h3 {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.card p {
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px 32px;
}

.feature .icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-bottom: 14px;
}
.feature h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 7px;
}
.feature p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 44px;
}

.step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg-raised);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-bottom: 14px;
}
.step h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.step p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- Diagram ---------- */
.diagram {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 22px 16px;
}
.diagram-svg { width: 100%; height: auto; }
.diagram-wide { display: none; }

.d-layer rect {
  fill: var(--surface);
  stroke: var(--border-strong);
  stroke-width: 1;
}
.d-layer text {
  fill: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
}

.d-untouched rect {
  fill: none;
  stroke: var(--border);
  stroke-dasharray: 4 4;
}
.d-untouched text { fill: var(--muted); font-weight: 400; }

.d-manens rect {
  fill: var(--accent-dim);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.d-manens text {
  fill: var(--accent);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
}

.d-line path { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.d-dot { fill: var(--accent); }

.d-label {
  fill: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.d-note {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 28px;
  max-width: 64ch;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border-strong);
}
.timeline li {
  position: relative;
  padding-bottom: 36px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
}
.when {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 7px;
}
.timeline p {
  font-size: 1rem;
  color: var(--muted);
}

/* ---------- Contact ---------- */
.contact-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: clamp(32px, 6vw, 60px);
}
.contact-card h2.display { margin-bottom: 22px; }
.contact-card .section-lede { margin-top: 0; margin-bottom: 32px; }
.contact-card .footnote { margin-top: 18px; }

/* ---------- Form (contact page) ---------- */
/* Constrains line length without breaking alignment with the header, which
   is centred inside .shell. Nest .measure inside .shell, never beside it. */
.measure { max-width: 620px; }

.form-section {
  padding-block: clamp(52px, 8vw, 92px) clamp(64px, 9vw, 104px);
}
.form-section .lede { margin-top: 20px; margin-bottom: 44px; }

.form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
}

.field {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.field label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.optional { font-weight: 400; color: var(--muted); }

.field input,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 11px 14px;
  transition: border-color 0.15s ease;
}
.field textarea { resize: vertical; min-height: 120px; }

.field input:hover,
.field textarea:hover { border-color: var(--muted); }

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

/* :user-invalid fires only after the person has interacted and left the
   field — unlike :invalid, which flags empty required fields on page load. */
.field input:user-invalid,
.field textarea:user-invalid { border-color: #D98A6B; }

.hint {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 7px;
}

.form .btn { margin-top: 4px; cursor: pointer; }

/* Honeypot. Hidden from people, left for bots to fill in. */
.botcheck {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 26px 32px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-inner a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
}
.footer-inner a:hover { color: var(--text); border-color: var(--accent); }

/* ============================================================
   Breakpoints
   ============================================================ */

@media (min-width: 560px) {
  .card-grid    { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps        { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 640px) {
  .diagram-wide   { display: block; }
  .diagram-narrow { display: none; }
  .diagram        { padding: 30px 26px; }
}

@media (min-width: 880px) {
  :root { --gutter: 32px; --section: 84px; }
  .card-grid    { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 36px 40px; }
}
