/* Blotar's Traveling Rocks. Light, warm, editorial: cream paper, a serif display face,
   one sunset accent, rope-and-knot dividers (he loved knot tying). */

:root {
  --paper: #faf6ef;
  --paper-2: #f3ece0;
  --card: #fffdf9;
  --ink: #2a241f;
  --muted: #6f655a;
  --line: #e9e0d1;
  --accent: #b5562e;      /* sunsets, motorcycles: the one accent */
  --accent-ink: #fffaf3;
  --accent-soft: #f7e6da;
  --sky: #5b7a93;         /* map start pins only */
  --rope: #c9ab78;
  --rope-dark: #94764a;
  --ok: #3d7a4a;
  --shadow: 0 1px 1px rgb(96 64 32 / 0.04), 0 14px 34px -14px rgb(96 64 32 / 0.22);
  --shadow-lift: 0 2px 2px rgb(96 64 32 / 0.05), 0 22px 44px -16px rgb(96 64 32 / 0.3);
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --font-shout: 'Alfa Slab One', 'Rockwell', Georgia, serif;
  --font-head: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Older names, still used by the admin page and map code */
  --road: var(--accent);
  --road-ink: var(--accent-ink);
  --radius: var(--r-md);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #1a1714;
    --paper-2: #221e1a;
    --card: #25201b;
    --ink: #f1e9dc;
    --muted: #b3a797;
    --line: #37302a;
    --accent: #e48a5c;
    --accent-ink: #1a1714;
    --accent-soft: #3a2a20;
    --sky: #93b1c9;
    --rope: #b89761;
    --rope-dark: #6f5634;
    --ok: #7fbf8c;
    --shadow: 0 1px 1px rgb(0 0 0 / 0.25), 0 14px 34px -14px rgb(0 0 0 / 0.6);
    --shadow-lift: 0 2px 2px rgb(0 0 0 / 0.3), 0 22px 44px -16px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 520px at 85% -120px, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--font-body);
  overflow-x: hidden;
}
/* Faint paper grain over everything */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 2000; opacity: 0.05;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color 0.2s var(--ease); }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.015em; text-wrap: balance; font-optical-sizing: auto; }
h2 { font-size: clamp(1.8rem, 4.2vw, 2.6rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
.aside { font-size: 0.78em; color: var(--muted); white-space: nowrap; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap, .narrow { padding: 0 28px; } }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.eyebrow { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 1100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }

/* Header / nav */
.site-head {
  position: sticky; top: 0; z-index: 1000;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-family: var(--font-shout); font-size: 1.3rem; letter-spacing: 0.02em; color: var(--accent); text-decoration: none; }
.brand:hover { color: var(--accent); }
@media (max-width: 480px) { .brand { font-size: 1.1rem; } }
.nav { display: flex; gap: 4px 22px; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; padding: 4px 0; border-bottom: 1.5px solid transparent; transition: border-color 0.25s var(--ease); }
.nav a:hover, .nav a[aria-current='page'] { border-color: var(--accent); }

/* The shout: his voice */
.shout {
  font-family: var(--font-shout); color: var(--accent);
  text-transform: uppercase; line-height: 0.95; letter-spacing: 0.01em; margin: 0;
}
.shout small { display: block; font-size: 0.4em; color: var(--ink); letter-spacing: 0.08em; margin-bottom: 0.3em; }

/* Home hero: headline left, his photo right */
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 56px; }
.hero h1 { font-size: clamp(2.8rem, 7.4vw, 5.6rem); font-weight: 600; line-height: 0.98; letter-spacing: -0.03em; margin-bottom: 24px; }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
.hero .lead { font-size: 1.2rem; max-width: 34em; color: color-mix(in srgb, var(--ink) 85%, var(--muted)); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 30px; }
.hero figure { margin: 0; justify-self: center; position: relative; width: min(100%, 380px); }
.hero figure img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-lg); box-shadow: var(--shadow-lift); transform: rotate(2deg); border: 8px solid var(--card); }
.hero figure::before {
  content: ''; position: absolute; inset: 18px -18px -18px 18px; border-radius: var(--r-lg);
  background: var(--accent-soft); transform: rotate(-3deg); z-index: -1;
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 44px; }
  .hero figure { width: min(78%, 300px); }
}

/* Rope divider with a knot in the middle */
.rope { display: flex; align-items: center; margin: 72px auto; max-width: 720px; padding: 0 16px; }
.rope::before, .rope::after {
  content: ''; flex: 1; height: 6px; border-radius: 4px;
  background: repeating-linear-gradient(-55deg, var(--rope) 0 5px, var(--rope-dark) 5px 7px);
  opacity: 0.8;
}
.rope svg { width: 60px; height: 38px; flex: none; margin: 0 -2px; }
.rope .under { stroke: var(--rope-dark); }
.rope .over { stroke: var(--rope); }

/* Sections and cards */
section { padding: 8px 0; }
.section { padding-top: 88px; }
.section-head { max-width: 40em; margin-bottom: 32px; }
.section-head p { color: var(--muted); font-size: 1.08rem; margin: 0; }
.card {
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 28px;
}
.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

/* Scrolling photo strip */
.marquee { overflow: hidden; padding: 12px 0 24px; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; gap: 18px; width: max-content; animation: marquee var(--dur, 40s) linear infinite; }
.marquee-track img { height: 230px; width: auto; border-radius: var(--r-md); box-shadow: var(--shadow); border: 5px solid var(--card); }
.marquee-track img:nth-child(odd) { transform: rotate(-1.2deg); }
.marquee-track img:nth-child(even) { transform: rotate(1deg) translateY(8px); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 9px)); } }
@media (max-width: 640px) { .marquee-track img { height: 170px; } }
@media (prefers-reduced-motion: reduce) {
  .marquee { overflow-x: auto; }
  .marquee-track { animation: none; }
  .marquee-track img[aria-hidden] { display: none; }
}

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 20px 20px 18px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font-family: var(--font-head); font-weight: 500; font-size: clamp(2rem, 4.5vw, 2.8rem); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.88rem; }
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Maps */
.map { height: 460px; border-radius: var(--r-lg); box-shadow: var(--shadow); z-index: 0; border: 6px solid var(--card); }
.map.small { height: 260px; border-radius: var(--r-md); border-width: 4px; }
.leaflet-container { font: inherit; background: var(--paper-2); }
.leaflet-popup-content { font-size: 0.95rem; line-height: 1.45; }
.leaflet-popup-content b { font-family: var(--font-head); }
@media (max-width: 640px) { .map { height: 360px; } }

/* Log entries (finds) */
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.entry {
  background: var(--card); border-radius: var(--r-md); padding: 18px 22px;
  box-shadow: var(--shadow); position: relative;
}
.entry::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.entry .where { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.entry .meta { color: var(--muted); font-size: 0.88rem; }
.entry .msg { margin: 10px 0 0; white-space: pre-line; }
.entry img { margin-top: 12px; border-radius: var(--r-sm); max-height: 320px; width: auto; }
.entry.start::before { background: var(--sky); }
.log > li.muted { padding: 8px 0; }

/* Other rocks, on the journey page */
.rock-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.rock-chips a { display: inline-block; padding: 7px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; text-decoration: none; transition: transform 0.25s var(--ease); }
.rock-chips a:hover { transform: translateY(-1px); color: var(--accent); }
.journey-head { padding-top: 40px; padding-bottom: 24px; }
.journey-head h1 { font-size: clamp(2.4rem, 6.5vw, 4.2rem); letter-spacing: -0.03em; line-height: 1; margin-bottom: 14px; }
.entry .meta a { color: inherit; }

/* How it works: heading and code box left, numbered list right */
.how { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
@media (max-width: 820px) { .how { grid-template-columns: 1fr; gap: 32px; } }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 0; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 64px 1fr; gap: 4px 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before {
  content: counter(step, decimal-leading-zero); grid-row: span 2;
  font-family: var(--font-head); font-style: italic; font-weight: 400; font-size: 2.4rem; line-height: 1; color: var(--accent);
}
.steps h3 { margin: 2px 0 2px; }
.steps p { margin: 0; color: var(--muted); }

/* Type-a-code box */
.found { background: var(--accent-soft); border-radius: var(--r-md); padding: 22px 24px; margin-top: 28px; }
.found h3 { margin-bottom: 4px; }
.found p { margin: 0 0 14px; color: var(--muted); }
.found form { display: flex; gap: 8px; }
.found input { flex: 1; min-width: 0; background: var(--card); }

/* Who was Blotar */
.story p { font-size: 1.12rem; }
.story blockquote { margin: 0 0 8px; font-family: var(--font-head); font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.4; letter-spacing: -0.01em; }
.story blockquote p { font-size: inherit; margin: 0; }
.story .by { color: var(--muted); font-size: 0.95rem; margin-bottom: 44px; }
.story .said { font-family: var(--font-shout); color: var(--accent); font-size: clamp(1.6rem, 5vw, 2.4rem); text-transform: uppercase; line-height: 1.05; margin: 18px 0; }

/* Forms */
label { display: block; font-weight: 600; margin: 18px 0 6px; font-size: 0.95rem; }
label .opt { font-weight: 400; color: var(--muted); font-size: 0.88rem; }
input[type='text'], input[type='email'], input[type='password'], input[type='date'], input[type='number'], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 14px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
input[type='file'] { font: inherit; font-size: 0.95rem; }
textarea { min-height: 110px; resize: vertical; }
input[type='checkbox'] { accent-color: var(--accent); width: 18px; height: 18px; vertical-align: middle; }
input:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 1rem var(--font-body); padding: 12px 22px; border-radius: 999px;
  border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  cursor: pointer; text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { color: var(--accent-ink); transform: translateY(-1px); box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn:active { transform: scale(0.98); }
.btn .arrow { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: -10px; border-radius: 50%; background: color-mix(in srgb, var(--accent-ink) 20%, transparent); transition: transform 0.35s var(--ease); }
.btn:hover .arrow { transform: translate(2px, 1px); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.btn.small { padding: 6px 14px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.textlink { font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--accent); padding-bottom: 1px; }
.textlink:hover { color: var(--accent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.error { color: #b3261e; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .error { color: #ff8a80; } }
.note { background: var(--paper-2); border: 1px dashed var(--rope-dark); border-radius: var(--r-sm); padding: 14px 16px; }

/* Rock page */
.rock-hero { padding: 56px 0 28px; text-align: center; }
.rock-hero .shout { font-size: clamp(2.6rem, 12vw, 6rem); }
.rock-hero .badge { display: inline-block; margin-top: 18px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 16px; font-weight: 700; letter-spacing: 0.05em; font-size: 0.95rem; }
.intro { font-size: 1.15rem; text-align: center; }
.thanks { text-align: center; scroll-margin-top: 90px; }
.thanks .newname { font-family: var(--font-shout); color: var(--accent); font-size: clamp(2rem, 8vw, 3.2rem); margin: 6px 0 16px; word-break: break-word; }

/* Footer */
.site-foot { margin-top: 96px; padding: 40px 0 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; text-align: center; }
.site-foot .shout { font-size: 1.3rem; margin-bottom: 6px; }
.site-foot p { margin: 0; }

/* Gentle fade-up as sections scroll into view (home.js adds .reveal only when motion is OK) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
