/* ===== Chris Grant – site styles ===== */
:root {
  --bg: #0b1016;
  --bg-2: #101821;
  --surface: #141e29;
  --surface-2: #1a2633;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #eef1f4;
  --muted: #aab5c1;
  --accent: #ff9b5e;        /* bonfire ember */
  --accent-strong: #ffb27f;
  --accent-ink: #1d0f06;
  --sea: #8cc3e6;
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1180px;
  --narrow: 740px;
  --gutter: clamp(16px, 4vw, 40px);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 .5em; font-optical-sizing: auto; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5.2rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: calc(var(--narrow) + var(--gutter) * 2); }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 36em; }
.empty { color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; }

/* ----- Buttons & links ----- */
.button {
  display: inline-flex; align-items: center; gap: .5em; padding: .8em 1.4em; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font: 600 1rem/1 var(--body); text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: background .2s, transform .2s;
}
.button:hover { background: var(--accent-strong); transform: translateY(-1px); }
.button.ghost { background: rgba(11, 16, 22, .35); color: var(--text); border-color: var(--line-strong); backdrop-filter: blur(6px); }
.button.ghost:hover { border-color: var(--text); background: rgba(11, 16, 22, .55); }
.text-link { display: inline-flex; align-items: center; gap: .4em; color: var(--accent); font-weight: 600; text-decoration: none; }
.text-link svg { transition: transform .2s; }
.text-link:hover svg { transform: translateX(3px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

/* ----- Header ----- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(11, 16, 22, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); transition: background .3s, border-color .3s; }
.has-overlay-header .site-header { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; backdrop-filter: none; }
.has-overlay-header .site-header.is-scrolled, .has-overlay-header .site-header.nav-open { background: rgba(11, 16, 22, .9); backdrop-filter: blur(12px); border-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { font-family: var(--display); font-size: 1.35rem; font-weight: 600; text-decoration: none; letter-spacing: -.01em; }
.site-nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .98rem; color: var(--text); transition: background .2s; }
.site-nav a:hover { background: rgba(255, 255, 255, .08); }
.site-nav a[aria-current="page"] { color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: 8px; margin-right: -8px; cursor: pointer; }
.nav-toggle .when-open, .nav-toggle[aria-expanded="true"] .when-closed { display: none; }
.nav-toggle[aria-expanded="true"] .when-open { display: inline; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { position: absolute; top: 72px; left: 0; right: 0; background: rgba(11, 16, 22, .97); border-bottom: 1px solid var(--line); display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px var(--gutter) 20px; gap: 0; }
  .site-nav a { padding: 14px 0; border-radius: 0; font-size: 1.15rem; border-bottom: 1px solid var(--line); }
  .site-nav a:hover { background: none; }
}

/* ----- Hero with photo background ----- */
.hero { position: relative; min-height: min(100svh, 940px); display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero-photos, .hero-shade { position: absolute; inset: 0; }
.hero-photos { z-index: -2; background: var(--bg-2); }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.8s ease; transform: scale(1.06); }
.hero-photo.is-active { opacity: 1; animation: drift 12s ease-out forwards; }
@keyframes drift { from { transform: scale(1.08); } to { transform: scale(1); } }
.hero-shade { z-index: -1; background:
  linear-gradient(90deg, rgba(11,16,22,.88) 0%, rgba(11,16,22,.62) 38%, rgba(11,16,22,.15) 75%),
  linear-gradient(0deg, var(--bg) 0%, rgba(11,16,22,.4) 28%, rgba(11,16,22,0) 55%),
  linear-gradient(180deg, rgba(11,16,22,.55) 0%, rgba(11,16,22,0) 22%); }
.hero-content { padding-top: 140px; padding-bottom: clamp(72px, 12vh, 130px); }
.hero h1 { margin-bottom: .4em; font-size: clamp(2.7rem, 7vw, 5.6rem); }
.hero h1 span { display: block; }
.hero h1 em { display: block; font-style: italic; font-weight: 400; color: var(--accent); }
.hero .lede { color: #d6dde4; }
.hero-dots { position: absolute; right: var(--gutter); bottom: 32px; display: flex; gap: 8px; }
.hero-dots button { width: 28px; height: 4px; border: 0; padding: 0; border-radius: 4px; background: rgba(255,255,255,.3); cursor: pointer; transition: background .3s, width .3s; }
.hero-dots button[aria-pressed="true"] { background: var(--text); width: 44px; }
.hero-dots button:focus-visible { outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .hero-photo, .hero-photo.is-active { animation: none; transform: none; transition: none; } }
@media (max-width: 640px) {
  .hero-shade { background: linear-gradient(0deg, var(--bg) 4%, rgba(11,16,22,.7) 45%, rgba(11,16,22,.45) 100%); }
  .hero-dots { bottom: 18px; }
}

/* ----- Sections ----- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section.flush-top { padding-top: 0; }
.section.tinted { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.page-head { padding: clamp(64px, 9vw, 112px) 0 clamp(36px, 5vw, 56px); }
.page-head h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); max-width: 18ch; }

/* ----- About ----- */
.about-layout { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.about-page .about-layout { align-items: start; }
.portrait { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .about-layout { grid-template-columns: 1fr; } .portrait { max-width: 360px; } }

/* ----- Interest cards ----- */
.interest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 980px) { .interest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .interest-grid { grid-template-columns: 1fr; } }
.interest-card { position: relative; display: block; border-radius: var(--radius); overflow: hidden; text-decoration: none; aspect-ratio: 4 / 3.3; background: var(--surface); isolation: isolate; border: 1px solid var(--line); }
.interest-media, .interest-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.interest-media img { transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.interest-card::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(0deg, rgba(8,12,17,.94) 0%, rgba(8,12,17,.55) 42%, rgba(8,12,17,0) 72%); }
.interest-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 22px 24px; }
.interest-body h3 { margin-bottom: .3em; display: flex; align-items: center; gap: .4em; }
.interest-body h3::after { content: "→"; font-family: var(--body); font-size: .9em; opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s; color: var(--accent); }
.interest-body p { margin: 0; color: #cdd5dd; font-size: .97rem; line-height: 1.5; }
.interest-card:hover .interest-media img { transform: scale(1.05); }
.interest-card:hover h3::after, .interest-card:focus-visible h3::after { opacity: 1; transform: none; }

/* ----- Journal cards ----- */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 980px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { height: 100%; }
.post-card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .2s, transform .2s; }
.post-card-link:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.post-card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 20px 22px 24px; }
.post-card-body h3 { margin: .35em 0 .45em; }
.post-card-body p:last-child { margin: 0; font-size: .97rem; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .86rem; color: var(--muted); margin: 0; }
.tag { color: var(--accent); font-weight: 600; text-decoration: none; letter-spacing: .02em; }
a.tag:hover { text-decoration: underline; }
.meta .tag + time::before { content: "·"; margin-right: 10px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button { font: 500 .93rem var(--body); color: var(--text); background: transparent; border: 1px solid var(--line-strong); padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
[data-filter-list] > [hidden] { display: none; }

/* ----- Banners (interest + post pages) ----- */
.banner { position: relative; min-height: 460px; display: flex; align-items: flex-end; isolation: isolate; overflow: hidden; }
.banner.tall { min-height: min(78svh, 720px); }
.banner-photo, .banner-shade { position: absolute; inset: 0; }
.banner-photo { z-index: -2; }
.banner-photo img { width: 100%; height: 100%; object-fit: cover; }
.banner-shade { z-index: -1; background: linear-gradient(0deg, var(--bg) 0%, rgba(11,16,22,.72) 40%, rgba(11,16,22,.35) 100%); }
.banner-content { padding-top: 130px; padding-bottom: 48px; }
.banner-content h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); margin: .3em 0 .35em; }
.banner .lede p { margin: 0; }
.back-link { display: inline-flex; align-items: center; gap: .4em; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem; }
.back-link:hover { color: var(--text); }

/* ----- Post body ----- */
.standfirst { font-family: var(--display); font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.45; color: var(--text); margin: 8px 0 32px; }
.prose { font-size: 1.1rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin-bottom: 0; }
.prose h2 { font-size: 1.8rem; margin: 1.8em 0 .5em; }
.prose h3 { font-size: 1.35rem; margin: 1.5em 0 .4em; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose img { border-radius: var(--radius-sm); margin: 1.6em 0; width: 100%; }
.prose blockquote { margin: 1.6em 0; padding-left: 20px; border-left: 3px solid var(--accent); font-family: var(--display); font-size: 1.3rem; font-style: italic; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose em { color: var(--muted); }
.gallery-title { font-size: 1.6rem; margin: 2.4em 0 .8em; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }
.post-nav a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; font-family: var(--display); font-size: 1.15rem; line-height: 1.3; }
.post-nav a:hover { color: var(--accent); }
.post-nav .next { text-align: right; }

/* ----- Photos ----- */
.photo-grid { list-style: none; margin: 0; padding: 0; columns: 3 280px; column-gap: 14px; }
.photo-grid li { break-inside: avoid; margin-bottom: 14px; }
.photo-grid a { display: block; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.photo-grid img { width: 100%; transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .3s; }
.photo-grid a:hover img { transform: scale(1.03); }
.photo-grid.compact { columns: auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.photo-grid.compact li { margin: 0; }
.photo-grid.compact a { aspect-ratio: 1; }
.photo-grid.compact img { height: 100%; object-fit: cover; }
@media (max-width: 900px) { .photo-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.lightbox { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(5, 8, 12, .96); color: var(--text); }
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox::backdrop { background: rgba(5, 8, 12, .9); }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 56px 0 24px; min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100svh - 140px); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { margin-top: 14px; color: var(--muted); font-size: .95rem; text-align: center; padding: 0 12px; }
.lightbox button { background: rgba(255,255,255,.08); border: 0; color: var(--text); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; justify-self: center; }
.lightbox button:hover { background: rgba(255,255,255,.16); }
.lb-close { position: absolute; top: 14px; right: 14px; }
@media (max-width: 640px) { .lightbox[open] { grid-template-columns: 1fr; } .lb-prev, .lb-next { position: absolute; bottom: 18px; } .lb-prev { left: 30%; } .lb-next { right: 30%; } .lightbox figure { padding-bottom: 80px; } }

/* ----- Contact ----- */
.contact-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
@media (max-width: 860px) { .contact-card { grid-template-columns: 1fr; } }
.contact-form { display: grid; gap: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.contact-form label { display: grid; gap: 8px; font-weight: 500; font-size: .95rem; }
.contact-form input, .contact-form textarea {
  font: 400 1rem/1.5 var(--body); color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 12px 14px; width: 100%; transition: border-color .2s, background .2s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
.contact-form textarea { resize: vertical; min-height: 150px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.form-status { margin: 0; color: var(--muted); }
.form-status.ok { color: #9be3b4; }
.form-status.err { color: #ffb4a8; }

/* ----- Footer ----- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 28px; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; margin-bottom: 24px; }
.footer-inner .brand { display: inline-block; margin-bottom: 6px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-links a { text-decoration: none; color: var(--muted); }
.footer-links a:hover { color: var(--text); }
