/* ==========================================================================
   HonorLabs — design system
   Warm, human, editorial. Light and dark, no build step.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  /* Surfaces */
  --paper:        #FBF7F1;
  --paper-raised: #FFFDFA;
  --sand:         #F2EADD;

  /* Ink */
  --ink:      #211C18;
  --ink-soft: #4A423B;
  --ink-mute: #786D63;

  /* Line + accent */
  --line:       #E6DCCE;
  --line-soft:  #EFE7DB;
  --clay:       #A9491F;
  --clay-hover: #8C3A16;
  --clay-wash:  #F6E9E0;
  --sage:       #3F5A4A;
  --sage-wash:  #E8EFE9;

  /* Focus */
  --focus: #1D4ED8;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino,
                  Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Rhythm */
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section: clamp(4.5rem, 10vw, 8rem);
  --measure: 62ch;
  --radius: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(33, 28, 24, .05), 0 2px 8px rgba(33, 28, 24, .04);
  --shadow-md: 0 2px 4px rgba(33, 28, 24, .05), 0 12px 32px rgba(33, 28, 24, .07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #16120E;
    --paper-raised: #1E1913;
    --sand:         #241D16;

    --ink:      #F6F0E7;
    --ink-soft: #D8CEC1;
    --ink-mute: #A4978B;

    --line:      #342A20;
    --line-soft: #2A2119;
    --clay:       #E79063;
    --clay-hover: #F2A87F;
    --clay-wash:  #2C1D14;
    --sage:       #9CC0A9;
    --sage-wash:  #1B241E;

    --focus: #8AB4FF;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .22);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Warm wash behind the page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(60rem 32rem at 12% -8%, var(--clay-wash) 0%, transparent 62%),
    radial-gradient(52rem 30rem at 92% 4%, var(--sage-wash) 0%, transparent 60%);
  opacity: .75;
}

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

/* --- Typography --------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--ink);
}
h1 { font-size: clamp(2.5rem, 6.2vw, 4.25rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.85rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); letter-spacing: -0.015em; }
h4 { font-size: 1.0625rem; font-family: var(--font-body); font-weight: 600; letter-spacing: -0.01em; }

p { text-wrap: pretty; }
p + p { margin-top: 1.1em; }

a { color: var(--clay); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--clay-hover); }

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

strong { font-weight: 600; color: var(--ink); }
code { font-family: var(--font-mono); font-size: .9em; background: var(--sand); padding: .1em .4em; border-radius: 5px; }

.eyebrow {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--clay);
  font-family: var(--font-body);
}
.lede {
  font-size: clamp(1.125rem, 1.9vw, 1.3125rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: var(--measure);
}
.muted { color: var(--ink-mute); }
.small { font-size: .9375rem; }

/* --- Layout ------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 48rem; }

.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(3rem, 6vw, 4.5rem); }
.section + .section { padding-top: 0; }

.stack > * + * { margin-top: 1rem; }
.rule { border: 0; border-top: 1px solid var(--line); margin-block: clamp(2.5rem, 5vw, 4rem); }

/* --- Skip link ---------------------------------------------------------- */
.skip {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: .7rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top .15s ease;
}
.skip:focus { top: 1rem; color: var(--paper); }

/* --- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header[data-scrolled="true"] {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand__mark { flex: none; width: 26px; height: 26px; }
.brand__mark path,
.brand__mark circle { transition: transform .3s ease; }

/* Nav */
.nav { display: flex; align-items: center; gap: .25rem; }
.nav__link {
  display: inline-block;
  padding: .5rem .75rem;
  border-radius: 8px;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}
.nav__link:hover { color: var(--ink); background: var(--sand); }
.nav__link[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav__cta { margin-left: .5rem; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-raised);
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--sand); }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }

@media (max-width: 47.99em) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    left: var(--gutter); right: var(--gutter);
    top: calc(100% + .5rem);
    flex-direction: column;
    align-items: stretch;
    gap: .125rem;
    padding: .625rem;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
  }
  .nav[data-open="true"] { display: flex; }
  .nav__link { padding: .7rem .75rem; font-size: 1rem; }
  .nav__cta { margin-left: 0; margin-top: .375rem; justify-content: center; }
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background-color .15s ease,
              border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1em; height: 1em; flex: none; }

.btn--primary {
  background: var(--clay);
  color: #FFF9F5;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--clay-hover); color: #FFF9F5; box-shadow: var(--shadow-md); }
@media (prefers-color-scheme: dark) {
  .btn--primary { color: #1A120C; }
  .btn--primary:hover { color: #1A120C; }
}

.btn--ghost {
  background: var(--paper-raised);
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--sand); border-color: var(--ink-mute); color: var(--ink); }

.btn--lg { padding: .875rem 1.5rem; font-size: 1rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* --- Hero --------------------------------------------------------------- */
.hero { padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5.5rem); }
.hero__inner { display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: center; }
@media (min-width: 62em) {
  .hero__inner { grid-template-columns: 1.15fr .85fr; }
}
.hero h1 { margin-top: 1rem; }
.hero .lede { margin-top: 1.5rem; }
.hero .btn-row { margin-top: 2rem; }

.hero__note {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: .9375rem;
  color: var(--ink-mute);
  max-width: 42ch;
}

/* Decorative panel */
.panel {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  box-shadow: var(--shadow-md);
}
.panel__label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line-soft);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); flex: none; }

.ticket { display: flex; gap: .875rem; padding: .875rem 0; }
.ticket + .ticket { border-top: 1px solid var(--line-soft); }
.ticket__icon {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--sand);
  color: var(--clay);
}
.ticket__icon svg { width: 17px; height: 17px; }
.ticket__body { min-width: 0; }
.ticket__title { font-weight: 600; font-size: .9375rem; letter-spacing: -0.01em; }
.ticket__meta { font-size: .8125rem; color: var(--ink-mute); margin-top: .125rem; }

/* --- Cards -------------------------------------------------------------- */
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.375rem, 2.5vw, 1.75rem);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--ink-mute); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card__icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--clay-wash);
  color: var(--clay);
  margin-bottom: 1.125rem;
}
.card__icon svg { width: 20px; height: 20px; }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--ink-soft); font-size: .9688rem; }

/* Numbered principles */
.steps { list-style: none; padding: 0; display: grid; gap: 1.75rem; counter-reset: step; }
@media (min-width: 48em) { .steps { grid-template-columns: 1fr 1fr; gap: 2.25rem 3rem; } }
.steps > li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: 1rem; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 500;
  color: var(--clay);
  padding-top: .25rem;
}
.steps h3 { margin-bottom: .375rem; }
.steps p { color: var(--ink-soft); font-size: .9688rem; }

/* Section heading block */
.section-head { max-width: var(--measure); margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { margin-top: .75rem; }
.section-head p { margin-top: 1rem; color: var(--ink-soft); font-size: 1.0625rem; }

/* --- CTA band ----------------------------------------------------------- */
.cta {
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}
.cta h2 { max-width: 20ch; margin-inline: auto; }
.cta p { margin: 1rem auto 0; max-width: 52ch; color: var(--ink-soft); }
.cta .btn-row { justify-content: center; margin-top: 2rem; }

/* --- Prose (legal + long-form) ------------------------------------------ */
/* Width comes from the container (.wrap--narrow) so the left edge lines up
   with the page head; running text is capped separately for a sane measure. */
.prose > * + * { margin-top: 1.1em; }
.prose > p,
.prose > ul,
.prose > ol { max-width: 36rem; }
.prose h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.prose h2:first-of-type { margin-top: 0; }
.prose h3 { font-size: 1.125rem; margin-top: 1.85rem; }
.prose ul, .prose ol { padding-left: 1.35rem; color: var(--ink-soft); }
.prose li + li { margin-top: .5rem; }
.prose li::marker { color: var(--ink-mute); }
.prose p { color: var(--ink-soft); }
.prose a { font-weight: 500; }

.page-head { padding-block: clamp(3rem, 7vw, 4.75rem) 0; }
.page-head + .section { padding-top: clamp(2.25rem, 4vw, 3.25rem); }
.page-head h1 { margin-top: .75rem; font-size: clamp(2.1rem, 4.6vw, 3.1rem); }
.page-head .lede { margin-top: 1.25rem; }
.updated {
  display: inline-block;
  margin-top: 1.5rem;
  padding: .35rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-raised);
  font-size: .8125rem;
  color: var(--ink-mute);
}

/* Callout */
.callout {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--clay);
  border-radius: var(--radius);
  padding: 1.25rem 1.375rem;
  font-size: .9688rem;
}
.callout h3 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; margin-bottom: .375rem; }
.callout p { color: var(--ink-soft); }

/* Definition rows */
.rows { border-top: 1px solid var(--line); }
.rows > div {
  display: grid;
  gap: .25rem 2rem;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 44em) { .rows > div { grid-template-columns: 15rem 1fr; } }
.rows dt { font-weight: 600; font-size: .9375rem; color: var(--ink); }
.rows dd { margin: 0; color: var(--ink-soft); font-size: .9688rem; }

/* Contact methods */
.contact-card {
  display: flex;
  gap: 1rem;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.contact-card__icon {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--clay-wash);
  color: var(--clay);
}
.contact-card__icon svg { width: 19px; height: 19px; }
.contact-card h3 { font-size: 1.0625rem; font-family: var(--font-body); font-weight: 600; margin-bottom: .25rem; }
.contact-card p { font-size: .9375rem; color: var(--ink-soft); }
.contact-card .mail { display: inline-block; margin-top: .5rem; font-weight: 600; font-size: .9688rem; word-break: break-word; }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  padding-block: clamp(3rem, 6vw, 4rem) 2rem;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--sand) 45%, transparent);
}
.footer-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 44em) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; } }
.footer-grid p { font-size: .9375rem; color: var(--ink-mute); max-width: 34ch; margin-top: .875rem; }
.footer-title {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: .875rem;
}
.footer-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.footer-list a {
  font-size: .9375rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.footer-list a:hover { color: var(--clay); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: .875rem;
  color: var(--ink-mute);
}

/* --- Utilities ---------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.center { text-align: center; }
.mt-lg { margin-top: clamp(2rem, 4vw, 3rem); }

/* 404 */
.notfound { display: grid; place-items: center; text-align: center; padding-block: clamp(5rem, 14vw, 9rem); }
.notfound__code {
  font-family: var(--font-mono);
  font-size: .875rem;
  letter-spacing: .1em;
  color: var(--clay);
}
