/* ============================================================
   TG Woodworking - Homepage Concept
   Design language: Heritage Craft (#12) - type, spacing, composition
   Palette: TG Woodworking's own brass gold (#a2834e, #e7bd74)
   plus warm espresso wood darks drawn from their photography
   ============================================================ */

:root {
  /* Backgrounds */
  --parchment:   #f5efe3;
  --wheat:       #ebe1cc;
  --espresso:    #241a10;
  --dark-roast:  #170f08;

  /* Accent: their brand gold family */
  --brass:       #a2834e;
  --brass-deep:  #775d34;
  --gold:        #d9b678;
  --brass-muted: rgba(162, 131, 78, 0.16);

  /* Text */
  --text-dark:   #2a2014;
  --text-body:   #57493a;
  --text-muted:  #746653;
  --text-light:  #f3ecdd;
  --text-light-muted: rgba(243, 236, 221, 0.82);

  /* Type */
  --font-display: 'EB Garamond', serif;
  --font-body:    'Karla', sans-serif;

  /* Layout */
  --gutter: clamp(1.5rem, 4vw, 3rem);
  --nav-height: 84px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--parchment);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.container { width: min(90%, 1100px); margin-inline: auto; }
.container-narrow { width: min(85%, 900px); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; color: var(--text-dark); }

section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }

/* ---------- eyebrow + ornament ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--brass-deep);
  margin-bottom: 1.4rem;
}
.eyebrow::before { content: ""; width: 38px; height: 1px; background: var(--brass); }
.on-dark .eyebrow { color: var(--gold); }
.on-dark .eyebrow::before { background: var(--gold); }

.ornament {
  display: flex; align-items: center; justify-content: center;
  gap: 0.9rem; margin: 2.6rem auto 0; width: min(85%, 320px);
}
.ornament::before, .ornament::after {
  content: ""; flex: 1; height: 1px;
  background: currentColor; opacity: 0.35;
}
.ornament .gem {
  width: 7px; height: 7px; transform: rotate(45deg);
  background: var(--brass); flex: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.8rem;
  padding: 0.95rem 1.9rem; border-radius: 100px;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 500;
  letter-spacing: 0.05em; text-decoration: none; cursor: pointer;
  transition: transform 0.5s var(--ease), background 0.5s var(--ease),
              color 0.5s var(--ease), border-color 0.5s var(--ease);
  will-change: transform;
}
.btn .gem {
  width: 6px; height: 6px; transform: rotate(45deg); flex: none;
  background: currentColor; transition: transform 0.5s var(--ease);
}
.btn:hover .gem { transform: rotate(225deg); }
.btn-solid { background: var(--brass-deep); color: #fff; }
.btn-solid:hover { background: #5f4a29; transform: translateY(-2px); }
.btn-ghost-light { border: 1px solid rgba(243, 236, 221, 0.4); color: var(--text-light); }
.btn-ghost-light:hover { border-color: var(--gold); color: var(--gold); }
.btn-ghost-dark { border: 1px solid rgba(42, 32, 20, 0.35); color: var(--text-dark); }
.btn-ghost-dark:hover { border-color: var(--brass-deep); color: var(--brass-deep); }

/* ---------- navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-height);
  display: flex; align-items: center;
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.nav.scrolled { background: rgba(23, 15, 8, 0.96); box-shadow: 0 1px 0 rgba(217, 182, 120, 0.14); }
.nav-inner {
  width: min(92%, 1240px); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { text-decoration: none; line-height: 1.15; }
.nav-brand .wordmark {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.35rem; color: var(--text-light); letter-spacing: 0.02em;
  display: block;
}
.nav-brand .est {
  display: block; font-size: 0.6rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--gold);
}
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a:not(.btn) {
  font-size: 0.82rem; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; text-decoration: none;
  color: var(--text-light-muted); transition: color 0.4s var(--ease);
}
.nav-links a:not(.btn):hover { color: var(--gold); }
.nav-links .btn { padding: 0.65rem 1.4rem; font-size: 0.8rem; }

.burger {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; position: relative; z-index: 320;
}
.burger span {
  display: block; width: 26px; height: 2px; background: var(--text-light);
  margin: 6px auto; transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}
.burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 300;
  background: var(--dark-roast);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--gutter);
  opacity: 0; visibility: hidden; transition: opacity 0.45s var(--ease), visibility 0.45s var(--ease);
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.4rem; }
.mobile-menu nav a {
  font-family: var(--font-display); font-size: clamp(2rem, 8vw, 2.8rem);
  color: var(--text-light); text-decoration: none; padding-block: 0.35rem;
  border-bottom: 1px solid rgba(243, 236, 221, 0.08);
  transition: color 0.4s var(--ease), padding-left 0.4s var(--ease);
}
.mobile-menu nav a:hover { color: var(--gold); padding-left: 0.5rem; }
.mobile-menu .menu-cta { margin-top: 2.2rem; }
.mobile-menu .menu-note {
  margin-top: 2rem; font-size: 0.78rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-light-muted);
}

/* ---------- hero ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh;
  min-height: 560px; overflow: hidden; padding: 0;
  display: flex; align-items: flex-end;
  background: var(--dark-roast);
}
.hero-bg { position: absolute; inset: -6% 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(23, 15, 8, 0.68) 0%, rgba(23, 15, 8, 0.46) 40%, rgba(23, 15, 8, 0.86) 100%);
}
.hero-content {
  position: relative; z-index: 1;
  width: min(90%, 1100px); margin-inline: auto;
  padding-bottom: clamp(3rem, 8vh, 5.5rem);
}
.hero h1 {
  color: var(--text-light);
  font-size: clamp(2.6rem, 6.5vw, 4.8rem);
  line-height: 1.06; max-width: 15ch; font-weight: 500;
}
.hero h1 em { font-style: italic; color: var(--gold); }
.hero-sub {
  margin-top: 1.4rem; max-width: 54ch;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--text-light-muted);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.2rem; }

/* ---------- intro ---------- */
.intro { background: var(--parchment); }
.intro-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem); align-items: start;
}
.intro h2 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.12; max-width: 18ch; }
.intro-copy p + p { margin-top: 1.2rem; }
.intro-copy .lead::first-letter {
  font-family: var(--font-display);
  font-size: 3.4em; line-height: 0.82; float: left;
  padding-right: 0.14em; padding-top: 0.08em;
  color: var(--brass-deep);
}
.cred-strip {
  margin-top: clamp(2.8rem, 6vw, 4rem);
  border-top: 1px solid rgba(162, 131, 78, 0.35);
  border-bottom: 1px solid rgba(162, 131, 78, 0.35);
  padding: 1.4rem 0;
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 1rem 2rem;
}
.cred-strip span {
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--brass-deep);
}

/* ---------- craft rows ---------- */
.craft { background: var(--wheat); }
.craft-head { text-align: center; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.craft-head .eyebrow { justify-content: center; }
.craft-head .eyebrow::after { content: ""; width: 38px; height: 1px; background: var(--brass); }
.craft-head h2 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 24ch; margin-inline: auto; }
.craft-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.craft-row + .craft-row { margin-top: clamp(3rem, 7vw, 5.5rem); }
.craft-row-flip .craft-media { order: 2; }
.craft-media { position: relative; }
.craft-media img {
  width: 100%; height: clamp(300px, 40vw, 460px); object-fit: cover;
}
.craft-media::after {
  content: ""; position: absolute; inset: 12px;
  border: 1px solid rgba(245, 239, 227, 0.55); pointer-events: none;
}
.craft-num {
  font-family: var(--font-display); font-style: italic;
  color: var(--brass-deep); font-size: 1.05rem; letter-spacing: 0.08em;
  display: block; margin-bottom: 0.6rem;
}
.craft-copy h3 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1.15; max-width: 18ch; }
.craft-copy p { margin-top: 1rem; max-width: 46ch; }

/* ---------- ledger (signature) ---------- */
.ledger { background: var(--espresso); position: relative; }
.ledger h2 { color: var(--text-light); font-size: clamp(1.9rem, 4vw, 3rem); max-width: 20ch; }
.ledger-sub { margin-top: 1rem; color: var(--text-light-muted); max-width: 52ch; }
.ledger-list { list-style: none; margin-top: clamp(2.2rem, 5vw, 3.5rem); }
.ledger-list li { border-bottom: 1px solid rgba(217, 182, 120, 0.16); }
.ledger-list li:first-child { border-top: 1px solid rgba(217, 182, 120, 0.16); }
.ledger-row {
  display: grid; grid-template-columns: 4.5rem 1fr auto;
  align-items: baseline; gap: 1.2rem;
  padding: 1.05rem 0.2rem;
  text-decoration: none;
  transition: padding-left 0.5s var(--ease), background 0.5s var(--ease);
}
.ledger-row:hover { padding-left: 1rem; background: rgba(217, 182, 120, 0.05); }
.ledger-row .no {
  font-family: var(--font-display); font-style: italic;
  font-size: 0.95rem; color: var(--brass); letter-spacing: 0.06em;
}
.ledger-row .name {
  font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  color: var(--text-light); line-height: 1.25;
  transition: color 0.4s var(--ease);
}
.ledger-row:hover .name { color: var(--gold); }
.ledger-row .hint {
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-light-muted); opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.ledger-row:hover .hint { opacity: 0.9; }
.ledger-preview {
  position: fixed; z-index: 150; pointer-events: none;
  width: 300px; height: 210px; overflow: hidden;
  opacity: 0; transform: scale(0.94);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: none;
}
.ledger-preview img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 0.3s var(--ease);
}
.ledger-preview img.active { opacity: 1; }
.ledger-preview.visible { opacity: 1; transform: scale(1); }
@media (min-width: 1025px) and (hover: hover) {
  .ledger-preview { display: block; }
}

/* ---------- story ---------- */
.story { background: var(--parchment); }
.story-grid {
  display: grid; grid-template-columns: minmax(0, 420px) 1fr;
  gap: clamp(2.5rem, 6vw, 5rem); align-items: center;
}
.story-photo { position: relative; }
.story-photo img { width: 100%; }
.story-photo::before {
  content: ""; position: absolute; top: -14px; left: -14px;
  right: 14px; bottom: 14px;
  border: 1px solid var(--brass); z-index: 0; pointer-events: none;
}
.story-photo img { position: relative; z-index: 1; }
.story-photo figcaption {
  margin-top: 0.9rem; font-size: 0.82rem; font-style: italic;
  font-family: var(--font-display); color: var(--text-muted);
  line-height: 1.5;
}
.story-copy h2 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.12; max-width: 18ch; }
.story-copy p { margin-top: 1.2rem; max-width: 52ch; }

/* ---------- gallery ---------- */
.gallery { background: var(--dark-roast); }
.gallery.on-dark h2 { color: var(--text-light); font-size: clamp(1.9rem, 4vw, 3rem); }
.gallery-grid {
  margin-top: clamp(2.2rem, 5vw, 3.5rem);
  columns: 3; column-gap: 1.2rem;
}
.gallery-grid figure {
  break-inside: avoid; margin-bottom: 1.2rem; position: relative;
  overflow: hidden;
}
.gallery-grid img {
  width: 100%; transition: transform 1.2s var(--ease);
}
.gallery-grid figure:hover img { transform: scale(1.035); }
.gallery-grid figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.6rem 1rem 0.8rem;
  font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-light);
  background: linear-gradient(180deg, rgba(23, 15, 8, 0) 0%, rgba(23, 15, 8, 0.9) 100%);
}

/* ---------- video ---------- */
.video { background: var(--parchment); }
.video-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(2.5rem, 6vw, 5rem); align-items: center;
}
.video-copy h2 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.12; max-width: 16ch; }
.video-copy p { margin-top: 1.2rem; max-width: 44ch; }
.video-copy .btn { margin-top: 1.8rem; }
.video-frame {
  position: relative; aspect-ratio: 16 / 9; background: var(--espresso);
  box-shadow: 0 26px 70px rgba(42, 32, 20, 0.28);
}
.video-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* ---------- cta ---------- */
.cta { background: var(--espresso); text-align: center; }
.cta .eyebrow { justify-content: center; }
.cta .eyebrow::after { content: ""; width: 38px; height: 1px; background: var(--gold); }
.cta h2 {
  color: var(--text-light); font-size: clamp(2rem, 4.5vw, 3.3rem);
  line-height: 1.1; max-width: 20ch; margin-inline: auto;
}
.cta h2 em { font-style: italic; color: var(--gold); }
.cta p { margin: 1.4rem auto 0; max-width: 50ch; color: var(--text-light-muted); }
.cta-btns { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; margin-top: 2.4rem; }
.cta .email-line { margin-top: 2rem; font-size: 0.95rem; }
.cta .email-line a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(217, 182, 120, 0.4); }

/* ---------- footer ---------- */
.footer { background: var(--dark-roast); padding: clamp(2.8rem, 6vw, 4rem) 0 2rem; }
.footer-grid {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 2rem; align-items: flex-start;
}
.footer .wordmark {
  font-family: var(--font-display); font-size: 1.5rem;
  color: var(--text-light); display: block; line-height: 1.2;
}
.footer .est {
  font-size: 0.62rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.8rem; list-style: none; }
.footer-links a {
  font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-light-muted); text-decoration: none;
  transition: color 0.4s var(--ease);
  display: inline-block;
}
.footer-links a:hover { color: var(--gold); }
.footer-contact { font-size: 0.9rem; color: var(--text-light-muted); text-align: right; }
.footer-contact a { color: var(--text-light); text-decoration: none; }
.footer-contact a:hover { color: var(--gold); }
.footer-base {
  margin-top: 2.5rem; padding-top: 1.4rem;
  border-top: 1px solid rgba(243, 236, 221, 0.08);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem;
  font-size: 0.76rem; color: rgba(243, 236, 221, 0.62);
}

/* ---------- 404 ---------- */
.error-section {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; background: var(--espresso);
  padding: calc(var(--nav-height) + 2rem) 0 4rem;
}
.error-code {
  font-family: var(--font-display); font-size: clamp(6rem, 18vw, 11rem);
  line-height: 1; color: var(--brass-muted); font-style: italic;
}
.error-section h1 { color: var(--text-light); font-size: clamp(1.8rem, 4vw, 2.6rem); margin-top: 0.6rem; }
.error-section p { color: var(--text-light-muted); max-width: 46ch; margin: 1.2rem auto 2.2rem; }

/* ---------- reveal animation base ---------- */
.reveal { opacity: 0; transform: translateY(28px); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .burger { display: block; }
  .gallery-grid { columns: 2; }
}

@media (max-width: 768px) {
  .hero { height: auto; min-height: 100svh; align-items: flex-end; }
  .intro-grid, .craft-row, .story-grid, .video-grid { grid-template-columns: 1fr; }
  .craft-row-flip .craft-media { order: 0; }
  .craft-media img { height: clamp(240px, 55vw, 380px); }
  .video-grid { gap: 2rem; }
  .story-grid { gap: 3rem; }
  .story-photo { margin-inline: 14px; }
  .footer-contact { text-align: left; }
  .cred-strip { flex-direction: column; gap: 0.7rem; }
}

@media (max-width: 640px) {
  .gallery-grid { columns: 1; }
  .hero-ctas .btn, .cta-btns .btn { width: 100%; justify-content: center; }
  .ledger-row { grid-template-columns: 3rem 1fr; }
  .ledger-row .hint { display: none; }
  .footer-links a { padding-block: 0.65rem; }
  .footer-links { gap: 0 1.4rem; }
}

/* ---------- Mobile drawer close control ---------- */
/* The burger doubles as the close (X), but the nav's own z-index traps it in a
   stacking context below the drawer, so it is painted over and cannot be tapped.
   This control lives inside the drawer, so it is always visible and always hits. */
#mobileMenu .mnav-close {
  position: absolute;
  top: max(0.85rem, env(safe-area-inset-top, 0px));
  right: 0.85rem;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: rgb(243, 236, 221);
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
#mobileMenu .mnav-close::before,
#mobileMenu .mnav-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 21px;
  height: 1.5px;
  margin: -0.75px 0 0 -10.5px;
  background: currentColor;
  border-radius: 2px;
}
#mobileMenu .mnav-close::before { transform: rotate(45deg); }
#mobileMenu .mnav-close::after { transform: rotate(-45deg); }
#mobileMenu .mnav-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
