/* ==========================================================================
   App Commandos — common.css
   Shared design system: tokens, base, typography, nav, footer, heroes,
   sections, cards, buttons, ornaments. Page-specific rules live in
   /css/<page>.css files.
   Palette source: _reference/app-commandos-theme-color-guide.pdf
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subsets) ---------- */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/site/cinzel-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/site/eb-garamond-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/site/eb-garamond-latin-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
  --color-primary: #D0AB6F;
  --color-primary-hover: #DEB76D;
  --color-primary-active: #AF8E5D;
  --color-secondary: #91744B;
  --color-accent: #F0D9A2;
  --color-background: #090806;
  --color-surface: #2C2418;
  --color-surface-hover: #493721;
  --color-text: #FCF7DD;
  --color-text-muted: #AF8E5D;
  --color-border: #493721;
  --color-border-strong: #91744B;
  --color-focus: #F0D9A2;

  /* Derived shades */
  --color-surface-deep: #171310;   /* panels a step above the void          */
  --color-ink: #090806;            /* text on gold                          */
  --gold-gradient: linear-gradient(105deg, #91744B 0%, #D0AB6F 38%, #F0D9A2 52%, #D0AB6F 66%, #91744B 100%);

  --font-display: 'Cinzel', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: 'EB Garamond', 'Iowan Old Style', Palatino, Georgia, serif;

  --container: 1200px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-soft: 0 10px 34px rgba(0, 0, 0, 0.55);
  --shadow-lift: 0 18px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--color-border-strong), 0 0 34px rgba(208, 171, 111, 0.12);
  --header-h: 76px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

/* Fixed mythical backdrop on inner pages: a position-fixed layer (not
   background-attachment) so it stays put on iOS too. */
body.myth-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(9, 8, 6, 0.84), rgba(9, 8, 6, 0.84)),
    url('/images/brand/bg-mythical-opt.webp?v=1') center / cover no-repeat;
  pointer-events: none;
}
@supports (background-image: image-set(url('/images/brand/bg-mythical-opt.avif') type('image/avif'))) {
  body.myth-bg::before {
    background-image:
      linear-gradient(rgba(9, 8, 6, 0.84), rgba(9, 8, 6, 0.84)),
      image-set(
        url('/images/brand/bg-mythical-opt.avif?v=1') type('image/avif'),
        url('/images/brand/bg-mythical-opt.webp?v=1') type('image/webp')
      );
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
  }
}

body {
  margin: 0;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.2rem;            /* Garamond runs small — 19.2px reads like 17px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 0.6em;
  color: var(--color-text);
  text-wrap: balance;
}

p { margin: 0 0 1.1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
blockquote, figure { margin: 0; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--color-accent); }

strong, b { font-weight: 700; color: var(--color-text); }
em, i { font-style: italic; }

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

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}

/* ---------- Ornaments ---------- */
/* Blade divider — echoes the flourish under the wordmark */
.ornament {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.4rem 0 2.2rem;
  color: var(--color-secondary);
}
.ornament::before,
.ornament::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--color-secondary));
}
.ornament::after {
  background: linear-gradient(90deg, var(--color-secondary), transparent);
}
.ornament .gem {
  width: 9px; height: 9px;
  background: var(--color-primary);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(208, 171, 111, 0.65);
}
.ornament.is-centered { justify-content: center; }
.ornament.is-narrow { max-width: 420px; margin-inline: auto; }

/* Small-caps kicker above headings */
.kicker {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

/* Gold engraved text effect for big headings */
.gilded { color: var(--color-primary); }
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .gilded {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 14px rgba(208, 171, 111, 0.22));
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.95rem 1.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.25s ease, transform 0.15s ease;
}
.btn-primary {
  background: linear-gradient(180deg, var(--color-primary-hover), var(--color-primary) 55%, var(--color-primary-active));
  color: var(--color-ink);
  border-color: var(--color-primary-active);
  box-shadow: 0 6px 22px rgba(208, 171, 111, 0.28), inset 0 1px 0 rgba(252, 247, 221, 0.5);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #EAC98A, var(--color-primary-hover) 55%, var(--color-primary));
  color: var(--color-ink);
  box-shadow: 0 8px 30px rgba(208, 171, 111, 0.42), inset 0 1px 0 rgba(252, 247, 221, 0.6);
  transform: translateY(-1px);
}
.btn-primary:active {
  background: var(--color-primary-active);
  transform: translateY(0);
}
.btn-outline {
  background: rgba(44, 36, 24, 0.4);
  color: var(--color-accent);
  border-color: var(--color-border-strong);
}
.btn-outline:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
  border-color: var(--color-primary);
}

/* ==========================================================================
   Site header / navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(9, 8, 6, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: rgba(9, 8, 6, 0.97); }
}
.site-header.is-scrolled {
  background: rgba(9, 8, 6, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
  padding-block: 0.6rem;
}
.brand img { display: block; }
.brand .brand-word { width: auto; height: 46px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.4vw, 2.1rem);
}
.nav-link,
.nav-drop-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text);
  background: none;
  border: 0;
  padding: 0.4rem 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.nav-link::after,
.nav-drop-btn::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--gold-gradient);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}
.nav-link:hover,
.nav-drop-btn:hover,
.nav-link:focus-visible,
.nav-drop-btn:focus-visible {
  color: var(--color-accent);
}
.nav-link:hover::after,
.nav-drop-btn:hover::after,
.nav-link.is-active::after,
.nav-drop-btn.is-active::after {
  transform: scaleX(1);
}
.nav-link.is-active,
.nav-drop-btn.is-active { color: var(--color-primary); }

/* Services dropdown */
.nav-drop { position: relative; }
.nav-drop-caret {
  width: 12px; height: 12px;
  transition: transform 0.2s ease;
}
.nav-drop.is-open .nav-drop-caret { transform: rotate(180deg); }
.nav-drop-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  min-width: 240px;
  padding: 0.5rem 0;
  background: var(--color-surface-deep);
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 300;
}
.nav-drop-menu::before {           /* gold hairline on top of the panel */
  content: '';
  position: absolute;
  top: 0; left: 14px; right: 14px;
  height: 1px;
  background: var(--gold-gradient);
}
.nav-drop.is-open .nav-drop-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-drop-menu a {
  display: block;
  padding: 0.7rem 1.3rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-drop-menu a:hover,
.nav-drop-menu a:focus-visible {
  background: var(--color-surface-hover);
  color: var(--color-accent);
}
.nav-drop-menu a.is-active { color: var(--color-primary); }

/* Hamburger */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  background: transparent;
  border: 1px solid var(--color-border-strong);
  border-radius: 9px;
  color: var(--color-primary);
  cursor: pointer;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: '';
  display: block;
  width: 20px; height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before { position: absolute; top: -6px; left: 0; }
.nav-toggle-bar::after  { position: absolute; top: 6px;  left: 0; }
.site-header.is-open .nav-toggle-bar { background: transparent; }
.site-header.is-open .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.site-header.is-open .nav-toggle-bar::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .brand .brand-word { height: 36px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 1.25rem 1.4rem;
    background: #0B0906;
    border-bottom: 1px solid var(--color-border-strong);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.6);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.22s ease, transform 0.22s ease;
  }
  .site-header.is-open .nav-links {
    max-height: 560px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-link, .nav-drop-btn { padding: 0.55rem 0; font-size: 0.95rem; }
  .nav-drop { width: 100%; text-align: center; }
  .nav-drop-btn { width: 100%; justify-content: center; }
  .nav-drop-menu {
    position: static;
    min-width: 0;
    width: 100%;
    transform: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--color-border-strong);
    border-radius: 0;
    background: rgba(44, 36, 24, 0.35);
    max-height: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease;
  }
  .nav-drop-menu::before { display: none; }
  .nav-drop.is-open .nav-drop-menu {
    max-height: 220px;
    opacity: 1;
    transform: none;
    padding: 0.3rem 0;
    pointer-events: auto;
  }
}

/* ==========================================================================
   Page hero (inner pages) — set the image per page:
   <section class="page-hero" style="--hero-bg:url('...')">
   ========================================================================== */
.page-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: clamp(360px, 48vh, 460px);
  padding: 5rem 1.25rem 4.5rem;
  overflow: hidden;
  background-color: var(--color-background);
  background-image:
    radial-gradient(ellipse 90% 80% at 50% 110%, rgba(9, 8, 6, 0.3) 0%, rgba(9, 8, 6, 0.92) 70%),
    linear-gradient(180deg, rgba(9, 8, 6, 0.88) 0%, rgba(20, 15, 9, 0.82) 55%, var(--color-background) 100%),
    var(--hero-bg, none);
  background-size: auto, auto, cover;
  background-position: center;
}
.page-hero::after {                /* gold hairline along the bottom edge */
  content: '';
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(680px, 80%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-secondary) 30%, var(--color-accent) 50%, var(--color-secondary) 70%, transparent);
}
.page-hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}
.page-hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 0.9rem;
}
.page-hero p {
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-style: italic;
  color: var(--color-accent);
  opacity: 0.92;
  margin: 0 auto;
  max-width: 640px;
}

/* ==========================================================================
   Content sections
   ========================================================================== */
main { display: block; }
.page-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 4.5rem) clamp(1.1rem, 4vw, 2rem) clamp(3.5rem, 8vw, 5.5rem);
}

.content-section { margin-bottom: clamp(3rem, 7vw, 4.5rem); }
.content-section:last-child { margin-bottom: 0; }

.content-section > h2 {
  position: relative;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  letter-spacing: 0.03em;
  padding-bottom: 0.85rem;
  margin-bottom: 1.4rem;
}
.content-section > h2::after {     /* short gold blade under headings */
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 92px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), transparent);
}
.content-section p {
  color: #E9DFC0;                  /* ivory, slightly dimmed for long copy */
  max-width: 76ch;
}
.content-section p strong { color: var(--color-accent); font-weight: 600; }

/* Framed imagery — engraved plate look */
.image-section {
  position: relative;
  margin: 2.4rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--color-surface-deep);
}
.image-section img {
  width: 100%;
  filter: sepia(0.14) saturate(0.86) contrast(1.02);
}

/* Feature / info cards */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.6rem;
  margin: 2.4rem 0;
}
.feature-card {
  position: relative;
  background: linear-gradient(165deg, var(--color-surface) 0%, var(--color-surface-deep) 100%);
  border-radius: var(--radius);
  padding: 1.9rem 1.7rem;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-lift);
}
.feature-card h3 {
  font-size: 1.22rem;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  margin-bottom: 0.8rem;
}
.feature-card p {
  font-size: 1.08rem;
  line-height: 1.6;
  color: #DCCFA8;
  margin: 0;
}

/* Themed bullet lists (replaces old inline-styled discs) */
.themed-list {
  margin: 0 0 1.5rem;
  max-width: 76ch;
}
.themed-list li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: 0.65rem;
  color: #E9DFC0;
}
.themed-list li::before {
  content: '';
  position: absolute;
  left: 2px; top: 0.62em;
  width: 7px; height: 7px;
  background: var(--color-primary);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(208, 171, 111, 0.5);
}
.themed-list li strong { color: var(--color-accent); }

/* Generic dark panel (CTA blocks, feature sections) */
.panel {
  position: relative;
  background: linear-gradient(165deg, var(--color-surface) 0%, var(--color-surface-deep) 90%);
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 5vw, 3rem);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.panel::before {
  content: none;
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0.55;
}

/* Inline text links inside copy */
.text-link {
  color: var(--color-primary);
  font-weight: 600;
  border-bottom: 1px solid rgba(208, 171, 111, 0.4);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.text-link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.text-link svg { display: inline-block; vertical-align: -0.15em; }

/* ---------- Scroll reveal (JS adds .is-visible; no-JS stays visible) ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  position: relative;
  margin-top: clamp(3rem, 8vw, 5rem);
  background: linear-gradient(180deg, var(--color-background) 0%, #14100B 60%, #1A1510 100%);
  border-top: 1px solid var(--color-border);
  padding: 3rem 1.5rem 2.2rem;
  text-align: center;
}
.site-footer::before {             /* gold hairline over the border */
  content: '';
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  width: min(520px, 70%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}
.site-footer-crest {
  width: 58px; height: 58px;
  margin: 0 auto 1.1rem;
  filter: drop-shadow(0 4px 14px rgba(208, 171, 111, 0.25));
}
.site-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 1.3rem;
}
.site-footer-links a {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.site-footer-links a:hover { color: var(--color-accent); }
.site-footer-copy {
  margin: 0;
  font-size: 1.02rem;
  color: var(--color-text-muted);
}
