/* ============================================================
   M.L. LEDDY'S — redesign design system
   Single permanent look: "Tooled Leather" — deep saddle-brown,
   brass glow, warm shadow. All tokens live in :root.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

:root{
  /* --- BRAND --- */
  --brand:#008752;
  --brand-600:#00623c;
  --brand-deep:#00492c;
  --brand-rgb:0,135,82;
  --brass:#c9a05c;
  --brass-deep:#8a6a34;
  --brass-rgb:201,160,92;

  /* --- Fluid type scale --- */
  --step--1: clamp(.82rem,.78rem + .2vw,.94rem);
  --step-0:  clamp(1rem,.95rem + .25vw,1.13rem);
  --step-1:  clamp(1.2rem,1.1rem + .5vw,1.5rem);
  --step-2:  clamp(1.5rem,1.3rem + 1vw,2.1rem);
  --step-3:  clamp(2rem,1.6rem + 2vw,3rem);
  --step-4:  clamp(2.6rem,1.9rem + 3.4vw,4.6rem);
  --step-5:  clamp(3.2rem,2.2rem + 5vw,6.2rem);

  --container:1240px;
  --gutter: clamp(20px,5vw,64px);
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);

  --font-display:'Bebas Neue',Impact,sans-serif;
  --font-head:'Roboto Slab',Georgia,serif;
  --font-body:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;

  /* --- "Tooled Leather": deep saddle-brown depth, brass glow, warm shadow.
         The site's single permanent look. --- */
  --bg:#22140a;
  --surface:#2e1c0e;
  --surface-2:#3a2412;
  --text:#f1e2c8;
  --text-soft:#c9a97c;
  --hair:rgba(241,226,200,.14);
  --accent:var(--brand);
  --accent-ink:#e0b45c;
  --radius:12px;
  --radius-pill:12px;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 24px 48px -24px rgba(0,0,0,.7);
  --display-weight:700;
  --display-transform:uppercase;
  --grain-opacity:.08;
}

body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  font-size:var(--step-0);
  line-height:1.6;
  transition:background .4s var(--ease),color .4s var(--ease);
}

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

h1,h2,h3,h4{
  font-family:var(--font-head);
  font-weight:var(--display-weight);
  text-transform:var(--display-transform);
  letter-spacing:.01em;
  line-height:1.05;
  margin:0;
}

.eyebrow{
  display:inline-flex; align-items:center; gap:.6em;
  font-family:var(--font-display);
  font-size:var(--step-0);
  letter-spacing:.28em;
  text-transform:uppercase;
  color:var(--accent-ink);
}
.eyebrow::before{ content:''; width:28px; height:2px; background:var(--accent-ink); display:inline-block; }

.lede{ font-size:var(--step-1); color:var(--text-soft); max-width:56ch; }

/* film-grain texture overlay for mood — plain low-opacity, no mix-blend-mode
   (blend modes on a fixed full-viewport layer force whole-page recomposite
   on every scroll frame, which is expensive; a plain overlay is nearly as
   moody and doesn't tax the compositor) */
.grain{
  position:fixed; inset:0; pointer-events:none; z-index:2; opacity:calc(var(--grain-opacity) * 1.6);
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:.6em;
  padding:.95em 1.7em;
  font-family:var(--font-display);
  font-size:var(--step-0);
  letter-spacing:.14em;
  text-transform:uppercase;
  border-radius:var(--radius-pill);
  border:1px solid transparent;
  transition:transform .3s var(--ease-out),background .3s,border-color .3s,color .3s;
}
.btn:hover{ transform:translateY(-2px); }
.btn-primary{ background:var(--accent); color:#fff; }
.btn-primary:hover{ background:var(--brand-600); }
.btn-ghost{ border-color:var(--hair); color:var(--text); }
.btn-ghost:hover{ border-color:var(--accent-ink); color:var(--accent-ink); }

/* ---------- Nav ---------- */
.nav{
  position:fixed; inset:0 0 auto 0; z-index:40;
  display:flex; align-items:center; justify-content:space-between;
  padding:22px var(--gutter);
  background:transparent;
  transition:background .35s var(--ease),padding .35s var(--ease),box-shadow .35s;
}
.nav.scrolled{ background:rgba(34,20,10,.92); backdrop-filter:blur(10px); padding-block:14px; box-shadow:0 1px 0 var(--hair); }
.nav-brand{ display:flex; align-items:center; gap:.7em; }
.nav-brand img{ height:34px; width:auto; filter:brightness(0) invert(1); }
/* nothing covers the photo now, so nav goes white with a shadow to read over it */
.nav.on-hero .nav-brand img{ filter:brightness(0) invert(1) drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.nav-brand .est{ font-family:var(--font-display); letter-spacing:.2em; font-size:.72rem; color:var(--text-soft); }
.nav-links{ display:flex; align-items:center; gap:clamp(18px,3vw,34px); }
.nav-links a{
  font-family:var(--font-display); letter-spacing:.14em; font-size:.85rem;
  color:var(--text); opacity:.86; transition:opacity .25s,color .25s; padding-bottom:2px; border-bottom:1px solid transparent;
}
.nav.on-hero .nav-links a{ color:#fff; opacity:.95; text-shadow:0 1px 4px rgba(0,0,0,.75); }
.nav.on-hero .nav-brand .est{ color:rgba(255,255,255,.85); text-shadow:0 1px 4px rgba(0,0,0,.75); }
.nav.on-hero .nav-links a:hover{ color:var(--accent-ink); border-color:var(--accent-ink); }
.nav-links a:hover{ opacity:1; border-color:var(--accent-ink); }
.nav-links .btn{ padding:.6em 1.3em; font-size:.78rem; }
.nav-toggle{ display:none; background:none; border:0; color:var(--text); }

@media (max-width:860px){
  .nav-links{ position:fixed; inset:0 0 0 auto; width:min(78vw,340px); flex-direction:column; align-items:flex-start;
    background:var(--surface); padding:100px 32px 32px; gap:26px; transform:translateX(100%); transition:transform .4s var(--ease-out); }
  .nav-links.open{ transform:translateX(0); }
  .nav-links a{ min-height:44px; display:flex; align-items:center; }
  .nav-toggle{ display:flex; align-items:center; justify-content:center; width:44px; height:44px; font-size:1.5rem; line-height:1; cursor:pointer; z-index:41; }
  .nav.on-hero .nav-toggle{ color:#fff; text-shadow:0 1px 4px rgba(0,0,0,.75); }
}

/* ---------- Hero: clean photo on load, copy rises in a rounded card ---------- */
.hero{ position:relative; height:220vh; background:#0a0806; }
.hero-sticky{ position:sticky; top:0; height:100vh; height:100svh; overflow:hidden; }
.hero-media{ position:absolute; inset:-4% -4% -4% -4%; will-change:transform; }
.hero-media img{ width:100%; height:100%; object-fit:cover; }
/* No veil — the photo is unobstructed at rest. The card supplies its own
   contrast, so nothing needs to sit over the image. */
.hero-scrim{ display:none; }
.hero-overlay{ position:absolute; inset:0; display:flex; align-items:flex-end; padding-bottom:clamp(40px,7vh,90px); pointer-events:none; }

.hero-card{
  max-width:720px;
  padding:clamp(26px,3.4vw,46px) clamp(26px,3.6vw,52px);
  border-radius:28px;
  background:rgba(249,244,234,.93);
  backdrop-filter:blur(14px) saturate(1.1);
  -webkit-backdrop-filter:blur(14px) saturate(1.1);
  border:1px solid rgba(255,255,255,.5);
  box-shadow:0 34px 80px -24px rgba(0,0,0,.62), 0 2px 6px rgba(0,0,0,.18);
  pointer-events:auto;
  /* JS drives these on scroll; these are the at-rest (hidden) values so the
     photo is completely clear before any scrolling happens. */
  opacity:0;
  transform:translateY(90px);
  will-change:transform,opacity;
}
.hero-card .eyebrow{ color:var(--brand-deep); }
.hero-card .eyebrow::before{ background:var(--brand-deep); }
.hero-tagline{
  color:#171009; font-size:clamp(2.2rem,1.3rem + 3.4vw,4.4rem); margin-top:.34em; line-height:.96;
}
.hero-tagline .ln,.hero-tagline .tk{ display:block; }
.hero-tagline .tk{ color:var(--brand-600); }
.hero-lede{ color:#40352a; max-width:54ch; margin-top:1em; font-size:var(--step-0); }
.hero-cta{ display:flex; gap:14px; margin-top:1.5em; flex-wrap:wrap; }
.hero-cta .btn-ghost{ border-color:rgba(23,16,9,.3); color:#171009; }
.hero-cta .btn-ghost:hover{ border-color:var(--brand-deep); color:var(--brand-deep); background:rgba(0,73,44,.06); }
.hero-scroll-cue{
  position:absolute; left:50%; bottom:28px; transform:translateX(-50%);
  display:flex; flex-direction:column; align-items:center; gap:8px;
  font-family:var(--font-display); letter-spacing:.25em; font-size:.7rem; color:rgba(255,255,255,.9);
  text-shadow:0 1px 4px rgba(0,0,0,.8), 0 0 14px rgba(0,0,0,.6);
  transition:opacity .4s var(--ease);
}
.hero-scroll-cue .line{ width:1px; height:36px; background:linear-gradient(rgba(255,255,255,.9),transparent); box-shadow:0 0 6px rgba(0,0,0,.5); animation:cue 1.8s ease-in-out infinite; }
@keyframes cue{ 0%{transform:scaleY(.3);transform-origin:top} 50%{transform:scaleY(1);transform-origin:top} 100%{transform:scaleY(.3);transform-origin:bottom} }

/* ---------- Sections ---------- */
section{ position:relative; padding-block:clamp(70px,10vw,150px); }
.section-head{ max-width:680px; margin-bottom:clamp(40px,6vw,74px); }
.section-head h2{ font-size:var(--step-4); margin-top:.35em; }
.hair{ height:1px; background:var(--hair); border:0; margin:0; }

/* stats */
.stats{ background:var(--surface); border-top:1px solid var(--hair); border-bottom:1px solid var(--hair); }
.stats-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:32px; }
.stat{ text-align:left; border-left:2px solid var(--accent); padding-left:1.1em; }
.stat .num{ font-family:var(--font-display); font-size:var(--step-4); color:var(--text); line-height:1; }
.stat .num .unit{ font-size:.5em; color:var(--accent-ink); margin-left:.15em; }
.stat .label{ margin-top:.5em; color:var(--text-soft); font-size:var(--step--1); letter-spacing:.08em; text-transform:uppercase; }
@media (max-width:860px){ .stats-grid{ grid-template-columns:repeat(2,1fr); gap:34px 20px; } }

/* heritage / pinned crossfade */
.heritage-grid{ display:grid; grid-template-columns:.9fr 1.1fr; gap:clamp(30px,6vw,90px); align-items:start; }
.heritage-visual{ position:sticky; top:110px; aspect-ratio:4/5; border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.heritage-visual img{ width:100%; height:100%; object-fit:cover; }
.heritage-copy p{ color:var(--text-soft); margin:0 0 1.3em; }
.heritage-copy p:first-of-type{ color:var(--text); font-size:var(--step-1); font-family:var(--font-head); }
@media (max-width:900px){ .heritage-grid{ grid-template-columns:1fr; } .heritage-visual{ position:relative; top:0; aspect-ratio:16/10; } }

/* craftsmanship steps */
.steps{ display:grid; grid-template-columns:repeat(3,1fr); gap:2px; background:var(--hair); border:1px solid var(--hair); }
.step{ background:var(--bg); padding:clamp(26px,3vw,42px); }
.step .idx{ font-family:var(--font-display); font-size:var(--step-3); color:var(--accent-ink); }
.step h3{ font-size:var(--step-1); margin-top:.4em; }
.step p{ color:var(--text-soft); margin-top:.6em; font-size:var(--step--1); }
@media (max-width:860px){ .steps{ grid-template-columns:1fr; } }

/* products grid */
.products-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:2px; background:var(--hair); border:1px solid var(--hair); }
.product-card{ position:relative; background:var(--surface); aspect-ratio:3/4; overflow:hidden; display:flex; align-items:flex-end; }
.product-card img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition:transform .7s var(--ease-out),filter .5s; filter:saturate(.9) brightness(.85); }
.product-card:hover img{ transform:scale(1.07); filter:saturate(1) brightness(.95); }
.product-card::after{ content:''; position:absolute; inset:0; background:linear-gradient(0deg,rgba(0,0,0,.78),transparent 55%); }
.product-card .pc-label{ position:relative; z-index:1; padding:20px; font-family:var(--font-display); letter-spacing:.1em; color:#fff; font-size:var(--step-0); }
.product-card .pc-tag{ position:absolute; top:16px; left:16px; z-index:1; font-size:.7rem; letter-spacing:.18em; color:var(--brass); text-transform:uppercase; }
@media (max-width:960px){ .products-grid{ grid-template-columns:repeat(2,1fr); } }

/* ledger marquee / legacy band */
.ledger{ background:var(--surface-2); border-top:1px solid var(--hair); border-bottom:1px solid var(--hair); overflow:hidden; }
.ledger-inner{ display:grid; grid-template-columns:1fr 1fr; gap:clamp(30px,6vw,90px); align-items:center; }
.ledger-copy p{ color:var(--text-soft); }
.ledger-copy strong{ color:var(--text); }
.marquee{ margin-top:20px; white-space:nowrap; overflow:hidden; border-top:1px solid var(--hair); border-bottom:1px solid var(--hair); padding-block:14px; }
.marquee-track{ display:inline-block; font-family:var(--font-display); letter-spacing:.14em; font-size:var(--step-0); color:var(--text-soft); animation:marquee 26s linear infinite; }
.marquee:hover .marquee-track{ animation-play-state:paused; }
.marquee-track span{ margin:0 1.4em; color:var(--accent-ink); }
@keyframes marquee{ from{ transform:translateX(0); } to{ transform:translateX(-50%); } }
@media (max-width:900px){ .ledger-inner{ grid-template-columns:1fr; } }

/* locations */
.locations-grid{ display:grid; grid-template-columns:1fr 1fr; gap:2px; background:var(--hair); border:1px solid var(--hair); }
.location{ background:var(--surface); padding:clamp(28px,4vw,50px); }
.location .eyebrow{ margin-bottom:.8em; }
.location h3{ font-size:var(--step-2); }
.location address{ font-style:normal; color:var(--text-soft); margin-top:.9em; line-height:1.8; }
.location a.phone{ color:var(--accent-ink); }
@media (max-width:860px){ .locations-grid{ grid-template-columns:1fr; } }

/* footer */
footer{ background:var(--surface); border-top:1px solid var(--hair); padding-block:50px; }
.footer-grid{ display:flex; flex-wrap:wrap; justify-content:space-between; gap:30px; align-items:center; }
.footer-links{ display:flex; gap:26px; flex-wrap:wrap; }
.footer-links a{ font-size:var(--step--1); color:var(--text-soft); }
.footer-links a:hover{ color:var(--accent-ink); }
.footer-social{ display:flex; gap:16px; }
.footer-social a{ width:36px; height:36px; border:1px solid var(--hair); border-radius:50%; display:flex; align-items:center; justify-content:center; }
.footer-fine{ margin-top:30px; color:var(--text-soft); font-size:.8rem; opacity:.7; }

/* ---------- Reveal on scroll ---------- */
.reveal{ opacity:0; transform:translateY(38px); transition:opacity .9s var(--ease-out),transform .9s var(--ease-out); }
.reveal.in{ opacity:1; transform:none; }
.reveal.d1{ transition-delay:.08s; } .reveal.d2{ transition-delay:.16s; }
.reveal.d3{ transition-delay:.24s; } .reveal.d4{ transition-delay:.32s; }

/* ---------- Scroll progress bar ---------- */
.progress{ position:fixed; top:0; left:0; height:3px; background:var(--accent); z-index:60; width:0%; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity:1 !important; transform:none !important; transition:none !important; }
  .hero-card{ opacity:1 !important; transform:none !important; }
  .hero-scroll-cue .line{ animation:none; }
  .marquee-track{ animation:none; }
  html{ scroll-behavior:auto; }
}

/* focus visibility */
:focus-visible{ outline:2px solid var(--accent-ink); outline-offset:3px; }

/* ============================================================
   CATEGORY PAGES (product galleries)
   ============================================================ */
.page-header{ padding-top:clamp(120px,16vw,180px); padding-bottom:clamp(30px,5vw,50px); }
.breadcrumb{ font-family:var(--font-display); letter-spacing:.14em; font-size:.8rem; color:var(--text-soft); margin-bottom:1.2em; }
.breadcrumb a{ color:var(--text-soft); border-bottom:1px solid transparent; }
.breadcrumb a:hover{ color:var(--accent-ink); border-color:var(--accent-ink); }
.page-header h1{ font-size:var(--step-4); }
.page-header .lede{ margin-top:.7em; }
.credibility{
  margin-top:1.4em; padding-top:1.2em; border-top:1px solid var(--hair);
  font-family:var(--font-display); letter-spacing:.08em; font-size:.85rem; color:var(--brass);
}
.credibility strong{ color:var(--accent-ink); font-weight:400; }

.page-hero-img{ margin-bottom:clamp(40px,6vw,70px); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); max-height:560px; }
.page-hero-img img{ width:100%; height:100%; max-height:560px; object-fit:cover; }

.gallery-grid{
  display:grid; grid-template-columns:repeat(4,1fr); gap:2px;
  background:var(--hair); border:1px solid var(--hair);
}
.gallery-item{
  position:relative; aspect-ratio:1/1; background:var(--surface); overflow:hidden;
  border:0; padding:0; cursor:zoom-in; display:block;
}
.gallery-item img{ width:100%; height:100%; object-fit:cover; transition:transform .6s var(--ease-out),filter .4s; filter:saturate(.92) brightness(.92); }
.gallery-item:hover img{ transform:scale(1.06); filter:saturate(1) brightness(1); }
.gallery-item::after{
  content:'+'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-size:2rem; color:#fff; background:rgba(0,0,0,0);
  opacity:0; transition:opacity .3s, background .3s;
}
.gallery-item:hover::after{ opacity:1; background:rgba(0,0,0,.28); }
@media (max-width:960px){ .gallery-grid{ grid-template-columns:repeat(2,1fr); } }

/* cross-links to other categories */
.category-nav{ margin-top:clamp(50px,7vw,90px); padding-top:clamp(30px,4vw,50px); border-top:1px solid var(--hair); }
.category-nav .eyebrow{ margin-bottom:1em; }
.category-pills{ display:flex; flex-wrap:wrap; gap:10px; }
.category-pills a{
  padding:.6em 1.2em; border:1px solid var(--hair); border-radius:var(--radius-pill);
  font-family:var(--font-display); letter-spacing:.08em; font-size:.82rem; color:var(--text-soft);
  transition:border-color .25s,color .25s;
}
.category-pills a:hover, .category-pills a.current{ border-color:var(--accent-ink); color:var(--accent-ink); }

/* ---------- Lightbox ---------- */
.lightbox{
  position:fixed; inset:0; z-index:100; background:rgba(6,4,2,.94);
  display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none; transition:opacity .3s var(--ease-out);
}
.lightbox.open{ opacity:1; pointer-events:auto; }
.lightbox-frame{ max-width:min(90vw,1000px); max-height:86vh; display:flex; flex-direction:column; align-items:center; gap:14px; }
.lightbox-frame img{ max-width:100%; max-height:76vh; width:auto; height:auto; border-radius:2px; box-shadow:0 30px 70px -20px rgba(0,0,0,.7); }
.lightbox-count{ font-family:var(--font-display); letter-spacing:.1em; color:var(--text-soft); font-size:.85rem; }
.lightbox-close, .lightbox-prev, .lightbox-next{
  position:fixed; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.18); color:#fff;
  width:46px; height:46px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-size:1.1rem; transition:background .25s,border-color .25s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover{ background:rgba(255,255,255,.16); border-color:var(--accent-ink); }
.lightbox-close{ top:24px; right:24px; }
.lightbox-prev{ left:24px; top:50%; transform:translateY(-50%); }
.lightbox-next{ right:24px; top:50%; transform:translateY(-50%); }
@media (max-width:700px){
  .lightbox-prev{ left:10px; } .lightbox-next{ right:10px; } .lightbox-close{ top:14px; right:14px; }
  .lightbox-prev, .lightbox-next, .lightbox-close{ width:44px; height:44px; }
}
