/* Live Well Map: the page as a hand-made book page (from brand/concepts/atlas-prototype).
   Base = brand/concepts/brand-board.html (paper, vignette, ink green, area colors).
   Hand-drawn character lives in decoration only; text stays clean and AA. */

/* tokens: css/theme.css */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    var(--grain),
    var(--fibers),
    radial-gradient(1400px 1100px at 0% 85%, rgba(169, 184, 143, 0.5), transparent 60%),
    radial-gradient(1300px 900px at 100% 0%, rgba(227, 203, 146, 0.55), transparent 60%);
  background-attachment: scroll;
  overflow-x: hidden;
  overflow-x: clip; /* no sideways scroll, and unlike hidden it lets the results map stay pinned (sticky) */
}
/* soft burnt-edge vignette, like an old page under a lamp */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  box-shadow: inset 0 0 140px rgba(70,52,20,0.16), inset 0 0 40px rgba(70,52,20,0.08);
}
main, header { position: relative; z-index: 1; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--ink); }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

/* drawn strokes get the pen tremor */
.drawn { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; filter: url(#ink-wobble-fine); }

/* ---------------------------------------------------------------- header */
.atlas-head-in {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 28px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.atlas-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.atlas-brand img { flex: none; display: block; }
.atlas-word {
  font-family: Allura, cursive;
  font-size: 2.15rem;
  line-height: 1;
  color: var(--word);
  -webkit-text-stroke: 0.6px var(--word);
  white-space: nowrap;
  padding-top: 4px;
}
.atlas-nav ul { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.ink-link {
  position: relative;
  font-weight: 500;
  font-size: 1.0625rem;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 0;
}
.ink-link::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; bottom: 0;
  height: 7px;
  background: url("/assets/atlas/pen-line.svg") center / 100% 100% no-repeat;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(.6, .1, .3, 1);
}
.ink-link:hover::after, .ink-link:focus-visible::after { transform: scaleX(1); }
.ink-btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper) !important;
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 4px 12px -6px rgba(70,52,20,0.45);
  transition: background 0.2s ease, transform 0.2s ease;
}
.ink-btn:hover { background: #1f331d; transform: translateY(-1px); }
.atlas-menu-btn { display: none; }

/* the double pen rule under the header */
.pen-rule {
  max-width: 1320px;
  height: 9px;
  margin: 0 auto;
  padding: 0 28px;
  background:
    url("/assets/atlas/pen-line.svg") 28px 0 / calc(100% - 56px) 5px no-repeat,
    url("/assets/atlas/pen-line.svg") 28px 4px / calc(100% - 56px) 5px no-repeat;
  opacity: 0.38;
  filter: url(#ink-wobble);
}

/* ---------------------------------------------------------------- hero */
.atlas-hero { position: relative; padding: 10px 20px 26px; }
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 1320px;
  margin: 0 auto;
}
.hero-flourish { width: 120px; height: 30px; margin: 0 0 2px; }
.atlas-hero h1 {
  font-family: var(--font-fell);
  font-weight: 400;
  font-size: clamp(2.2rem, 3.4vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
.atlas-hero h1 .hero-h1-break { display: block; }
.atlas-hero h1 em { font-style: italic; color: var(--word); }
.hero-content .hero-sub {
  margin: 12px auto 18px;
  max-width: 40em;
  font-size: clamp(1.0625rem, 1.3vw, 1.2rem);
  line-height: 1.5;
  color: var(--ink-soft);
}

/* the inked search form */
.inked-search {
  position: relative;
  display: flex;
  align-items: stretch;
  width: min(760px, 100%);
  padding: 7px 7px 7px 10px;
  background: var(--paper-light);
  border-radius: 18px;
  box-shadow: 0 10px 26px -14px rgba(70,52,20,0.45), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  text-align: left;
}
/* the border is a pen line: a real border, roughened by the tremor filter */
.inked-search::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1.6px solid rgba(44, 68, 41, 0.78);
  border-radius: 19px 17px 20px 18px;
  pointer-events: none;
  filter: url(#ink-wobble);
}
.inked-search .f { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 4px 14px; min-width: 0; cursor: text; }
.inked-search .f-near { flex: 0.7; }
.inked-search .f-label { font-size: 0.9375rem; font-weight: 600; color: var(--ink-soft); line-height: 1.2; }
.inked-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  padding: 3px 0 2px;
  font: 500 1.0625rem/1.4 var(--font-sans);
  color: var(--ink);
}
.inked-search input::placeholder { color: var(--ink-soft); opacity: 1; }
.inked-search .f:focus-within { background: rgba(234, 220, 184, 0.45); border-radius: 12px; }
.inked-search .f-sep {
  width: 2px;
  margin: 10px 2px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 40' preserveAspectRatio='none'><path d='M1 0 C 1.6 10, .4 22, 1.2 40' stroke='%232c4429' stroke-width='1.2' fill='none' opacity='.45'/></svg>") center / 100% 100% no-repeat;
}
.inked-search button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 26px;
  border: 0;
  border-radius: 13px;
  background: var(--ink);
  color: var(--paper);
  font: 600 1.0625rem var(--font-sans);
  cursor: pointer;
  transition: background 0.2s ease;
}
.inked-search button svg { width: 20px; height: 20px; }
.inked-search button:hover { background: #1f331d; }
.proof {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
  font-size: 1.0625rem;
  color: var(--ink-soft);
  text-wrap: balance;
}
.proof svg { width: 22px; height: 12px; flex: none; }
.proof svg.flip { transform: scaleX(-1); }

/* ---------------------------------------------------------------- the next page (torn sheet) */
.atlas-sheet {
  position: relative;
  margin-top: 26px;
  padding: 26px 20px 80px;
  background-color: var(--paper-deep);
  background-image: var(--grain), var(--fibers), radial-gradient(90% 120% at 50% 0%, rgba(255, 250, 235, 0.55), transparent 60%);
  text-align: center;
}
/* deckled top edge, with a hint of the page's thickness */
.atlas-sheet::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -20px;
  height: 22px;
  background-color: var(--paper-deep);
  background-image: var(--grain);
  -webkit-mask: url("/assets/atlas/deckle-edge.svg") 0 0 / 1200px 100% repeat-x;
  mask: url("/assets/atlas/deckle-edge.svg") 0 0 / 1200px 100% repeat-x;
  filter: drop-shadow(0 -1px 0 rgba(70,52,20,0.28));
}
.sheet-in { max-width: 980px; margin: 0 auto; }
.section-orn { width: min(360px, 90%); height: 40px; display: block; margin: 0 auto 14px; }
.eyebrow {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.atlas-sheet h2 {
  font-family: var(--font-fell);
  font-weight: 400;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  line-height: 1.1;
  margin: 6px 0 12px;
}
.lede { max-width: 36em; margin: 0 auto; font-size: 1.125rem; color: var(--ink-soft); }
.plates {
  list-style: none;
  margin: 34px auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.plates li { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.plates img { width: 100%; max-width: 200px; height: 150px; object-fit: contain; mix-blend-mode: multiply; }
.plates span {
  font-family: var(--font-fell);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--ink);
  padding: 0 10px 4px;
  background: url("/assets/atlas/pen-line.svg") center bottom / 100% 6px no-repeat;
}

/* ---------------------------------------------------------------- phones */
@media (max-width: 860px) {
  .atlas-head-in { padding: 10px 16px 8px; gap: 10px; }
  .atlas-brand { gap: 8px; }
  .atlas-brand img { width: 40px; height: 40px; }
  .atlas-word { font-size: 1.7rem; }
  .atlas-menu-btn {
    display: inline-grid;
    place-items: center;
    width: 46px; height: 46px;
    border: 1.5px solid rgba(44, 68, 41, 0.6);
    border-radius: 50%;
    background: var(--paper-light);
    color: var(--ink);
    cursor: pointer;
  }
  .atlas-menu-btn svg { width: 24px; height: 24px; }
  .atlas-nav { position: relative; }
  .atlas-nav ul {
    display: none;
    position: absolute;
    right: 0; top: 54px;
    z-index: 30;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 220px;
    padding: 12px;
    background: var(--paper-light);
    border: 1.5px solid rgba(44, 68, 41, 0.5);
    border-radius: 14px;
    box-shadow: 0 16px 34px -16px rgba(70,52,20,0.45);
  }
  .atlas-nav ul.is-open { display: flex; }
  .atlas-nav .ink-link { display: block; padding: 10px 8px; }
  .atlas-nav .ink-btn { justify-content: center; margin-top: 6px; }
  .pen-rule { padding: 0 16px; background-size: calc(100% - 32px) 5px; background-position: 16px 0, 16px 4px; }

  .atlas-hero { padding: 10px 16px 18px; }
  .hero-flourish { width: 116px; height: 31px; }
  .atlas-hero h1 { font-size: clamp(2rem, 8.4vw, 2.5rem); }
  .hero-content .hero-sub { margin: 8px auto 14px; }
  .inked-search { flex-wrap: wrap; padding: 6px; border-radius: 16px; }
  .inked-search .f { flex: 1 1 100%; padding: 8px 12px; }
  .inked-search .f-sep {
    flex: 1 1 100%;
    width: auto; height: 2px; margin: 0 10px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 2' preserveAspectRatio='none'><path d='M0 1 C 30 1.6, 60 .4, 100 1.2' stroke='%232c4429' stroke-width='1' fill='none' opacity='.4' vector-effect='non-scaling-stroke'/></svg>") center / 100% 100% no-repeat;
  }
  .inked-search button { flex: 1 1 100%; justify-content: center; margin-top: 6px; min-height: 52px; }
  .proof { gap: 6px; text-align: center; }
  .proof svg { display: none; }
  .plates { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
  .plates img { height: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------- the welcome (js/intro.js)
   Full screen, by itself, on the first page of a visit. html.wwa-intro covers the page with parchment
   from the first paint (no flash of the page), the stage draws on top; .wwa-intro-out lets the page
   show behind the stage while the mark and the name fly into the header. */
html.wwa-intro { overflow: hidden; }
html.wwa-intro::after { content: ""; position: fixed; inset: 0; z-index: 9998; background: #f1e6c8; }
html.wwa-intro-out::after { display: none; }
html.wwa-intro .atlas-brand { visibility: hidden; }
#wwa-intro { position: fixed; inset: 0; z-index: 9999; overflow: hidden; cursor: pointer; opacity: 0; }
#wwa-intro.is-on { opacity: 1; }
#wwa-intro .wi-bg { position: absolute; inset: 0; background:
  radial-gradient(ellipse 70% 60% at 50% 46%, #faf3df 0%, #f1e6c8 48%, #dcc9a0 100%);
  box-shadow: inset 0 0 220px rgba(70,52,20,0.45), inset 0 0 60px rgba(70,52,20,0.25); }
#wwa-intro .wi-bg::after { content: ""; position: absolute; inset: 0; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .34 0 0 0 0 .16 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E"); }
#wwa-intro .wi-dark { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 46%, #2a1d0c 0%, #120c05 75%); }
#wwa-intro .wi-candle { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: radial-gradient(ellipse 55% 45% at 50% 44%, rgba(255, 214, 140, .9), rgba(255,250,240,0) 70%); }
#wwa-intro .wi-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
#wwa-intro .wi-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#wwa-intro .wi-lockup { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: min(2.4vh, 22px); padding: 0 4vw; }
#wwa-intro .wi-markbox { position: relative; width: min(30vh, 46vw, 290px); aspect-ratio: 1; }
#wwa-intro .wi-mark, #wwa-intro .wi-mark svg { display: block; width: 100%; height: 100%; transform-origin: 0 0; }
#wwa-intro .wi-flash { position: absolute; inset: -40%; border-radius: 50%; opacity: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 246, 214, 1) 0, rgba(227, 203, 146, .75) 22%, rgba(255,250,240,0) 62%); }
#wwa-intro .wi-namebox { position: relative; width: min(92vw, 1080px); }
#wwa-intro .wi-name { display: block; width: 100%; height: auto; overflow: visible; }
#wwa-intro .wi-nib { position: absolute; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: #fffaf0; box-shadow: 0 0 8px 3px rgba(70,52,20,0.45), 0 0 26px 10px rgba(70,52,20,0.45), 0 0 60px 18px rgba(70,52,20,0.30); }
#wwa-intro .wi-flourish { width: min(56vw, 520px); height: auto; overflow: visible; margin-top: -1vh; }
#wwa-intro .wi-flourish path:first-child { fill: none; stroke: #2c4429; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .75; }
#wwa-intro .wi-gem { fill: #c3962b; opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
#wwa-intro .wi-tag { margin: 0; font: italic 400 clamp(1rem, 2.3vw, 1.6rem) "IM Fell English", Georgia, serif; color: #2c4429; text-transform: uppercase; letter-spacing: .4em; opacity: 0; text-align: center; }
#wwa-intro .wi-skip { position: absolute; right: 0; left: 0; bottom: max(3.5vh, 40px); text-align: center; font: italic 400 .95rem "IM Fell English", Georgia, serif; color: #2c4429; opacity: 0; }
#wwa-intro .wi-tag { text-wrap: balance; max-width: 92vw; }
@media (max-width: 700px) {
  #wwa-intro .wi-bg { box-shadow: inset 0 0 70px rgba(70,52,20,0.40), inset 0 0 24px rgba(70,52,20,0.22); }
  #wwa-intro .wi-tag { letter-spacing: .22em; }
}
@media (prefers-reduced-motion: reduce) { #wwa-intro { display: none; } html.wwa-intro::after { display: none; } html.wwa-intro { overflow: auto; } html.wwa-intro .atlas-brand { visibility: visible; } }
