/* ============================================================
   FRNTIR — layout.css
   Single source of truth for shared styles across all pages.
   Edit once, affects the whole site.
   ============================================================ */

/* ── SELF-HOSTED FONTS (eliminates render-blocking Google Fonts request) ── */
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/fonts/dm-sans-300.woff2) format('woff2'); }
@font-face { font-family: 'DM Serif Display'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/dm-serif-display-400.woff2) format('woff2'); }
@font-face { font-family: 'DM Serif Display'; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/dm-serif-display-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/barlow-condensed-400.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/barlow-condensed-500.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-700.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/barlow-condensed-800.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 900; font-display: swap; src: url(/fonts/barlow-condensed-900.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/barlow-400.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/barlow-500.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/barlow-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/barlow-700.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/barlow-800.woff2) format('woff2'); }
@font-face { font-family: 'Rubik Dirt'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/rubik-dirt-400.woff2) format('woff2'); }
@font-face { font-family: 'Courier Prime'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/courier-prime-400.woff2) format('woff2'); }
@font-face { font-family: 'Courier Prime'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/courier-prime-700.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/jetbrains-mono-400.woff2) format('woff2'); }

/* ── DESIGN TOKENS ── */
:root {
  --parchment: #F5EDD8;
  --parchment2: #EDE0C4;
  --border: #D9C9A8;
  --dust: #D4B896;
  --sand: #D4A96A;
  --mesa: #8B4513;
  --mesa-light: #C07845;
  --ember: #E06040;
  --mustard: #D4A520;
  --mustard-bright: #D4A90C;
  --wood: #5C3317;
  --ink: #2C1810;
  --ink-deep: #1E110B;
  --muted: #9B8060;
  --readable: #A8906A;
  --sage: #4A7C6F;
  --sage-light: #5E9485;
  --sage-glow: rgba(74,124,111,0.3);
  --ember-rgb: 224,96,64;
  --sand-rgb: 212,169,106;
  --sage-rgb: 74,124,111;
  --mustard-rgb: 212,169,12;
  --parchment-rgb: 245,237,216;
  --leather: #3D2417;
  --leather-light: #4E3020;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
a:visited { color: inherit; }
html { background: var(--ink); }

/* ── BODY (dark-theme default — light pages override in their own <style>) ── */
body {
  background: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  color: var(--parchment);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── GRAIN OVERLAY ──
   Dark pages: 10% opacity grain (default).
   Light pages: use .page-burn on <body> for subtler 4% grain with warm vignette. */
body::before {
  content: '';
  position: fixed;
  top: 60px; left: 0; right: 0; bottom: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 256px;
  opacity: 0.10;
  will-change: transform;
}
/* Light-page grain + vignette burn */
body.page-burn::before {
  opacity: 0.08;
  top: 0;
  z-index: 1;
}
body.page-burn::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(139,69,19,0.08) 100%);
}

/* ── ACCESSIBILITY ── */
:focus-visible { outline: 2px solid var(--sage-light); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--sage-light); outline-offset: 0;
}
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 10001;
  background: var(--sage); color: #fff; padding: 12px 20px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 0.88rem; letter-spacing: 2px; text-transform: uppercase;
  text-decoration: none; border-radius: 0 0 4px 4px;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── FLOATING NAV ── */
.floating-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10000;
  padding: 20px 48px;
  display: flex; justify-content: space-between; align-items: center;
  background: #1E110B;
  pointer-events: none;
  border-bottom: none;
  -webkit-backdrop-filter: blur(0.5px);
  backdrop-filter: blur(0.5px);
}
.floating-nav a, .floating-nav button { pointer-events: all; }
.floating-nav a, .floating-nav a:visited { color: var(--muted, #7A6248) !important; }
.floating-nav a:hover, .floating-nav a:focus-visible { color: var(--sage-light, #5E9485) !important; }

/* ── NAV DESKTOP LINKS ── */
.mobile-nav-hide {
  display: flex; align-items: center; gap: 28px; pointer-events: all;
}
.mobile-nav-hide a {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600; font-size: 0.85rem;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  transition: color 0.2s;
}

/* ── LOGO ── */
.logo {
  font-family: 'Rubik Dirt', 'DM Serif Display', Georgia, serif;
  font-size: 38.4px;
  letter-spacing: 1px;
  text-decoration: none;
  line-height: 1;
}
.logo-tagline {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 600;
}

/* ── TEXTURED LOGO FILLS ──
   backdrop-filter on nav creates GPU compositing layer for crisp SVG text fill.
   blur(0.5px) has zero visual effect but triggers the compositing layer. */
.top-bar { -webkit-backdrop-filter: blur(0.5px); backdrop-filter: blur(0.5px); }
.nav-frn, .nav-tir {
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  color: transparent !important;
}
.nav-frn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='100'%3E%3Crect fill='%23D4A96A' width='200' height='100'/%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.5' numOctaves='4' seed='3' type='fractalNoise'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='100' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E"); }
.nav-tir { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='100'%3E%3Crect fill='%234A7C6F' width='200' height='100'/%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.5' numOctaves='4' seed='7' type='fractalNoise'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='100' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E"); }

/* ── MOBILE BURGER ── */
.mobile-burger {
  display: none; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; padding: 0;
  position: relative; z-index: 502; pointer-events: all;
}
.mobile-burger span {
  display: block; width: 22px; height: 2px;
  background: var(--dust, #D4B896); position: relative;
  transition: transform 0.3s ease, background 0.3s ease, top 0.3s ease;
}
.mobile-burger span::before, .mobile-burger span::after {
  content: ''; position: absolute; left: 0;
  width: 100%; height: 2px;
  background: var(--dust, #D4B896);
  transition: transform 0.3s ease, background 0.3s ease, top 0.3s ease;
}
.mobile-burger span::before { top: -7px; }
.mobile-burger span::after { top: 7px; }
.mobile-burger.open span { background: transparent; }
.mobile-burger.open span::before { top: 0; transform: rotate(45deg); }
.mobile-burger.open span::after { top: 0; transform: rotate(-45deg); }

/* ── MOBILE DRAWER ── */
.mobile-drawer-backdrop {
  display: none; position: fixed; inset: 0; z-index: 499;
  background: rgba(30,17,11,0.6); backdrop-filter: blur(4px);
}
.mobile-drawer-backdrop.open { display: block; }
.mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 500;
  width: 280px; max-width: 80vw;
  background: var(--ink-deep, #1E110B);
  border-left: 1px solid rgba(93,51,23,0.5);
  transform: translateX(100%); transition: transform 0.3s ease, visibility 0.3s;
  padding: 90px 28px 40px;
  overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 0;
  overflow-y: auto; visibility: hidden;
}
.mobile-drawer.open { transform: translateX(0); visibility: visible; }
.mobile-drawer a {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  font-size: 0.88rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--dust, #D4B896); text-decoration: none;
  padding: 16px 0; border-bottom: 1px solid rgba(212,169,106,0.08);
  transition: color 0.2s;
}
.mobile-drawer a:hover, .mobile-drawer a:focus { color: var(--sage-light, #5E9485); }
.mobile-drawer a:last-child { border-bottom: none; }

/* ── FOOTER ── */
.site-footer {
  background: var(--ink-deep, #1E110B); border-top: 3px solid var(--leather, #3D2417);
  padding: 18px 48px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px 24px;
  margin-top: auto;
  position: relative; z-index: 2;
}
.site-footer a, .site-footer a:visited {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  font-size: 0.82rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted) !important; text-decoration: none;
  padding: 12px 4px;
}
.site-footer a:hover, .site-footer a:focus-visible { color: var(--sage-light, #5E9485) !important; }
.site-footer .footer-logo {
  font-family: 'Rubik Dirt', 'DM Serif Display', Georgia, serif; font-size: 1.4rem;
}
.site-footer .footer-links {
  display: flex; gap: 24px; flex-wrap: wrap;
}
.site-footer .footer-address {
  font-family: 'Barlow', sans-serif; font-weight: 400;
  font-size: 0.75rem; letter-spacing: 1px; line-height: 1.4;
  color: var(--muted, #5C4A3A);
}
.site-footer .copyright {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 500;
  font-size: 0.75rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--dust, #D4B896);
  white-space: nowrap;
}

/* ── SHARED SECTION HEADINGS ── */
.section-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 48px;
}
.section-head::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(212,169,106,0.15);
}
.section-label {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  font-size: 0.84rem; letter-spacing: 4px; text-transform: uppercase;
  color: var(--mustard); white-space: nowrap;
}

/* ── SHARED BUTTONS ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--sage); color: #fff;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 1rem; letter-spacing: 3px; text-transform: uppercase;
  padding: 20px 44px;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 4px 24px var(--sage-glow);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover { background: var(--sage-light); transform: translateY(-2px); box-shadow: 0 8px 32px var(--sage-glow); }
.btn-primary .arr { transition: transform 0.2s; }
.btn-primary:hover .arr { transform: translateX(4px); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--dust);
  border: 2px solid var(--leather-light);
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  font-size: 0.88rem; letter-spacing: 3px; text-transform: uppercase;
  padding: 14px 24px;
  text-decoration: none; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--sage); color: var(--sage); }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVE: MOBILE NAV (900px) ── */
@media (max-width: 900px) {
  .mobile-nav-hide { display: none !important; }
  .mobile-burger { display: flex !important; }
  .floating-nav { padding: 16px 20px !important; }
  .floating-nav .logo { font-size: 32px !important; }
}

/* ── RESPONSIVE: TABLET (768px) ── */
@media (max-width: 768px) {
  .site-footer { padding: 32px 24px; flex-direction: column; align-items: flex-start; }
}

/* ── RESPONSIVE: SMALL (600px) ── */
@media (max-width: 600px) {
  .site-footer { padding: 12px 20px; gap: 2px; }
  .site-footer .footer-logo { font-size: 0.9rem; }
  .site-footer .footer-links { gap: 0 14px; }
  .site-footer a, .site-footer a:visited { padding: 3px 2px; font-size: 0.68rem; letter-spacing: 1.5px; }
  .site-footer .footer-address { font-size: 0.62rem; margin-top: 0; line-height: 1.3; }
  .site-footer .copyright { font-size: 0.62rem; letter-spacing: 1.5px; white-space: normal; line-height: 1.3; }
  /* iOS Safari auto-zooms inputs with font-size < 16px — prevent sitewide */
  input, textarea, select { font-size: 16px !important; }
  /* Mobile readability: thicker text + less grain for daylight viewing */
  body { -webkit-font-smoothing: auto; }
  body::before { opacity: 0.04; }
  body.page-burn::before { opacity: 0.03; }
}

/* ── LARGE MONITORS ── */
@media (min-width: 1440px) { html { font-size: 20px; } }
@media (min-width: 1800px) { html { font-size: 22px; } }
@media (min-width: 2200px) { html { font-size: 24px; } }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
