/* ============================================================
   Logsbery — landing page styles
   Design language borrowed from the "paper / ink / wax" system:
   warm paper background, warm charcoal ink, sealing-wax accent.
   ============================================================ */

/* ---------- Self-hosted fonts (no third-party requests: GDPR) ---------- */
@font-face {
  font-family: 'PT Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/PTSerif-400.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Serif'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/PTSerif-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Serif'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/assets/fonts/PTSerif-700.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/PTSans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Sans'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/assets/fonts/PTSans-700.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  --font-sans: 'PT Sans', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-serif: 'PT Serif', Georgia, 'Times New Roman', serif;

  /* paper (warm neutral) */
  --paper-50:  #fcfbf7;
  --paper-100: #f5f2ea;
  --paper-200: #ede9df;
  --paper-300: #e0dccf;
  --paper-500: #6e6b62;
  --paper-600: #514e47;
  --paper-800: #2a2722;
  --paper-900: #262624;
  --paper-950: #1c1c1a;

  /* wax (accent) */
  --wax-200: #e39a86;
  --wax-300: #d67e66;
  --wax-600: #a93226;
  --wax-700: #8e2a20;

  /* semantic — light */
  --bg:        var(--paper-100);
  --bg-alt:    var(--paper-200);
  --surface:   var(--paper-50);
  --text:      var(--paper-800);
  --text-muted:var(--paper-500);
  --text-toned:var(--paper-600);
  --border:    var(--paper-300);
  --accent:    var(--wax-600);
  --accent-hover: var(--wax-700);
  --on-accent: var(--paper-50);

  --wrap: 1120px;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(42 39 34 / .05), 0 8px 24px -12px rgb(42 39 34 / .12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        var(--paper-900);
    --bg-alt:    var(--paper-950);
    --surface:   #2f2e2b;
    --text:      var(--paper-50);
    --text-muted:#a9a69c;
    --text-toned:#c8c5bb;
    --border:    #3d3d39;
    --accent:    var(--wax-300);
    --accent-hover: var(--wax-200);
    --on-accent: #241310;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .5);
  }
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; line-height: 1.18; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.is-stuck { border-bottom-color: var(--border); }

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

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.mark-seal { fill: var(--accent); }
.mark-glyph { fill: none; stroke: var(--on-accent); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-word { font-family: var(--font-serif); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.015em; }

.site-nav { display: flex; align-items: center; gap: 28px; font-size: .95rem; }
.site-nav a { text-decoration: none; color: var(--text-toned); transition: color .18s ease; }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-cta {
  color: var(--text); border: 1px solid var(--border);
  padding: 7px 16px; border-radius: 999px;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
.site-nav .nav-cta:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .site-nav { gap: 16px; font-size: .875rem; }
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 700;
  padding: 12px 24px; border-radius: var(--radius); border: 1px solid transparent;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 15px 32px; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { padding: clamp(72px, 12vw, 132px) 0 clamp(56px, 8vw, 96px); }
.eyebrow {
  font-size: .8rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(2.25rem, 5.6vw, 4rem); max-width: 17ch; margin-bottom: 26px; }
.lead { font-size: clamp(1.075rem, 2vw, 1.3rem); color: var(--text-toned); max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 104px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.section-lead { color: var(--text-muted); margin-top: 12px; font-size: 1.075rem; }

/* ---------- Cards ---------- */
/* Four cards, so a 2x2 block reads better than a 3+1 orphan row. */
.cards { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card h3 { font-size: 1.2rem; margin-bottom: 12px; }
.card p { color: var(--text-toned); font-size: .975rem; }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.step {
  display: grid; grid-template-columns: 76px 1fr; gap: 20px;
  padding: 26px 0; border-top: 1px solid var(--border);
}
.step:last-child { border-bottom: 1px solid var(--border); }
.step-num {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700;
  color: var(--accent); line-height: 1.2;
}
.step h3 { font-size: 1.2rem; margin-bottom: 10px; }
.step p { color: var(--text-toned); max-width: 62ch; }
@media (max-width: 560px) {
  .step { grid-template-columns: 1fr; gap: 8px; }
  .step-num { font-size: 1.1rem; }
}

/* ---------- Principles ---------- */
.principles { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.principle {
  margin: 0; padding: 0 0 0 22px;
  border-left: 3px solid var(--accent);
}
.principle-claim {
  font-family: var(--font-serif); font-size: 1.2rem; font-weight: 700;
  margin-bottom: 12px; line-height: 1.32;
}
.principle p:last-child { color: var(--text-toned); font-size: .975rem; }

/* ---------- Contact ---------- */
.section-contact { background: var(--bg-alt); }
.contact-inner { max-width: 62ch; }
.contact-inner h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: 18px; }
.contact-inner .lead { margin-bottom: 34px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 34px 0; font-size: .9rem; color: var(--text-muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.site-footer a { color: var(--text-toned); text-decoration-color: var(--border); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--accent); }

/* ---------- Scroll reveal ----------
   Scoped to .js (set by an inline script in <head>). Without JS the
   selector never matches, so nothing is ever hidden. */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1);
}
/* Stagger children within a group */
.cards .reveal.is-visible:nth-child(2),
.principles .reveal.is-visible:nth-child(2) { transition-delay: .08s; }
.cards .reveal.is-visible:nth-child(3),
.principles .reveal.is-visible:nth-child(3) { transition-delay: .16s; }
.cards .reveal.is-visible:nth-child(4) { transition-delay: .24s; }
.hero .reveal.is-visible:nth-child(2) { transition-delay: .07s; }
.hero .reveal.is-visible:nth-child(3) { transition-delay: .14s; }
.hero .reveal.is-visible:nth-child(4) { transition-delay: .21s; }

/* Respect the user's motion preference — also disables smooth scrolling */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .js .reveal.is-visible { transition: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
