/*
 * Styles for the 404 page and /farewell/<slug>/ pages (via _layouts/page.html).
 * Plain CSS (no Sass): tokens and type mirror the inline styles in index.html; keep the two in sync.
 */

:root {
  --ground: #f5f6f8;
  --surface: #ffffff;
  --ink: #161a2c;
  --ink-2: #3a4054;
  --muted: #5b6275;
  --line: #dde1e8;
  --line-strong: #c3c9d4;
  --accent: #2f4f86;
  --accent-ink: #ffffff;
  --ok: #1f7a4a;
  --shadow: 0 1px 2px rgba(22, 26, 44, 0.05), 0 8px 24px -12px rgba(22, 26, 44, 0.18);
  --shadow-lift: 0 2px 4px rgba(22, 26, 44, 0.06), 0 18px 36px -16px rgba(22, 26, 44, 0.28);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #10131b;
    --surface: #171b26;
    --ink: #e8eaf0;
    --ink-2: #c4c9d5;
    --muted: #99a0b1;
    --line: #252b39;
    --line-strong: #343c4e;
    --accent: #a6c0f2;
    --accent-ink: #10131b;
    --ok: #79d3a1;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 20px 40px -16px rgba(0, 0, 0, 0.8);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-optical-sizing: auto;
  font-feature-settings: "cv11";
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--accent); color: var(--accent-ink); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 10;
  background: var(--ink); color: var(--ground);
  padding: 0.5rem 0.9rem; border-radius: 6px; text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
}
.skip:focus { top: 1rem; }

.page {
  max-width: 50rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) 1.25rem 2.5rem;
}

/* Text links inside prose */
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 0.18em;
}
.prose a:hover { text-decoration-color: currentColor; }
.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
}

/* ---------- Back link ---------- */
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.back svg { width: 1rem; height: 1rem; transition: transform 0.3s var(--ease-out); }
.back:hover { color: var(--accent); }
.back:hover svg { transform: translateX(-3px); }

/* ---------- Farewell ---------- */
.farewell__header {
  margin: clamp(2rem, 5vh, 3.25rem) 0 2.5rem;
}
.farewell__title {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 30;
  font-optical-sizing: auto;
  font-weight: 480;
  font-size: clamp(2.75rem, 1.6rem + 4.2vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.farewell__tagline {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 50;
  font-style: italic;
  font-weight: 360;
  font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.5rem);
  line-height: 1.4;
  color: var(--ink-2);
  margin: 0 0 1.25rem;
}
.farewell__meta {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}
.farewell__meta .years { font-variant-numeric: lining-nums tabular-nums; }
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.85rem;
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.farewell__story {
  max-width: 38rem;
  font-family: var(--serif);
  font-variation-settings: "SOFT" 50;
  font-weight: 360;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.65;
  color: var(--ink-2);
}
.farewell__story p { margin: 0 0 1.15em; text-wrap: pretty; }
.farewell__story strong { font-weight: 560; color: var(--ink); }

.section-title {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 30;
  font-weight: 450;
  font-size: clamp(1.5rem, 1.25rem + 0.9vw, 1.875rem);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 4.5rem 0 1.75rem;
}

.gallery {
  display: grid;
  gap: 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shot { margin: 0; }
.shot__link { display: block; border-radius: 10px; }
.shot img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.shot__link:hover img {
  box-shadow: var(--shadow-lift);
  transform: translateY(-3px);
}
.shot figcaption {
  margin-top: 0.85rem;
  max-width: 38rem;
  font-size: 0.9375rem;
  color: var(--muted);
  text-wrap: pretty;
}
.farewell__note {
  margin: 3rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- 404 ---------- */
.notfound {
  text-align: center;
  max-width: 34rem;
  margin: 0 auto;
  padding-top: clamp(1rem, 5vh, 3rem);
}
.notfound__code {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 30;
  font-weight: 300;
  font-size: clamp(4.5rem, 3rem + 6vw, 7rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-variant-numeric: lining-nums;
}
.notfound__title {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 30;
  font-weight: 480;
  font-size: clamp(1.875rem, 1.4rem + 1.8vw, 2.625rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.notfound__blurb {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 50;
  font-weight: 360;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 auto 2.25rem;
  max-width: 30rem;
  text-wrap: pretty;
}
.notfound__img {
  width: min(100%, 22rem);
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0 auto 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  box-shadow: 0 6px 16px -8px var(--accent);
  transition: box-shadow 0.2s ease, transform 0.2s var(--ease-out);
}
.button svg { width: 1rem; height: 1rem; }
.button:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -8px var(--accent); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 6rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.contact__email {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 50;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.2s ease;
}
.contact__email:hover { text-decoration-color: var(--accent); }
.copy {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  touch-action: manipulation;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy svg { width: 0.95rem; height: 0.95rem; }
.copy__done { display: none; }
.copy.is-copied { color: var(--ok); border-color: var(--ok); }
.copy.is-copied .copy__idle { display: none; }
.copy.is-copied .copy__done { display: inline-flex; }
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__links a { color: var(--muted); text-decoration: none; }
.footer__links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }

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