/* ==========================================================================
   Charlie Tyler — Photography & Film
   ========================================================================== */

:root {
  --bg: #0d0e10;
  --bg-raised: #16181b;
  --bg-raised-2: #1e2124;
  --line: rgba(242, 237, 230, 0.1);
  --ink: #f2ede6;
  --ink-dim: #b9b3aa;
  --ink-faint: #8a847c;
  --accent: #e2793f;
  --accent-soft: rgba(226, 121, 63, 0.14);
  --accent-ink: #1a1006;
  --max: 1320px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink-dim); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid var(--line);
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: #f28c52; transform: translateY(-2px); }
.btn-ghost { color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.4rem 0;
  transition: background 0.35s var(--ease), padding 0.35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(13, 14, 16, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.9rem 0;
  border-color: var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.1rem;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-dim);
  position: relative;
  padding: 0.2rem 0;
  transition: color 0.25s;
}
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-cta { margin-left: 0.5rem; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(78vw, 340px);
    height: 100vh;
    background: var(--bg-raised);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1.6rem;
    padding: 2rem var(--gutter);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    border-left: 1px solid var(--line);
  }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a { font-size: 1.15rem; }
  .nav-toggle { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #000;
}
.hero-media {
  position: absolute;
  inset: 0;
}
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 62%;
  animation: hero-zoom 18s ease-out forwards;
}
@keyframes hero-zoom {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(9,10,11,.45) 0%, rgba(9,10,11,.15) 32%, rgba(9,10,11,.55) 72%, rgba(9,10,11,.96) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}
.hero-content .eyebrow { color: #ffd9b8; }
.hero-content .eyebrow::before { background: #ffd9b8; }
.hero-title {
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  color: #fff;
  max-width: 16ch;
  margin: 0.2em 0 0.35em;
}
.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: rgba(242,237,230,0.86);
  max-width: 46ch;
  margin-bottom: 1.8rem;
}
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.scroll-cue {
  position: absolute;
  bottom: 1.6rem; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(242,237,230,0.7);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.scroll-cue .line { width: 1px; height: 28px; background: linear-gradient(180deg, rgba(242,237,230,.8), transparent); animation: cue 2s infinite; }
@keyframes cue { 0% { opacity: .2; } 50% { opacity: 1; } 100% { opacity: .2; } }
@media (max-width: 640px), (max-height: 760px) { .scroll-cue { display: none; } }

/* Smaller page header (non-home hero) */
.page-header {
  padding: clamp(7.5rem, 16vw, 10.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line);
}
.page-header h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); max-width: 20ch; }
.page-header .lede { font-size: 1.08rem; max-width: 62ch; }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-alt { background: var(--bg-raised); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2.6rem;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: 0.25em 0 0; max-width: 18ch; }
.section-head .lede { max-width: 46ch; margin: 0; }

/* ---------- Bio / About blocks ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split img { border-radius: var(--radius); }
.stat-row {
  display: flex;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: 2rem;
  flex-wrap: wrap;
}
.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--accent);
}
.stat span { font-size: 0.85rem; color: var(--ink-faint); }

/* ---------- Featured grid (home) ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 13vw;
  gap: 0.6rem;
}
.feature-grid a {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  display: block;
}
.feature-grid img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.feature-grid a:hover img { transform: scale(1.06); }
.feature-grid a::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.55) 100%);
  opacity: 0;
  transition: opacity .35s;
}
.feature-grid a:hover::after { opacity: 1; }
.feature-grid .cap {
  position: absolute; left: 0.9rem; bottom: 0.75rem; right: 0.9rem;
  color: #fff; font-size: 0.78rem; font-weight: 600;
  opacity: 0; transform: translateY(6px);
  transition: all .35s;
}
.feature-grid a:hover .cap { opacity: 1; transform: translateY(0); }

.f-a { grid-column: span 3; grid-row: span 2; }
.f-b { grid-column: span 3; grid-row: span 2; }
.f-c { grid-column: span 2; grid-row: span 2; }
.f-d { grid-column: span 2; grid-row: span 2; }
.f-e { grid-column: span 2; grid-row: span 2; }

@media (max-width: 760px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 44vw; }
  .f-a, .f-b, .f-c, .f-d, .f-e { grid-column: span 1; grid-row: span 1; }
}

/* ---------- Gallery ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.2rem;
}
.filter-bar button {
  padding: 0.5em 1.1em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-dim);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
}
.filter-bar button:hover { color: var(--ink); border-color: var(--ink-dim); }
.filter-bar button.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.masonry {
  columns: 4 260px;
  column-gap: 0.7rem;
}
.masonry figure {
  margin: 0 0 0.7rem;
  break-inside: avoid;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  background: var(--bg-raised);
}
.masonry img { width: 100%; transition: transform .5s var(--ease); }
.masonry figure:hover img { transform: scale(1.045); }
.masonry figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.6rem 0.9rem 0.7rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.75));
  color: #fff; font-size: 0.78rem; font-weight: 600;
  opacity: 0; transition: opacity .3s;
}
.masonry figure:hover figcaption { opacity: 1; }
.masonry .hide { display: none; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(6,6,7,0.94);
  display: none;
  align-items: center; justify-content: center;
  padding: 4vh 4vw;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 8px; }
.lightbox figcaption { text-align: center; color: var(--ink-dim); margin-top: 1rem; font-size: 0.9rem; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  color: #fff;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.16); }
.lightbox-close { top: 1.4rem; right: 1.4rem; }
.lightbox-prev { left: 1.4rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.4rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lightbox-prev, .lightbox-next { width: 38px; height: 38px; } }

/* ---------- Journal cards ---------- */
.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
@media (max-width: 960px) { .journal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .journal-grid { grid-template-columns: 1fr; } }

.card-journal { display: block; }
.card-journal .thumb {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.1rem;
}
.card-journal .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card-journal:hover .thumb img { transform: scale(1.05); }
.card-journal .thumb-text {
  background: linear-gradient(135deg, var(--bg-raised) 0%, var(--bg-raised-2) 100%);
  border: 1px solid var(--line);
  position: relative;
}
.card-journal .thumb-text::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 34px; height: 34px;
  background: var(--accent);
  opacity: 0.16;
  border-radius: 50%;
}
.card-journal:hover .thumb-text::after { opacity: 0.3; }
.card-journal .meta {
  display: flex; gap: 0.8rem; align-items: center;
  font-size: 0.76rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.5rem; font-weight: 700;
}
.card-journal h3 { font-size: 1.28rem; margin-bottom: 0.4rem; }
.card-journal p { font-size: 0.94rem; margin: 0; }

.card-journal.featured { grid-column: span 2; }
.card-journal.featured .thumb { aspect-ratio: 16/9; }
@media (max-width: 960px) { .card-journal.featured { grid-column: span 2; } }
@media (max-width: 640px) { .card-journal.featured { grid-column: span 1; } }

.archive-note {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  font-size: 0.92rem;
  color: var(--ink-dim);
  margin-bottom: 2.6rem;
}
.archive-note strong { color: var(--ink); }

/* ---------- Journal post ---------- */
.post-header {
  padding: clamp(7.5rem, 16vw, 10.5rem) 0 2.5rem;
}
.post-header .meta {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); font-weight: 700; margin-bottom: 1rem;
}
.post-header .meta .tag {
  color: var(--ink-faint); font-weight: 600; letter-spacing: 0.04em;
}
.post-header h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 22ch; }
.post-hero {
  margin: 0 0 clamp(2rem, 5vw, 3.5rem);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-hero img { width: 100%; }
.post-hero figcaption {
  padding: 0.7rem 0.1rem 0; font-size: 0.85rem; color: var(--ink-faint);
}
.post-body {
  display: grid;
  grid-template-columns: minmax(0,72ch) 1fr;
  gap: 3rem;
}
.post-body.no-aside {
  grid-template-columns: minmax(0,72ch);
  max-width: 72ch;
}
@media (max-width: 900px) { .post-body { grid-template-columns: 1fr; } }
.post-body .prose p { color: var(--ink); font-size: 1.06rem; }
.post-body .prose p:first-of-type { font-size: 1.18rem; color: var(--ink); }
.post-gallery {
  margin: 2.2rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
.post-gallery figure { margin: 0; border-radius: 10px; overflow: hidden; }
.post-gallery figcaption { font-size: 0.82rem; color: var(--ink-faint); padding: 0.5rem 0 0; }
.post-gallery.single { grid-template-columns: 1fr; }
@media (max-width: 560px) { .post-gallery { grid-template-columns: 1fr; } }

.post-aside {
  border-left: 1px solid var(--line);
  padding-left: 2rem;
  align-self: start;
  position: sticky;
  top: 7rem;
}
@media (max-width: 900px) { .post-aside { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 1.6rem; position: static; } }
.post-aside h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); margin-bottom: 0.9rem; }
.post-aside .gear { font-size: 0.92rem; color: var(--ink-dim); margin-bottom: 1.6rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-list span {
  font-size: 0.76rem; padding: 0.4em 0.85em; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-faint);
}
.credit-box {
  margin-top: 1.8rem; padding: 1rem 1.1rem;
  background: var(--bg-raised); border-radius: 10px;
  font-size: 0.86rem; color: var(--ink-dim);
}
.post-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.post-nav a { color: var(--ink-dim); font-weight: 600; font-size: 0.94rem; }
.post-nav a:hover { color: var(--accent); }
.post-nav .dir { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); margin-bottom: 0.3rem; }

/* ---------- Film ---------- */
.film-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem;
}
@media (max-width: 760px) { .film-grid { grid-template-columns: 1fr; } }
.film-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-raised);
}
.film-card .frame { position: relative; aspect-ratio: 16/9; background: #000; }
.film-card .frame img { width: 100%; height: 100%; object-fit: cover; opacity: .78; }
.play-badge {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.play-badge span {
  width: 62px; height: 62px; border-radius: 50%;
  background: rgba(226,121,63,.92);
  display: flex; align-items: center; justify-content: center;
  color: #1a1006;
}
.film-card .info { padding: 1.2rem 1.3rem 1.4rem; }
.film-card h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.film-card p { font-size: 0.88rem; margin: 0; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 5rem);
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.form-row { margin-bottom: 1.3rem; }
.form-row label {
  display: block; font-size: 0.82rem; font-weight: 600; letter-spacing: .03em;
  color: var(--ink-dim); margin-bottom: 0.5rem;
}
.form-row input, .form-row textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85em 1em;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.96rem;
  transition: border-color .2s;
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); }
.form-row textarea { resize: vertical; min-height: 140px; }
.hp-field { position: absolute; left: -9999px; }

.contact-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}
.contact-card h3 { font-size: 1.15rem; }
.social-list { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1.4rem; }
.social-list a {
  display: flex; align-items: center; gap: 0.8rem;
  font-size: 0.95rem; font-weight: 600; color: var(--ink);
  padding: 0.6em 0.2em; border-bottom: 1px solid var(--line);
}
.social-list a svg { flex-shrink: 0; color: var(--accent); }
.social-list a:last-child { border-bottom: none; }
.social-list a:hover { color: var(--accent); }

.form-success {
  display: none;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--ink);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.3rem;
  font-size: 0.92rem;
}

/* ---------- CTA band ---------- */
.cta-band {
  border-radius: 20px;
  background: linear-gradient(135deg, #1c1310, #221a15);
  border: 1px solid var(--line);
  padding: clamp(2.4rem, 6vw, 4rem);
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.cta-band h2 { margin: 0.2em 0 0.3em; font-size: clamp(1.6rem, 3.4vw, 2.3rem); max-width: 18ch; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 3.5rem 0 2rem; }
.footer-top {
  display: flex; justify-content: space-between; gap: 2.5rem; flex-wrap: wrap;
  padding-bottom: 2.6rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line);
}
.footer-brand .brand { display: block; margin-bottom: 0.7rem; }
.footer-brand p { max-width: 34ch; font-size: 0.92rem; }
.footer-cols { display: flex; gap: clamp(2.5rem, 6vw, 5rem); }
.footer-col h4 { font-size: 0.76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); margin-bottom: 1rem; }
.footer-col a { display: block; font-size: 0.92rem; color: var(--ink-dim); margin-bottom: 0.7rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-size: 0.82rem; color: var(--ink-faint);
}
.footer-social { display: flex; gap: 0.9rem; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--ink-dim);
  transition: all .25s;
}
.footer-social a:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* ---------- Misc ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

::selection { background: var(--accent); color: var(--accent-ink); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: var(--accent-ink); padding: 0.8em 1.2em; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
