/* Tim Wayne Keenan Sr. — memorial
   Palette: coastal fog + mill-finish steel, with titanium heat tint
   (straw → bronze → violet → blue) reserved for the weld bead. */
:root {
  --bg: #e7ebed;
  --surface: #f5f7f8;
  --ink: #1d2a34;
  --muted: #56636e;
  --line: #c6cfd5;
  --link: #335f93;
  --straw: #cfab52;
  --bronze: #a8693b;
  --violet: #6c4e8e;
  --blue: #3f6fa6;
  --btn: #1d2a34;
  --btn-ink: #f5f7f8;
  --ok: #2f6b45;
  --warn: #8a5a12;
  --bad: #9b2c2c;
  --sea: #8fb0c8; --sun: #e9c47e; --rock: #c48a62; --mtn-far: #c3ced6; --mtn-near: #9fb0bc; --snow: #ffffff; --tree: #4f6a5c;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131b22;
    --surface: #1b252e;
    --ink: #e4e9ec;
    --muted: #9ba8b2;
    --line: #2d3a45;
    --link: #8fb4e0;
    --btn: #e4e9ec;
    --btn-ink: #131b22;
    --ok: #7cc396;
    --warn: #e0b46a;
    --bad: #ef8f8f;
    --sea: #2f5674; --sun: #b98a45; --rock: #7d4a32; --mtn-far: #263644; --mtn-near: #30475a; --snow: #c9d6df; --tree: #22362c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131b22; --surface: #1b252e; --ink: #e4e9ec; --muted: #9ba8b2; --line: #2d3a45;
  --link: #8fb4e0; --btn: #e4e9ec; --btn-ink: #131b22; --ok: #7cc396; --warn: #e0b46a; --bad: #ef8f8f;
  --sea: #2f5674; --sun: #b98a45; --rock: #7d4a32; --mtn-far: #263644; --mtn-near: #30475a; --snow: #c9d6df; --tree: #22362c;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem; /* 19px — easy on older eyes */
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 32px, 46rem); margin-inline: auto; }
.wide { width: min(100% - 32px, 72rem); margin-inline: auto; }

/* ---------- top bar ---------- */
.topbar {
  font-family: var(--sans);
  font-size: 1.0625rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1rem;
}
.topbar .home { color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: 0.01em; }
.topbar nav { display: flex; gap: 1.25rem; align-items: center; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a.btn, .topbar nav a.btn:hover { color: var(--btn-ink); }
@media (max-width: 560px) { .topbar nav a:not(.btn) { display: none; } }

/* ---------- buttons & form controls ---------- */
.btn {
  font-family: var(--sans); font-weight: 600; font-size: 1.0625rem; letter-spacing: 0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.6rem 1.25rem;
  background: var(--btn); color: var(--btn-ink);
  border: 2px solid var(--btn); border-radius: 6px;
  text-decoration: none; cursor: pointer;
}
.topbar .btn { min-height: 40px; padding: 0.35rem 1rem; }
.btn:hover { filter: brightness(1.15); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { min-height: 36px; padding: 0.25rem 0.75rem; font-size: 0.95rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; filter: none; }

label { font-family: var(--sans); font-weight: 600; font-size: 1.0625rem; display: block; margin-bottom: 0.35rem; }
.hint { font-family: var(--sans); color: var(--muted); font-size: 0.975rem; font-weight: 400; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%; font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 6px;
  padding: 0.7rem 0.85rem;
}
textarea { min-height: 11rem; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
.field { margin-bottom: 1.5rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(2.5rem, 8vw, 6rem); }
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 8.5vw, 5.75rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
.hero h1 .sr { font-style: italic; font-weight: 300; }
.hero .dates { font-family: var(--sans); font-size: 1.25rem; color: var(--muted); margin: 1rem 0 0; letter-spacing: 0.02em; }

/* the weld bead: Pacific swells running into Colorado peaks */
.weld-wrap { margin-top: clamp(1.5rem, 4vw, 2.5rem); }
svg.weld { width: 100%; height: auto; display: block; overflow: visible; }
.weld-caption { font-family: var(--sans); color: var(--muted); font-size: 0.95rem; display: flex; justify-content: space-between; margin-top: 0.25rem; }

.hero-photo { margin: clamp(2rem, 5vw, 3rem) auto 0; max-width: 34rem; }
.hero-photo img { width: 100%; border-radius: 4px; box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(0,0,0,.45); }

/* ---------- sections ---------- */
section { padding-block: clamp(2.5rem, 7vw, 4.5rem); }
section + section { border-top: 1px solid var(--line); }
h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.75rem, 4.5vw, 2.4rem); line-height: 1.15; margin: 0 0 1.25rem; letter-spacing: -0.01em; text-wrap: balance; }
h3 { font-family: var(--sans); font-weight: 600; font-size: 1.25rem; margin: 0 0 0.25rem; }
.lede { font-size: 1.3rem; line-height: 1.55; }
.prose p { margin: 0 0 1.1rem; max-width: 38em; }
.todo { outline: 2px dashed var(--bronze); outline-offset: 3px; background: color-mix(in srgb, var(--straw) 16%, transparent); }

.gatherings { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.gathering { border-left: 3px solid var(--line); padding: 0.25rem 0 0.25rem 1rem; }
.gathering.ca { border-left-color: var(--blue); }
.gathering.co { border-left-color: var(--straw); }
.gathering p { margin: 0.2rem 0 0; font-family: var(--sans); font-size: 1.0625rem; color: var(--muted); }
.gathering .when { color: var(--ink); font-size: 1.15rem; }

.share-band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.share-band .wrap { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: center; justify-content: space-between; }
.share-band p { margin: 0; max-width: 30em; }

/* ---------- gallery ---------- */
.grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; } }
.tile { position: relative; aspect-ratio: 1; background: var(--surface); border: 0; padding: 0; cursor: zoom-in; overflow: hidden; border-radius: 3px; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .play { position: absolute; inset: auto 8px 8px auto; width: 38px; height: 38px; border-radius: 50%; background: rgba(15,22,28,.72); display: grid; place-items: center; }
.tile .play::after { content: ""; border-left: 12px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 3px; }
.tile .noimg { display: grid; place-items: center; height: 100%; font-family: var(--sans); color: var(--muted); font-size: 0.95rem; padding: 0.5rem; text-align: center; }
.empty { font-family: var(--sans); color: var(--muted); font-size: 1.0625rem; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(8,12,16,.94); display: none; z-index: 50; }
.lightbox.open { display: grid; grid-template-rows: 1fr auto; }
.lightbox .stage { display: grid; place-items: center; min-height: 0; padding: 12px; }
.lightbox .stage img, .lightbox .stage video { max-height: calc(100vh - 110px); max-width: 100%; object-fit: contain; }
.lightbox .bar { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; padding: 12px 16px 18px; color: #dfe5e9; font-family: var(--sans); }
.lightbox .bar .who { font-size: 1.0625rem; }
.lightbox button { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.35); border-radius: 6px; min-height: 44px; min-width: 44px; font: 600 1.0625rem var(--sans); cursor: pointer; padding: 0 0.9rem; }

/* ---------- memories ---------- */
.memories { display: grid; gap: 2.25rem; }
.memory blockquote { margin: 0; font-size: 1.2rem; line-height: 1.65; white-space: pre-wrap; }
.memory .by { font-family: var(--sans); color: var(--muted); margin-top: 0.6rem; font-size: 1.0625rem; }
.memory .by strong { color: var(--ink); font-weight: 600; }

footer { padding-block: 3rem 4rem; font-family: var(--sans); color: var(--muted); font-size: 1rem; }

/* ---------- share page ---------- */
.dropzone {
  border: 2px dashed var(--line); border-radius: 8px; padding: 1.75rem 1rem; text-align: center;
  background: var(--surface); font-family: var(--sans);
}
.dropzone.over { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); }
.dropzone p { margin: 0.5rem 0 0; color: var(--muted); }
.files { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.5rem; font-family: var(--sans); }
.files li { display: grid; grid-template-columns: 48px 1fr auto; gap: 0.75rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem; }
.files .pv { width: 48px; height: 48px; object-fit: cover; border-radius: 3px; background: var(--bg); }
.files .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.files .st { font-size: 0.95rem; color: var(--muted); }
.files .st.ok { color: var(--ok); } .files .st.bad { color: var(--bad); }
.files .rm { background: none; border: 0; color: var(--muted); font: 600 0.95rem var(--sans); cursor: pointer; min-height: 40px; padding: 0 0.5rem; }
progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 3px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--blue); }
progress::-moz-progress-bar { background: var(--blue); }
.notice { font-family: var(--sans); border-left: 3px solid var(--line); padding: 0.4rem 0 0.4rem 0.9rem; margin: 1rem 0; color: var(--muted); }
.notice.bad { border-color: var(--bad); color: var(--bad); }
.notice.ok { border-color: var(--ok); color: var(--ink); }
.done { text-align: left; }
.done h2 { margin-bottom: 0.5rem; }

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