/* =========================================================================
   The Lost Chavez — dark, weathered, gold-on-abyss.
   A CEO's polish with an outlaw's disregard. Built to put photographs first.
   ========================================================================= */

:root {
  /* Ink & abyss */
  --abyss:        #0a0d0f;
  --abyss-2:      #0e1316;
  --panel:        #121a1e;
  --panel-2:      #16211f;
  --line:         rgba(203, 167, 92, 0.16);
  --line-strong:  rgba(203, 167, 92, 0.34);

  /* Bone & parchment */
  --bone:         #ece5d6;
  --bone-dim:     #b8b1a2;
  --muted:        #8a897e;

  /* Brass, gold, blood */
  --gold:         #cba75c;
  --gold-bright:  #e6c877;
  --brass:        #a8863c;
  --blood:        #b23a2b;
  --blood-bright: #d1503f;
  --patina:       #4a7c6f;

  /* Type */
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --body:    'Spectral', 'Iowan Old Style', Georgia, serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Space */
  --wrap: 1180px;
  --narrow: 720px;
  --r: 3px;

  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.75);
}

/* --- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--abyss);
  background-image:
    radial-gradient(1200px 600px at 75% -10%, rgba(74, 124, 111, 0.10), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(178, 58, 43, 0.07), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  color: var(--bone);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.72;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--gold-bright); }

code, pre {
  font-family: var(--mono);
  font-size: 0.85em;
}
code {
  background: rgba(203, 167, 92, 0.10);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.08em 0.4em;
  color: var(--gold-bright);
}

::selection { background: rgba(203, 167, 92, 0.28); color: #fff; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: var(--abyss); padding: 0.6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* --- Layout helpers ---------------------------------------------------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.wrap-narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--bone);
}

/* --- Header ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(10, 13, 15, 0.94), rgba(10, 13, 15, 0.78));
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 0.85rem; padding-bottom: 0.85rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--bone); }
.brand:hover { color: var(--bone); }
.brand-mark {
  font-size: 1.5rem; color: var(--gold);
  text-shadow: 0 0 14px rgba(203, 167, 92, 0.4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-title {
  font-family: var(--display); font-weight: 700; font-size: 1.16rem;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.brand-sub {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold); opacity: 0.85; margin-top: 2px;
}
.site-nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--display); font-size: 0.82rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--bone-dim); position: relative;
}
.site-nav a::after {
  content: ''; position: absolute; left: 0; bottom: -5px; height: 1px; width: 0;
  background: var(--gold); transition: width 0.22s ease;
}
.site-nav a:hover { color: var(--gold-bright); }
.site-nav a:hover::after { width: 100%; }

/* --- Masthead ---------------------------------------------------------- */
.masthead {
  text-align: center; padding: 5.5rem 0 3rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.masthead::before,
.masthead::after {
  content: '\2766'; position: absolute; left: 50%; transform: translateX(-50%);
  color: var(--gold); opacity: 0.5; font-size: 1.3rem;
}
.masthead::before { top: 2.2rem; }
.masthead::after { bottom: 1.3rem; }
.masthead-kicker {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 1rem;
}
.masthead-title {
  font-size: clamp(2.8rem, 7vw, 5rem); margin: 0; letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--gold-bright), var(--brass));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 30px rgba(203, 167, 92, 0.15);
}
.masthead-tagline {
  font-style: italic; font-size: 1.2rem; color: var(--bone-dim);
  max-width: 40ch; margin: 1rem auto 0.4rem;
}
.masthead-handle { font-size: 0.85rem; color: var(--muted); margin-top: 0.8rem; }

/* --- Featured ---------------------------------------------------------- */
.featured { margin: 3.5rem auto; }
.featured-inner {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; color: var(--bone);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.featured-inner:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.featured-media { overflow: hidden; min-height: 340px; }
.featured-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.92) contrast(1.03); transition: transform 0.6s ease; }
.featured-inner:hover .featured-media img { transform: scale(1.04); }
.featured-body { padding: 2.6rem; display: flex; flex-direction: column; justify-content: center; }
.eyebrow {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--blood-bright);
}
.featured-title { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin: 0.8rem 0 0.6rem; }
.featured-summary { color: var(--bone-dim); margin: 0.8rem 0 1.4rem; }
.read-on { font-family: var(--display); letter-spacing: 0.05em; color: var(--gold); font-size: 0.95rem; }

/* --- Section heads ----------------------------------------------------- */
.section-head { display: flex; align-items: center; gap: 1.2rem; margin: 3rem 0 1.8rem; }
.section-head h2 {
  font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--gold); margin: 0; white-space: nowrap;
}
.section-head::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* --- Cards ------------------------------------------------------------- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.8rem; margin-bottom: 3rem;
}
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.22s ease, transform 0.22s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9); transition: transform 0.5s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card-meta {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 0.5rem;
}
.card-title { font-size: 1.35rem; margin: 0.15rem 0; }
.card-title a { color: var(--bone); }
.card-title a:hover { color: var(--gold-bright); }
.card-summary { color: var(--bone-dim); font-size: 0.96rem; margin: 0; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }

.tag {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em;
  color: var(--gold); border: 1px solid var(--line); border-radius: 2px;
  padding: 0.15rem 0.5rem;
}
.tag:hover { border-color: var(--line-strong); background: rgba(203, 167, 92, 0.08); }
.tag span { color: var(--muted); }

/* --- Page head / archive ---------------------------------------------- */
.page-head { padding: 3.5rem 0 1.5rem; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); text-transform: uppercase; letter-spacing: 0.04em; }
.page-sub { color: var(--bone-dim); font-style: italic; margin-top: 0.3rem; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.4rem; }

.archive-list { list-style: none; padding: 0; margin: 0 0 4rem; border-top: 1px solid var(--line); }
.archive-row {
  display: grid; grid-template-columns: 150px 1fr auto; gap: 1rem; align-items: baseline;
  padding: 1.1rem 0.3rem; border-bottom: 1px solid var(--line);
  transition: background 0.18s ease;
}
.archive-row:hover { background: rgba(203, 167, 92, 0.04); }
.archive-row time { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.archive-link { font-family: var(--display); font-size: 1.2rem; color: var(--bone); }
.archive-link:hover { color: var(--gold-bright); }
.archive-read { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }

/* --- Post -------------------------------------------------------------- */
.post { padding-top: 2.5rem; }
.post-header { text-align: center; padding-bottom: 2.5rem; }
.post-tags { display: flex; gap: 0.4rem; justify-content: center; margin-bottom: 1.2rem; }
.post-title { font-size: clamp(2.1rem, 5.5vw, 3.6rem); letter-spacing: 0.01em; margin: 0.4rem 0; }
.post-meta {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  display: flex; gap: 0.6rem; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 1rem;
}
.byline { color: var(--gold); }

.post-body { font-size: 1.16rem; line-height: 1.82; }
.post-body > p:first-of-type::first-letter {
  font-family: var(--display); float: left; font-size: 3.9rem; line-height: 0.8;
  padding: 0.35rem 0.7rem 0 0; color: var(--gold);
}
.post-body p { margin: 0 0 1.5rem; }
.post-body h2 {
  font-size: 1.8rem; margin: 3rem 0 1rem; padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.post-body h3 { font-size: 1.35rem; margin: 2.2rem 0 0.8rem; color: var(--gold); }
.post-body a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.post-body blockquote {
  margin: 2rem 0; padding: 0.6rem 0 0.6rem 1.6rem;
  border-left: 3px solid var(--gold); font-style: italic; color: var(--bone-dim);
  font-size: 1.25rem;
}
.post-body ul, .post-body ol { padding-left: 1.4rem; margin: 0 0 1.5rem; }
.post-body li { margin-bottom: 0.6rem; }
.post-body li::marker { color: var(--gold); }
.post-body hr {
  border: 0; height: 1px; background: var(--line); margin: 3rem 0;
  position: relative;
}
.post-body pre {
  background: var(--abyss-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.2rem 1.4rem; overflow-x: auto; margin: 0 0 1.5rem;
}
.post-body pre code { background: none; border: 0; padding: 0; color: var(--bone); }

.post-footer { margin-top: 3.5rem; }
.post-signoff {
  text-align: center; padding: 2.5rem 1.5rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.95rem;
}
.post-signoff .brand-mark { display: block; font-size: 1.8rem; margin-bottom: 0.6rem; }
.post-follow { font-size: 0.85rem; }

.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  margin: 3rem auto 5rem; padding-top: 2rem; border-top: 1px solid var(--line);
}
.post-nav-item a { display: flex; flex-direction: column; gap: 0.3rem; color: var(--bone); }
.post-nav-right { text-align: right; }
.post-nav-dir { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.post-nav-title { font-family: var(--display); font-size: 1.1rem; }
.post-nav-item a:hover .post-nav-title { color: var(--gold-bright); }

/* =========================================================================
   Photography primitives
   ========================================================================= */

/* Inline figure — the default for every image. */
.ph-figure { margin: 2.2rem 0; }
.ph-figure .ph-zoom { display: block; cursor: zoom-in; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--abyss-2); }
.ph-figure img { width: 100%; filter: saturate(0.95) contrast(1.02); transition: transform 0.6s ease, filter 0.4s ease; }
.ph-figure .ph-zoom:hover img { transform: scale(1.02); filter: saturate(1.05); }
.ph-figure figcaption {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--muted); text-align: center; margin-top: 0.7rem; font-style: normal;
}

/* Hero — breaks slightly wider than the text column. */
.ph-hero {
  margin: 3rem calc(50% - 50vw); max-width: 100vw;
  padding: 0 max(1.5rem, calc(50vw - var(--wrap) / 2));
}
.ph-hero .ph-banner-img { display: block; cursor: zoom-in; overflow: hidden; border-radius: var(--r); }
.ph-hero img { width: 100%; max-height: 78vh; object-fit: cover; }

/* Takeover — full-bleed, edge to edge, cinematic. */
.ph-takeover {
  position: relative; margin: 3.5rem calc(50% - 50vw); width: 100vw; max-width: 100vw;
}
.ph-takeover .ph-banner-img { cursor: zoom-in; display: block; }
.ph-takeover img { width: 100vw; max-height: 92vh; object-fit: cover; }
.ph-banner-caption {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; color: var(--bone-dim);
  text-align: center; margin-top: 0.8rem;
}
.ph-takeover .ph-banner-caption {
  position: absolute; bottom: 1.2rem; left: 0; right: 0;
  color: var(--bone); text-shadow: 0 2px 12px rgba(0,0,0,0.9); margin: 0;
}

/* Gallery — responsive grid, every tile zoomable. */
.ph-gallery {
  display: grid;
  grid-template-columns: repeat(var(--ph-cols, auto-fill), minmax(220px, 1fr));
  gap: 0.9rem; margin: 2.5rem 0;
}
.ph-gallery.ph-gallery-page { margin: 2rem 0 4rem; }
.ph-gallery .ph-figure { margin: 0; }
.ph-gallery .ph-figure img { aspect-ratio: 1 / 1; object-fit: cover; height: 100%; }
.ph-gallery figcaption { text-align: left; }

/* Duo & trio — tight side-by-side rows. */
.ph-duo, .ph-trio { display: grid; gap: 0.9rem; margin: 2.5rem 0; }
.ph-duo { grid-template-columns: repeat(2, 1fr); }
.ph-trio { grid-template-columns: repeat(3, 1fr); }
.ph-duo .ph-figure, .ph-trio .ph-figure { margin: 0; }
.ph-duo img, .ph-trio img { height: 100%; object-fit: cover; }

/* =========================================================================
   Lightbox
   ========================================================================= */
.lightbox {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center;
  background: rgba(6, 8, 9, 0.96); backdrop-filter: blur(4px);
  padding: 3vh 2vw;
}
.lightbox.open { display: flex; }
.lightbox-figure { margin: 0; max-width: 92vw; max-height: 90vh; text-align: center; }
.lightbox-figure img { max-width: 92vw; max-height: 82vh; object-fit: contain; border: 1px solid var(--line-strong); }
.lightbox-figure figcaption { font-family: var(--mono); font-size: 0.78rem; color: var(--bone-dim); margin-top: 0.9rem; letter-spacing: 0.06em; }
.lightbox-close, .lightbox-nav {
  position: absolute; background: none; border: 1px solid var(--line); color: var(--gold);
  font-size: 1.6rem; width: 3rem; height: 3rem; cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; transition: all 0.18s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { border-color: var(--gold); background: rgba(203,167,92,0.12); }
.lightbox-close { top: 3vh; right: 3vw; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 2vw; }
.lightbox-next { right: 2vw; }

/* =========================================================================
   Buttons, pager, footer, misc
   ========================================================================= */
.btn {
  display: inline-block; font-family: var(--display); letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.82rem;
  color: var(--gold); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 0.7rem 1.4rem; transition: all 0.2s ease;
}
.btn:hover { background: var(--gold); color: var(--abyss); border-color: var(--gold); }
.pager { text-align: center; margin: 1rem 0 5rem; }
.empty-state { color: var(--muted); font-style: italic; padding: 3rem 0 5rem; text-align: center; }

.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; background: var(--abyss-2); }
.footer-inner {
  display: grid; grid-template-columns: 1.3fr 1fr 1.3fr; gap: 2.5rem;
  padding: 3rem 1.5rem 2rem;
}
.footer-brand .brand-mark { font-size: 2rem; }
.footer-tagline { color: var(--bone-dim); font-style: italic; margin-top: 0.6rem; max-width: 30ch; }
.footer-col h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold); margin: 0 0 0.8rem; }
.footer-handle { color: var(--bone-dim); font-size: 0.9rem; }
.footer-links { display: flex; gap: 1.2rem; margin-top: 0.6rem; font-family: var(--mono); font-size: 0.8rem; }
.footer-creed p { font-style: italic; color: var(--bone-dim); }
.footer-base {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.6rem;
  border-top: 1px solid var(--line); padding: 1.2rem 1.5rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--muted);
}
.footer-flag { color: var(--gold); opacity: 0.75; }
.dot { color: var(--muted); }

/* =========================================================================
   First-visit disclaimer
   ========================================================================= */
.disclaimer {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 4vh 1.2rem;
  background: rgba(5, 7, 8, 0.86); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.3s ease;
}
.disclaimer.open { opacity: 1; }
.disclaimer[hidden] { display: none; }

.disclaimer-card {
  position: relative; max-width: 640px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  background:
    radial-gradient(600px 200px at 50% -40%, rgba(203, 167, 92, 0.10), transparent 70%),
    var(--panel);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, 0.4);
  padding: 2.4rem 2.2rem 2rem; text-align: center;
  transform: translateY(14px) scale(0.98); transition: transform 0.32s ease;
}
.disclaimer.open .disclaimer-card { transform: translateY(0) scale(1); }

.disclaimer-mark {
  display: block; font-size: 2.2rem; color: var(--gold);
  text-shadow: 0 0 18px rgba(203, 167, 92, 0.4); margin-bottom: 0.5rem;
}
.disclaimer-title {
  font-size: clamp(1.5rem, 4vw, 2rem); text-transform: uppercase;
  letter-spacing: 0.05em; margin: 0 0 1.2rem;
}
.disclaimer-body {
  text-align: left; color: var(--bone-dim); font-size: 1rem; line-height: 1.65;
}
.disclaimer-body p { margin: 0 0 1rem; }
.disclaimer-lines { color: var(--bone); }
.disclaimer-fine {
  font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.disclaimer-kicker {
  font-family: var(--display); font-size: 1.15rem; color: var(--blood-bright);
  text-align: center; letter-spacing: 0.02em; margin-top: 1.2rem !important;
}
.disclaimer-sig {
  font-family: var(--display); font-size: 1.1rem; color: var(--gold);
  text-align: right; font-style: italic; margin: 0.3rem 0 0 !important;
}
.disclaimer-actions {
  display: flex; align-items: center; justify-content: center; gap: 1.4rem;
  flex-wrap: wrap; margin-top: 1.8rem;
}
.disclaimer-enter { font-size: 0.95rem; padding: 0.8rem 2.4rem; cursor: pointer; }
.disclaimer-leave {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em;
  color: var(--muted);
}
.disclaimer-leave:hover { color: var(--bone-dim); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 860px) {
  body { font-size: 18px; }
  .featured-inner { grid-template-columns: 1fr; }
  .featured-media { min-height: 220px; aspect-ratio: 16/9; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.8rem; }
  .site-nav { gap: 1rem; }
  .archive-row { grid-template-columns: 1fr auto; }
  .archive-row time { grid-column: 1 / -1; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-right { text-align: left; }
}
@media (max-width: 560px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .brand-sub { display: none; }
  .ph-trio { grid-template-columns: 1fr 1fr; }
}

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