/* ==========================================================================
   Uneven — institutional site
   One stylesheet, no build step, no framework.
   Tokens mirror design/uneven.tokens.json (v1.0.0) from the app repo.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* colour — light (warm paper) */
  --bg: #fbf7f3;
  --surface: #ffffff;
  --surface-sunken: #f1e9e0;
  --border: #e3d8cb;
  --border-strong: #cbbcab;
  --text: #1a1512;
  --text-muted: #6b5f55;
  --text-subtle: #9b8e82;
  --her: #b8437f;
  --her-soft: #fbe4ef;
  --her-ink: #6e1846;
  --his: #4e6b3a;
  --his-soft: #e7eedd;
  --his-ink: #27351b;
  --danger: #c4341f;
  --shadow-card: -6px 14px 28px rgba(26, 21, 18, 0.14);
  --shadow-raised: 0 4px 12px rgba(26, 21, 18, 0.08);

  /* type */
  --font-ui: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  --font-editorial: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* space — 4pt base */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 40px;
  --s9: 56px;
  --s10: 72px;

  /* radii */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-card: 24px;
  --r-pill: 999px;

  --measure: 34rem;
  --page: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141110;
    --surface: #1e1a18;
    --surface-sunken: #0e0c0b;
    --border: #332c27;
    --border-strong: #4a403a;
    --text: #f7f1ea;
    --text-muted: #b0a398;
    --text-subtle: #7c7169;
    --her: #e97fb4;
    --her-soft: #3b1428;
    --her-ink: #f7d6e6;
    --his: #a8c77e;
    --his-soft: #1e2a15;
    --his-ink: #e4eed4;
    --danger: #f0705a;
    --shadow-card: -6px 14px 28px rgba(0, 0, 0, 0.5);
    --shadow-raised: 0 4px 12px rgba(0, 0, 0, 0.35);
  }
}

/* --------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--her);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--his);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

hr {
  border: 0;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--s5);
}

@media (min-width: 48rem) {
  .wrap {
    padding-inline: var(--s7);
  }
}

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

@media (min-width: 48rem) {
  .section {
    padding-block: var(--s10);
  }
}

.stack > * + * {
  margin-top: var(--s4);
}

.skip-link {
  position: absolute;
  left: var(--s4);
  top: var(--s4);
  z-index: 100;
  transform: translateY(-200%);
  background: var(--text);
  color: var(--bg);
  padding: var(--s3) var(--s5);
  border-radius: var(--r-pill);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   4. Wordmark — lowercase, per-letter baseline offsets (u -4 n +2 e -2 v +3
      e -3 n +1 at 24px). Scaled with em so it holds at any size; never past
      ±4px, which the em values respect at the sizes used here.
   -------------------------------------------------------------------------- */

.wordmark {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.025em;
  text-transform: lowercase;
  line-height: 1;
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span {
  display: inline-block;
}

.wordmark .l1 { transform: translateY(-0.1667em); }  /* u  -4 */
.wordmark .l2 { transform: translateY(0.0833em); }   /* n  +2 */
.wordmark .l3 { transform: translateY(-0.0833em); }  /* e  -2 */
.wordmark .l4 { transform: translateY(0.125em); }    /* v  +3 */
.wordmark .l5 { transform: translateY(-0.125em); }   /* e  -3 */
.wordmark .l6 { transform: translateY(0.0417em); }   /* n  +1 */

.wordmark--colour .l3 { color: var(--her); }
.wordmark--colour .l5 { color: var(--his); }

/* Small mark (≤20px): baselines level, only the first e keeps colour. */
.wordmark--small span {
  transform: none;
}

.wordmark--small .l5 {
  color: inherit;
}

/* --------------------------------------------------------------------------
   5. Site chrome — nav + footer
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s6);
  padding-block: var(--s4);
}

.site-header .wordmark {
  font-size: 1.5rem;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: var(--s2) 0;
  display: inline-block;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 0 var(--her);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-sunken);
  padding-block: var(--s9) var(--s8);
  margin-top: var(--s9);
}

.footer-grid {
  display: grid;
  gap: var(--s7);
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

.site-footer h2 {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 500;
  margin: 0 0 var(--s4);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li + li {
  margin-top: var(--s3);
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.site-footer .wordmark {
  font-size: 1.375rem;
}

.colophon {
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s6);
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.colophon p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   6. Type
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-ui);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.125rem);
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
}

p {
  margin: 0;
  max-width: var(--measure);
}

.lede {
  font-family: var(--font-editorial);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem);
  line-height: 1.5;
  font-weight: 300;
  color: var(--text-muted);
  max-width: 36rem;
}

.tagline {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.875rem);
  color: var(--text-muted);
  margin: 0;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin: 0 0 var(--s4);
  display: block;
}

.label--her { color: var(--her); }
.label--his { color: var(--his); }

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.875rem;
}

/* Editorial prose — legal + support pages */
.prose {
  max-width: var(--measure);
}

.prose p,
.prose li {
  font-family: var(--font-editorial);
  font-size: 1.125rem;
  line-height: 1.65;
  font-weight: 400;
  color: var(--text);
  max-width: none;
}

.prose h2 {
  margin-top: var(--s9);
  margin-bottom: var(--s4);
  font-size: 1.5rem;
  scroll-margin-top: var(--s6);
}

.prose h3 {
  margin-top: var(--s7);
  margin-bottom: var(--s3);
}

.prose h2 + p,
.prose h3 + p {
  margin-top: 0;
}

.prose p + p,
.prose ul + p,
.prose p + ul,
.prose ol + p,
.prose p + ol {
  margin-top: var(--s4);
}

.prose ul,
.prose ol {
  margin: var(--s4) 0;
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: var(--s2);
}

.prose li::marker {
  color: var(--her);
}

.prose strong {
  font-weight: 600;
}

.prose dl {
  margin: var(--s5) 0 0;
}

.prose dt {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  margin-top: var(--s5);
}

.prose dd {
  margin: var(--s1) 0 0;
  font-family: var(--font-editorial);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   7. The tilted-line motif — the app icon, flattened into a divider
   -------------------------------------------------------------------------- */

.rule {
  display: block;
  width: 100%;
  max-width: var(--page);
  margin: var(--s8) auto;
  height: 6px;
  padding-inline: var(--s5);
  overflow: visible;
}

.rule::before {
  content: "";
  display: block;
  width: 78%;
  height: 5px;
  border-radius: 3px;
  background: var(--her);
  transform: rotate(-1.1deg);
  transform-origin: left center;
}

.rule--his::before {
  background: var(--his);
  width: 62%;
  transform: rotate(0.9deg);
}

.rule--tight {
  margin-block: var(--s6);
}

.rule--flush {
  padding-inline: 0;
}

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-block: var(--s9) var(--s8);
}

@media (min-width: 48rem) {
  .hero {
    padding-block: var(--s10) var(--s9);
  }
}

.hero .wordmark {
  font-size: clamp(3.5rem, 2rem + 9vw, 7rem);
  display: block;
  margin-bottom: var(--s6);
}

.hero .tagline {
  margin-bottom: var(--s6);
}

.hero-pitch {
  font-family: var(--font-editorial);
  font-size: clamp(1.1875rem, 1.05rem + 0.7vw, 1.4375rem);
  line-height: 1.6;
  font-weight: 300;
  max-width: 38rem;
  color: var(--text);
}

.hero-pitch strong {
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   9. Cards + grids
   -------------------------------------------------------------------------- */

.cards {
  display: grid;
  gap: var(--s5);
  grid-template-columns: 1fr;
  margin-top: var(--s7);
}

@media (min-width: 44rem) {
  .cards--2 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s6);
  }
  .cards--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--s6);
}

.card h3 {
  margin-bottom: var(--s3);
}

.card p {
  color: var(--text-muted);
  max-width: none;
}

/* The two sides. Tilt is the point — one degree and a half, opposite ways. */
.side {
  box-shadow: var(--shadow-card);
}

.side--her {
  background: var(--her-soft);
  border-color: transparent;
  transform: rotate(-1.5deg);
  color: var(--her-ink);
}

.side--his {
  background: var(--his-soft);
  border-color: transparent;
  transform: rotate(1.5deg);
  color: var(--his-ink);
}

/* Everything inside a side card takes the paired ink colour (design README
   §Accessibility: on soft tints, paired copy uses herInk / hisInk). */
.side h3,
.side p,
.side li {
  color: inherit;
}

.side .label {
  color: inherit;
  opacity: 0.8;
}

.side ul {
  margin: var(--s4) 0 0;
  padding-left: 1.1em;
}

.side li + li {
  margin-top: var(--s2);
}

.side .side-rule {
  width: 62%;
  height: 3px;
  border-radius: 2px;
  margin: var(--s6) 0 0;
  background: currentColor;
  opacity: 0.35;
}

@media (prefers-reduced-motion: reduce) {
  .side--her,
  .side--his {
    transform: none;
  }
}

/* Numbered steps */
.steps {
  counter-reset: step;
  list-style: none;
  margin: var(--s7) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s6);
  grid-template-columns: 1fr;
}

@media (min-width: 44rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.steps li {
  counter-increment: step;
  padding-top: var(--s4);
  border-top: 2px solid var(--border-strong);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  color: var(--text-subtle);
  display: block;
  margin-bottom: var(--s2);
}

.steps h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: var(--s2);
}

.steps p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: none;
}

/* --------------------------------------------------------------------------
   10. Store badges (placeholders until the listings are live)
   -------------------------------------------------------------------------- */

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  margin-top: var(--s6);
  padding: 0;
  list-style: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  min-height: 56px;
  padding: var(--s3) var(--s6);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

.badge:hover {
  border-color: var(--text-muted);
}

.badge .badge-note {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-subtle);
}

.badge-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  flex: none;
}

/* --------------------------------------------------------------------------
   11. Callout — the counsel note, the fallback note, the warnings
   -------------------------------------------------------------------------- */

.callout {
  border: 1px solid var(--border-strong);
  border-left: 5px solid var(--her);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: var(--s5) var(--s6);
  margin: var(--s6) 0;
  max-width: var(--measure);
}

.callout p {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: none;
}

.callout p + p {
  margin-top: var(--s3);
}

.callout strong {
  color: var(--text);
}

.callout--his {
  border-left-color: var(--his);
}

.doc-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin: var(--s5) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  list-style: none;
  padding: 0;
}

/* Table of contents on the long documents */
.toc {
  margin: var(--s7) 0 0;
  padding: var(--s5) var(--s6);
  background: var(--surface-sunken);
  border-radius: var(--r-lg);
  max-width: var(--measure);
}

.toc h2 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 500;
  margin: 0 0 var(--s3);
}

.toc ol {
  margin: 0;
  padding-left: 1.3em;
}

.toc li {
  font-size: 0.9375rem;
}

.toc li + li {
  margin-top: var(--s1);
}

.toc a {
  color: var(--text-muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--her);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* --------------------------------------------------------------------------
   12. FAQ + definition-style blocks
   -------------------------------------------------------------------------- */

.faq {
  margin-top: var(--s7);
  max-width: var(--measure);
}

.faq-item {
  border-top: 1px solid var(--border);
  padding-block: var(--s6);
}

.faq-item:last-child {
  border-bottom: 1px solid var(--border);
}

.faq-item h3 {
  margin-bottom: var(--s3);
}

.faq-item p {
  font-family: var(--font-editorial);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: none;
}

.faq-item p + p {
  margin-top: var(--s3);
}

/* --------------------------------------------------------------------------
   13. Contact block + inline buttons
   -------------------------------------------------------------------------- */

.contact {
  display: grid;
  gap: var(--s5);
  grid-template-columns: 1fr;
  margin-top: var(--s6);
}

@media (min-width: 44rem) {
  .contact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.contact-card {
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: var(--s6);
}

.contact-card .label {
  margin-bottom: var(--s2);
}

.contact-card a {
  font-size: 1.0625rem;
  font-weight: 600;
  word-break: break-word;
}

.contact-card p {
  margin-top: var(--s2);
  color: var(--text-muted);
  font-size: 0.9375rem;
  max-width: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--s3) var(--s7);
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--text);
}

.btn:hover {
  opacity: 0.88;
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s6);
}

/* --------------------------------------------------------------------------
   14. 404
   -------------------------------------------------------------------------- */

.notfound {
  padding-block: var(--s10);
  text-align: left;
}

.notfound .code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--text-subtle);
  display: block;
  margin-bottom: var(--s5);
}

/* --------------------------------------------------------------------------
   15. Utilities
   -------------------------------------------------------------------------- */

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

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--s4); }
.mt-6 { margin-top: var(--s6); }
.mt-7 { margin-top: var(--s7); }

@media print {
  .site-nav,
  .rule,
  .skip-link {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}
