/* =============================================================
   Lookout Mountain Publications
   Shared stylesheet for every page.
   Edit the variables in :root to retune the whole site at once.
   ============================================================= */

/* ---- 1. Design tokens -------------------------------------- */
:root {
  /* Palette */
  --paper:        #f6f2e9;   /* warm off-white background */
  --paper-raised: #fcfaf4;   /* cards, raised surfaces */
  --ink:          #221e18;   /* primary text (warm near-black) */
  --ink-soft:     #4f473c;   /* secondary text */
  --muted:        #837a6c;   /* captions, meta, footer */
  --teal:         #117a7a;   /* single accent */
  --teal-deep:    #0c5c5c;   /* accent on hover/active */
  --line:         #e5ddcd;   /* hairlines, borders */

  /* Type */
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --measure: 38rem;          /* comfortable reading column */
  --wrap: 70rem;             /* outer layout width */

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  /* Misc */
  --radius: 3px;
  --transition: 160ms ease;
}

/* ---- 2. Reset & base --------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.08rem, 0.96rem + 0.5vw, 1.22rem);
  line-height: 1.72;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a {
  color: var(--teal);
  text-decoration: none;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.5px;
  transition: color var(--transition);
}
a:hover { color: var(--teal-deep); text-decoration: underline; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
  color: var(--ink);
}
h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.1rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 var(--space-2); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---- 3. Layout helpers ------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.prose { max-width: var(--measure); }
.prose p,
.prose ul,
.prose ol { margin-bottom: var(--space-3); }
.prose h2 { margin-top: var(--space-4); }
.prose h3 { margin-top: var(--space-3); }

.section { padding-block: clamp(var(--space-4), 8vw, var(--space-6)); }
.section--tight { padding-block: var(--space-4); }

.lede {
  font-size: 1.18em;
  line-height: 1.6;
  color: var(--ink-soft);
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  margin: 0 0 var(--space-1);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; color: var(--paper); }

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

/* ---- 4. Site header & navigation --------------------------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, white);
  position: sticky;
  top: 0;
  z-index: 50;
  -webkit-backdrop-filter: saturate(120%) blur(6px);
  backdrop-filter: saturate(120%) blur(6px);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-weight: 600;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand:hover .brand__name { color: var(--teal); }
.brand__mark { width: 32px; height: 32px; flex: none; color: var(--teal); }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name {
  font-size: 1.02rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: color var(--transition);
}
.brand__sub {
  font-size: 0.62rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-top: 0.18rem;
}
@media (max-width: 380px) {
  .brand__name { font-size: 0.92rem; letter-spacing: 0.1em; }
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  align-items: center;
  gap: 0.4rem;
}
.nav-toggle__bars {
  display: inline-block;
  width: 18px;
  height: 12px;
  position: relative;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after,
.nav-toggle__bars span {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--ink);
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars span { top: 5px; }
.nav-toggle__bars::after { bottom: 0; }

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
  margin: 0;
  padding: 0;
}
.nav-list a {
  color: var(--ink-soft);
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  padding-block: 0.4rem;
}
.nav-list a:hover { color: var(--teal); text-decoration: none; }
.nav-list a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -1.5px 0 var(--teal);
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 30px -22px rgba(0, 0, 0, .4);
    padding: 0.5rem clamp(1.25rem, 5vw, 2.5rem) 1rem;
    display: none;
  }
  .nav-list.is-open { display: flex; }
  .nav-list li { width: 100%; }
  .nav-list a {
    display: block;
    width: 100%;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.06rem;
  }
  .nav-list li:last-child a { border-bottom: 0; }
  .nav-list a[aria-current="page"] { box-shadow: none; color: var(--teal); }
}

/* ---- 5. Buttons -------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  padding: 0.62rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--teal);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--teal); }
.btn--ghost:hover { background: color-mix(in srgb, var(--teal) 9%, transparent); color: var(--teal-deep); text-decoration: none; }
.btn__arrow { transition: transform var(--transition); }
.btn:hover .btn__arrow { transform: translateX(2px); }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: default; pointer-events: none; }

/* ---- 6. Hero ----------------------------------------------- */
.hero { padding-block: clamp(var(--space-4), 9vw, var(--space-6)); }
.hero__inner { max-width: 44rem; }
.hero h1 { margin-bottom: var(--space-3); }
.hero .lede { margin-bottom: var(--space-3); }
.hero__rule {
  width: 4.5rem;
  height: 2px;
  background: var(--teal);
  margin-bottom: var(--space-3);
  border: 0;
}

/* ---- 7. Book cards (catalog pattern) ----------------------- */
.book-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: 1fr;
}

.book {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  align-items: start;
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
}
.book:last-child { border-bottom: 0; padding-bottom: 0; }

.book__cover {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 34px -26px rgba(34, 30, 24, .55);
  overflow: hidden;
  background: var(--paper-raised);
  aspect-ratio: 2 / 3;
}
.book__cover img { width: 100%; height: 100%; object-fit: cover; }

.book__title { margin-bottom: 0.25rem; }
.book__subtitle {
  display: block;
  font-size: 1.02rem;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.book__byline {
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: var(--space-2);
}
.book__desc { margin-bottom: var(--space-3); max-width: 34rem; }
.book__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.2rem 0.7rem;
  margin-bottom: var(--space-2);
}

@media (max-width: 560px) {
  .book { grid-template-columns: 1fr; }
  .book__cover { max-width: 220px; }
}

/* ---- 8. Featured block (home / excerpt) -------------------- */
.featured {
  background: var(--paper-raised);
  border-block: 1px solid var(--line);
}
.featured__grid {
  display: grid;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 760px) {
  .featured__grid { grid-template-columns: 230px 1fr; }
}
.featured .book__cover { max-width: 230px; }

/* ---- 9. Mission tiles -------------------------------------- */
.tiles {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: var(--space-3);
}
.tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: var(--space-3);
}
.tile h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.tile p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* ---- 10. Long-form reading (excerpt / about) --------------- */
.reading { max-width: var(--measure); }
.reading p { margin-bottom: var(--space-3); }
.reading h2,
.reading h3 { margin-top: var(--space-4); }
.reading blockquote {
  margin: var(--space-3) 0;
  padding-left: var(--space-3);
  border-left: 2px solid var(--teal);
  color: var(--ink-soft);
  font-style: italic;
}
.reading hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin-block: var(--space-4);
}
.dialogue-speaker {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--teal-deep);
}

.page-head { padding-top: var(--space-5); padding-bottom: var(--space-2); }
.page-head h1 { margin-bottom: var(--space-2); }
.back-link { font-size: 0.95rem; }

.notice {
  border: 1px dashed var(--teal);
  background: color-mix(in srgb, var(--teal) 6%, var(--paper-raised));
  border-radius: var(--radius);
  padding: var(--space-3);
  color: var(--ink-soft);
}
.notice strong { color: var(--ink); }

.excerpt-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.excerpt-nav a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink-soft);
  padding: 0.45rem 0.9rem;
  font-size: 0.98rem;
}
.excerpt-nav a:hover {
  color: var(--teal-deep);
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  text-decoration: none;
}
.excerpt-layout {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, var(--measure));
  gap: clamp(2rem, 6vw, 4rem);
  align-items: start;
}
.excerpt-aside {
  position: sticky;
  top: 6rem;
}
.excerpt-aside .book__cover { margin-bottom: var(--space-3); }
.excerpt-aside h2 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}
.excerpt-aside p {
  color: var(--ink-soft);
  font-style: italic;
}
.excerpt-section-alt {
  background: color-mix(in srgb, var(--paper-raised) 72%, var(--paper));
  border-block: 1px solid var(--line);
}

@media (max-width: 760px) {
  .excerpt-layout { grid-template-columns: 1fr; }
  .excerpt-aside {
    position: static;
    display: grid;
    grid-template-columns: minmax(120px, 180px) 1fr;
    gap: var(--space-3);
    align-items: start;
  }
  .excerpt-aside .book__cover { margin-bottom: 0; }
  .excerpt-aside .btn,
  .excerpt-aside .tag { justify-self: start; }
}

@media (max-width: 520px) {
  .excerpt-aside { grid-template-columns: 1fr; }
  .excerpt-aside .book__cover { max-width: 190px; }
}

/* ---- 11. Footer -------------------------------------------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, var(--ink) 2%);
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-3);
}
.site-footer__brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink-soft); }
.site-footer__brand svg { width: 20px; height: 20px; color: var(--teal); }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--teal); }
.site-footer__meta { font-style: italic; }

/* ---- 12. Founder bio (about page) -------------------------- */
.founder-bio {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: start;
  margin-top: var(--space-3);
}

.founder-bio__portrait {
  margin: 0;
  flex: none;
}

.founder-bio__img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 14px 28px -18px rgba(34, 30, 24, .45);
  object-fit: cover;
  object-position: center 18%;
  aspect-ratio: 3 / 4;
}

.founder-bio__text { min-width: 0; }

@media (max-width: 600px) {
  .founder-bio {
    grid-template-columns: 1fr;
  }
  .founder-bio__img {
    max-width: 220px;
    aspect-ratio: 1;
    object-position: center 20%;
  }
}

/* ---- 13. Decorative peak divider --------------------------- */
.peak-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--line);
  margin-block: var(--space-4);
}
.peak-rule::before,
.peak-rule::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.peak-rule svg { width: 22px; height: 22px; color: var(--teal); opacity: 0.8; }
