/* ── everline.studio · Guides ──
   Shared styles for the guides index and article pages. Same visual system as
   the landing page (Direction 2a — "Night Shift + the everline"). */

:root {
  --bg:      #121311;
  --bg-2:    #161714;
  --ink:     #edece6;
  --muted:   #b9b8ae;
  --dim:     #8a8b80;
  --accent:  oklch(0.78 0.13 120);
  --line:    #2b2c28;
  --line-2:  #26271f;
  --hair:    #3a3b36;
  --pad:     clamp(20px, 5vw, 60px);
  --maxw:    1180px;
  --prose:   720px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
em.serif, .serif { font-family: "Newsreader", Georgia, serif; font-style: italic; }
.mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* ── Reading progress bar ── */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
}

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px var(--pad); gap: 16px;
  background: transparent;
  transition: padding .28s ease, background-color .28s ease,
              box-shadow .28s ease, backdrop-filter .28s ease;
}
.site-header.is-scrolled {
  padding-top: 14px; padding-bottom: 14px;
  background: rgba(12, 13, 11, 0.82);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 10px 26px rgba(0,0,0,.3);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: .02em; text-decoration: none; position: relative; z-index: 60; }
.brand .tld { color: var(--dim); }
.site-nav { display: flex; gap: 30px; font-size: 14px; color: var(--muted); }
.site-nav a { text-decoration: none; transition: color .15s ease; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.is-active { color: var(--ink); border-bottom: 1px solid var(--accent); padding-bottom: 2px; }

/* Mobile hamburger (button injected by guides.js) */
.nav-toggle { display: none; position: relative; z-index: 60; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; background: transparent; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle-bars { position: relative; width: 24px; height: 13px; }
.nav-toggle-bars span { position: absolute; left: 0; width: 100%; height: 1.5px; background: var(--ink); transition: transform .3s ease, opacity .2s ease, top .3s ease; }
.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 6px; }
.nav-toggle-bars span:nth-child(3) { top: 12px; }
.nav-open .nav-toggle-bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav-open .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle-bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }
@keyframes navfade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 720px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  /* Open: drop the header's backdrop-filter so the fixed overlay is viewport-relative. */
  .site-header.nav-open { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-header.nav-open .site-nav {
    display: flex; position: fixed; inset: 0; margin: 0;
    flex-direction: column; justify-content: center; align-items: flex-start;
    gap: 4px; padding: 0 clamp(24px, 8vw, 56px);
    background: rgba(12, 13, 11, 0.98);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    z-index: 30; animation: navfade .25s ease;
  }
  .site-header.nav-open .site-nav a { font-size: clamp(30px, 9vw, 44px); font-weight: 300; letter-spacing: -.01em; color: var(--ink); padding: 12px 0; border: 0; }
  .site-header.nav-open .site-nav a.is-active { color: var(--accent); border: 0; padding: 12px 0; }
}

/* ── Breadcrumb ── */
.crumbs { font-size: 13px; color: var(--dim); padding: 26px var(--pad) 0; }
.crumbs a { color: var(--dim); text-decoration: none; }
.crumbs a:hover { color: var(--muted); }
.crumbs .sep { margin: 0 8px; opacity: .5; }

/* ── Guides index ── */
/* Only top/bottom here — horizontal padding comes from .wrap, so the intro
   keeps its side margin instead of overriding it to 0. */
.guides-intro { padding-top: clamp(40px, 7vw, 84px); padding-bottom: clamp(28px, 4vw, 44px); position: relative; }
.eyebrow { margin: 0 0 20px; font-size: 13px; letter-spacing: .22em; color: var(--dim); }
.guides-intro h1 {
  margin: 0; font-weight: 300; letter-spacing: -.02em;
  font-size: clamp(38px, 6vw, 66px); line-height: 1.1; max-width: 780px; text-wrap: pretty;
}
.guides-intro h1 em { font-weight: 500; color: var(--accent); }
.guides-intro p { margin: 26px 0 0; max-width: 560px; font-size: clamp(16px, 2vw, 18px); color: var(--muted); }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.card-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin: 0 calc(var(--pad) * -1);
}
.card-grid.wrapped { margin: 0; }
@media (max-width: 720px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--bg); padding: clamp(28px, 3.4vw, 46px) clamp(24px, 3vw, 44px);
  display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit;
  transition: background-color .3s ease;
}
.card:hover { background: var(--bg-2); }
.card .cat { font: 500 11px "IBM Plex Mono", monospace; letter-spacing: .12em; color: var(--accent); text-transform: uppercase; }
.card h2 { margin: 0; font-weight: 500; font-size: clamp(21px, 2.3vw, 27px); line-height: 1.22; letter-spacing: -.01em; }
.card:hover h2 { color: var(--ink); }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.card .meta { margin-top: auto; padding-top: 8px; font-size: 12.5px; color: var(--dim); display: flex; gap: 14px; }
.card .arrow { color: var(--accent); opacity: 0; transform: translateX(-4px); transition: opacity .25s ease, transform .25s ease; }
.card:hover .arrow { opacity: 1; transform: translateX(0); }

/* ── Article ── */
.article { padding: clamp(30px, 5vw, 56px) 0 clamp(48px, 7vw, 96px); }
.article-head { max-width: var(--prose); margin: 0 auto; }
.article-head .cat { font: 500 12px "IBM Plex Mono", monospace; letter-spacing: .14em; color: var(--accent); text-transform: uppercase; }
.article-head h1 {
  margin: 18px 0 0; font-weight: 300; letter-spacing: -.02em;
  font-size: clamp(32px, 5vw, 52px); line-height: 1.12; text-wrap: pretty;
}
.article-head .standfirst { margin: 22px 0 0; font-size: clamp(17px, 2.1vw, 21px); line-height: 1.55; color: var(--muted); font-weight: 300; }
.article-meta { margin: 26px 0 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 13px; color: var(--dim); }
.article-meta .accent { color: var(--accent); }

.prose { max-width: var(--prose); margin: 0 auto; }
.prose > * { margin-inline: auto; }
.prose h2 { margin: 48px 0 0; font-weight: 500; font-size: clamp(23px, 2.6vw, 30px); line-height: 1.25; letter-spacing: -.01em; scroll-margin-top: 90px; }
.prose h3 { margin: 34px 0 0; font-weight: 600; font-size: 19px; line-height: 1.3; }
.prose p { margin: 18px 0 0; font-size: 18px; line-height: 1.75; color: #d9d8d1; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose a:hover { color: var(--accent); }
.prose ul, .prose ol { margin: 18px 0 0; padding-left: 22px; font-size: 18px; line-height: 1.7; color: #d9d8d1; }
.prose li { margin: 10px 0; padding-left: 6px; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose figure { margin: 34px 0 0; }
.prose blockquote {
  margin: 40px 0 0; padding: 4px 0 4px 28px; border-left: 2px solid var(--accent);
  font-family: "Newsreader", Georgia, serif; font-style: italic; font-weight: 400;
  font-size: clamp(21px, 2.6vw, 27px); line-height: 1.45; color: var(--ink); text-wrap: pretty;
}
.prose hr.rule { margin: 44px 0 0; border: 0; height: 1px; background: var(--line); }

/* Callout / key-takeaway box */
.callout {
  max-width: var(--prose); margin: 40px auto 0; padding: 24px 26px;
  background: var(--bg-2); border: 1px solid var(--line); border-left: 2px solid var(--accent);
}
.callout .label { font: 500 11px "IBM Plex Mono", monospace; letter-spacing: .14em; color: var(--accent); text-transform: uppercase; }
.callout p { margin: 10px 0 0; font-size: 16.5px; line-height: 1.6; color: var(--muted); }
.callout ul { margin: 10px 0 0; padding-left: 20px; font-size: 16.5px; color: var(--muted); }

/* FAQ */
.faq { max-width: var(--prose); margin: 48px auto 0; }
.faq h2 { margin: 0 0 6px; font-weight: 500; font-size: clamp(23px, 2.6vw, 30px); }
.faq details { border-top: 1px solid var(--line); padding: 6px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 0; font-weight: 500; font-size: 18px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 18px; color: var(--muted); font-size: 16.5px; line-height: 1.7; }

/* End-of-article CTA */
.cta {
  max-width: var(--prose); margin: 56px auto 0; padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line); background: var(--bg-2); text-align: center;
}
.cta h2 { margin: 0; font-weight: 300; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; }
.cta h2 em { font-weight: 500; color: var(--accent); }
.cta p { margin: 14px auto 0; max-width: 440px; color: var(--muted); font-size: 16px; }
.cta .btn {
  display: inline-block; margin-top: 24px; padding: 14px 30px; background: var(--accent);
  color: var(--bg); font-weight: 600; font-size: 15px; text-decoration: none; transition: opacity .15s ease;
}
.cta .btn:hover { opacity: .85; }

/* Related / more guides */
.more { max-width: var(--prose); margin: 60px auto 0; }
.more .label { font: 500 11px "IBM Plex Mono", monospace; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.more-list { margin: 16px 0 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.more-list a { background: var(--bg); padding: 20px 22px; text-decoration: none; display: flex; justify-content: space-between; gap: 16px; align-items: baseline; transition: background-color .25s ease; }
.more-list a:hover { background: var(--bg-2); }
.more-list .t { font-weight: 500; font-size: 16.5px; }
.more-list .c { font: 500 11px "IBM Plex Mono", monospace; color: var(--accent); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--line); padding: 40px var(--pad);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 13px; color: var(--dim); max-width: var(--maxw); margin: 0 auto;
}
.site-footer a { color: var(--dim); text-decoration: none; }
.site-footer a:hover { color: var(--muted); }
.footer-nav { display: flex; gap: 22px; }
@media (max-width: 560px) { .site-footer { justify-content: center; text-align: center; } }

/* ── Scroll reveals (progressive enhancement) ── */
.js .reveal { opacity: 0; translate: 0 18px; transition: opacity .7s cubic-bezier(.22,.61,.36,1) var(--rd,0s), translate .7s cubic-bezier(.22,.61,.36,1) var(--rd,0s); }
.js .reveal.in { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; translate: 0 0; transition: none; }
  .progress { display: none; }
  .site-header { transition: none; }
  .nav-toggle-bars span { transition: none; }
  .site-header.nav-open .site-nav { animation: none; }
}
