/* ============================================================
   TOKENS, warm-stone palette (Pagium brand, exact)
   ============================================================ */
:root {
  /* surfaces */
  --canvas:      #f4f4f2;
  --card:        #fdfdfb;
  --well:        #ebebe8;
  --card-2:      #f1f1ef;

  /* ink scale, warm, single family */
  --ink:         #1b1b1a;
  --ink-mid:     #2a2a28;
  --ink-soft:    #555551;
  --muted:       #777774;
  --faint:       #b3b3ae;

  /* accent, verdigris, single considered accent */
  --accent:      #3f5d50;
  --accent-deep: #314a40;
  --accent-tint: #e3e7e1;

  /* lines + shadows tinted to the canvas hue */
  --hair:        rgba(26,26,25,0.10);
  --hair-soft:   rgba(26,26,25,0.06);
  --hair-strong: rgba(26,26,25,0.16);
  --sh-1: 0 1px 2px rgba(30,30,28,0.05), 0 2px 8px rgba(30,30,28,0.04);
  --sh-2: 0 2px 6px rgba(30,30,28,0.06), 0 14px 36px rgba(30,30,28,0.10);
  --sh-3: 0 4px 12px rgba(30,30,28,0.07), 0 30px 70px rgba(30,30,28,0.14);
  --sh-accent: 0 12px 30px rgba(49,74,64,0.18);

  /* type */
  --font-sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Menlo", monospace;

  /* rhythm */
  --container: 1280px;
  --radius-win: 22px;
  --radius-card: 18px;
  --radius-sm: 11px;
  --radius-pill: 999px;
  --nav-height: 64px;

  /* z scale */
  --z-nav: 100;
  --z-grain: 5;
}

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

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

body {
  margin: 0;
  padding-top: var(--nav-height);
  background-color: var(--canvas);
  /* layered ambient warmth, radial, not a 45deg fade */
  background-image:
    radial-gradient(1200px 720px at 82% -8%, rgba(63,93,80,0.07), transparent 60%),
    radial-gradient(900px 600px at -6% 8%, rgba(226,226,222,0.55), transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

/* subtle grain overlay to break flatness */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

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

a { color: inherit; text-decoration: none; }

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

::selection { background: rgba(63,93,80,0.18); color: var(--ink); }

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 64px);
}

section { position: relative; }

.section-pad {
  padding-block: clamp(76px, 11vw, 152px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}

h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--ink);
  text-wrap: balance;
  margin: 0;
}

.h2 {
  font-size: clamp(30px, 4.4vw, 50px);
  letter-spacing: -0.032em;
  line-height: 1.04;
}

.lead {
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.62;
  text-wrap: pretty;
}

.section-head { max-width: 760px; }
.section-head .lead { margin-top: 18px; }
.section-head .h2 { margin-top: 16px; }

/* glyph chips for file kinds */
.glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  border: 1px solid var(--hair);
  color: var(--ink-soft);
  background: var(--card);
}
.glyph.h   { color: var(--accent-deep); background: var(--accent-tint); border-color: rgba(63,93,80,0.22); }
.glyph.md  { color: #6a4a2a; background: #efe2cf; border-color: rgba(106,74,42,0.20); }
.glyph.pdf { color: #7a3030; background: #f0dcd8; border-color: rgba(122,48,48,0.20); }
.glyph.img { color: #43577a; background: #dce3ef; border-color: rgba(67,87,122,0.20); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  --b: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .22s cubic-bezier(.2,.7,.2,1), box-shadow .22s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: var(--accent);
  color: #f6f5f1;
  box-shadow: var(--sh-accent);
}
.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(49,74,64,0.26);
}

.btn-ink {
  background: var(--ink);
  color: #f4efe4;
  box-shadow: var(--sh-2);
}
.btn-ink:hover { background: var(--ink-mid); transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hair-strong);
}
.btn-ghost:hover { background: var(--card); border-color: var(--ink); transform: translateY(-1px); }

.btn .arrow { transition: transform .22s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--accent-deep);
  border-bottom: 1px solid rgba(49,74,64,0.32);
  padding-bottom: 1px;
  transition: border-color .2s ease, gap .2s ease;
}
.textlink:hover { border-color: var(--accent-deep); gap: 9px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: rgba(244,244,242,0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transform: translateY(0);
  transition: transform .28s cubic-bezier(0.32,0.72,0,1), border-color .25s ease, background .25s ease, box-shadow .25s ease;
  will-change: transform;
}
.nav.nav-hidden:not(:focus-within) {
  transform: translateY(calc(-100% - 2px));
}
.nav.scrolled {
  border-bottom-color: var(--hair);
  box-shadow: 0 6px 24px rgba(30,30,28,0.06);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.wordmark .seal {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--canvas);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 17px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a:not(.btn) {
  display: inline-block;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  transition: color .18s ease, background .18s ease;
}
.nav-links a:not(.btn):hover { color: var(--ink); background: var(--accent-tint); }
.nav-cta { padding: 10px 18px; font-size: 14px; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(48px, 7vw, 86px); padding-bottom: clamp(64px, 9vw, 120px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.18fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
.hero-copy { max-width: 560px; }
.hero h1 {
  font-size: clamp(38px, 6.2vw, 70px);
  font-weight: 700;
  letter-spacing: -0.038em;
  line-height: 0.98;
  margin-top: 22px;
}
.hero-lede {
  margin-top: 16px;
  max-width: 52ch;
  font-size: clamp(16px, 1.5vw, 18.5px);
  color: var(--ink-soft);
  line-height: 1.62;
  text-wrap: pretty;
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
}
.hero-meta {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.hero-meta b { color: var(--ink-soft); font-weight: 600; }

/* ----- macOS Vault window mock ----- */
.win {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--radius-win);
  box-shadow: var(--sh-3);
  overflow: hidden;
  position: relative;
}
.win-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border-bottom: 1px solid var(--hair-soft);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #e2a09a; } .dot.y { background: #e3c884; } .dot.g { background: #a9c39a; }
.win-bar .title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.vault-body { display: grid; grid-template-columns: 188px 1fr; min-height: 320px; }
.vault-side {
  border-right: 1px solid var(--hair-soft);
  background: var(--card-2);
  padding: 12px 10px;
}
.side-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 4px 8px 8px;
}
.file {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: default;
  transition: background .16s ease;
}
.file + .file { margin-top: 2px; }
.file:hover { background: rgba(226,226,222,0.55); }
.file.active {
  background: var(--accent-tint);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(63,93,80,0.18);
}
.file .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vault-preview { padding: 26px 28px; }
.vault-preview .kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.vault-preview h4 {
  margin: 12px 0 10px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.vault-preview p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 42ch;
}
.preview-chips { display: flex; gap: 7px; margin-top: 20px; flex-wrap: wrap; }
.chip-mini {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--well);
  border: 1px solid var(--hair-soft);
}
.preview-link-hint {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-deep);
}
.preview-link-hint .pl {
  border-bottom: 1px dashed rgba(63,93,80,0.5);
  padding-bottom: 1px;
}

.faq-list {
  margin-top: 44px;
  display: grid;
  gap: 0;
  max-width: 880px;
  border-top: 1px solid var(--hair);
}
.faq-item {
  border-bottom: 1px solid var(--hair);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 24px 8px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color .18s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent-deep); }
.faq-q-mark {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--hair-strong);
  display: grid; place-items: center;
  position: relative;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .2s ease;
}
.faq-q-mark::before, .faq-q-mark::after {
  content: ""; position: absolute;
  background: var(--ink-soft);
}
.faq-q-mark::before { width: 11px; height: 1.5px; }
.faq-q-mark::after { width: 1.5px; height: 11px; transition: opacity .25s ease; }
.faq-item[open] .faq-q-mark { transform: rotate(180deg); border-color: var(--accent); }
.faq-item[open] .faq-q-mark::after { opacity: 0; }
.faq-a {
  padding: 0 56px 26px 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.66;
  max-width: 70ch;
  text-wrap: pretty;
}
.faq-a b { color: var(--ink); font-weight: 600; }

.footer { margin-top: 0; }
.bottom-banner + #faq {
  padding-top: clamp(28px, 4vw, 48px);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--hair);
  padding-block: 44px 56px;
  margin-top: clamp(60px, 8vw, 110px);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.footer .wordmark { font-size: 18px; }
.footer-by { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a {
  font-size: 13.5px;
  color: var(--ink-soft);
  transition: color .18s ease;
}
.footer-links a:hover { color: var(--accent-deep); }
.footer-contact {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.footer-contact a { color: var(--accent-deep); }

/* skip link */
.skip {
  position: absolute;
  left: 14px; top: -60px;
  background: var(--ink);
  color: var(--canvas);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 200;
  transition: top .2s ease;
}
.skip:focus { top: 12px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

.wordmark { gap: 0; letter-spacing: -.01em; }
.wordmark .wm-i, .hero h1 .i {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.hero h1 { letter-spacing: -.025em; }
.hero h1 .i { letter-spacing: 0; }
.hero .eyebrow { text-transform: none; letter-spacing: .04em; }
#download { scroll-margin-top: calc(var(--nav-height) + 16px); }

.home-section {
  border-top: 1px solid var(--hair);
  padding-block: clamp(42px, 6vw, 88px);
}
.home-section .section-head .h2 { margin-top: 0; }
.site-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin-top: 24px;
}
.site-steps li {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  background: var(--card);
  overflow-wrap: anywhere;
}
.site-steps h3 { font-size: 20px; line-height: 1.25; }
.site-steps p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}
.site-steps { list-style: none; padding: 0; margin-bottom: 0; }
.download-main { padding-block: clamp(36px, 7vw, 88px) 80px; overflow-wrap: anywhere; }
.download-main h1, .download-main h2 { line-height: 1.13; letter-spacing: -.025em; }
.download-main h1 { font-size: clamp(36px, 6vw, 68px); }
.download-main h2 { font-size: clamp(25px, 3vw, 37px); margin: 0 0 20px; }
.download-section { margin-top: clamp(32px, 5vw, 56px); }

#ai { padding-block: clamp(36px, 4vw, 64px); }
.home-basics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
}
.home-basics h3 { font-size: clamp(24px, 2.4vw, 34px); line-height: 1.15; }
.home-basics .lead { margin: 12px 0 0; }

@media (max-width: 768px) {
  body { font-size: 16px; }
  .hero-grid { grid-template-columns: 1fr; }
  .home-basics { grid-template-columns: 1fr; }
  .hero-copy { max-width: 100%; }
  .vault-body { grid-template-columns: 150px 1fr; }
}

@media (max-width: 560px) {
  .nav-inner { gap: 8px; }
  .nav-links { gap: 0; }
  .nav-links a:not(.btn), .nav-cta { padding-inline: 8px; }
  .vault-body { grid-template-columns: 1fr; }
  .vault-side { border-right: none; border-bottom: 1px solid var(--hair-soft); }
  .hero-cta-row .btn { flex: 1; }
  .faq-a { padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
