/* ==========================================================================
   Jackets Contracting LLC — theme.css
   Design tokens, reset, typography, and shared components.
   Direction: cinematic. Dark navy ground, full-bleed project photography,
   a single gold accent carried from the company wordmark.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Ground and surfaces — all tinted toward the brand navy, never neutral grey */
  --ground:        #070D13;
  --ground-raised: #0C151E;
  --surface:       #111C27;
  --surface-hi:    #16232F;
  --brand-deep:    #003F66;

  /* Ink */
  --ink:        #EDF2F6;
  --ink-muted:  #9DAEBC;
  --ink-dim:    #6C7E8D;
  --ink-on-gold:#0B131A;

  /* The one accent */
  --gold:      #C89A5C;
  --gold-hi:   #E3BC85;
  --gold-dim:  rgba(200, 154, 92, 0.30);
  --gold-faint:rgba(200, 154, 92, 0.11);

  /* Feedback */
  --error:     #E98C82;
  --error-bg:  rgba(233, 140, 130, 0.10);

  /* Lines and shadows — shadows carry the navy hue, never pure black */
  --line:       rgba(157, 174, 188, 0.16);
  --line-strong:rgba(157, 174, 188, 0.30);
  --shadow-sm:  0 1px 2px rgba(3, 8, 13, 0.6);
  --shadow-md:  0 10px 30px -12px rgba(3, 10, 18, 0.9);
  --shadow-lg:  0 30px 70px -30px rgba(3, 10, 18, 0.95);

  /* Type */
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body:    "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-label:   "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-display: clamp(2.75rem, 8.5vw, 6.25rem);
  --fs-h1:      clamp(2.25rem, 6vw, 4rem);
  --fs-h2:      clamp(1.75rem, 4vw, 2.9rem);
  --fs-h3:      clamp(1.25rem, 2.2vw, 1.6rem);
  --fs-lead:    clamp(1.1rem, 1.9vw, 1.5rem);
  --fs-body:    1.0625rem;
  --fs-small:   0.9375rem;
  --fs-label:   0.72rem;

  /* Space */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;   --sp-6: 2rem;     --sp-7: 3rem;     --sp-8: 4rem;
  --sp-9: 6rem;     --sp-10: 8rem;

  /* Layout */
  --wrap:      78rem;
  --wrap-text: 62ch;
  --gutter:    clamp(1.15rem, 4vw, 3rem);

  /* Radius — varied by role, never one value everywhere */
  --r-tight: 2px;
  --r-soft:  6px;
  --r-round: 999px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur:  220ms;

  /* z-index scale */
  --z-base: 1;
  --z-sticky: 40;
  --z-nav: 60;
  --z-skip: 90;
}

/* --------------------------------------------------------------------------
   2. Reset and base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-tap-highlight-color: var(--gold-faint);
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; background-color: var(--surface); }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 400;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration-color: var(--gold-dim);
  text-underline-offset: 0.22em;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}
a:hover { color: var(--gold-hi); text-decoration-color: var(--gold); }

/* One focus treatment for the whole site. Never removed. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
  border-radius: var(--r-tight);
}

::selection { background: var(--gold); color: var(--ink-on-gold); }

/* --------------------------------------------------------------------------
   3. Utilities
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  min-width: 0;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.measure { max-width: var(--wrap-text); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: var(--z-skip);
  background: var(--gold);
  color: var(--ink-on-gold);
  font-family: var(--font-label);
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.85rem 1.4rem;
  border-radius: 0 0 var(--r-soft) var(--r-soft);
  text-decoration: none;
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); color: var(--ink-on-gold); }

/* Eyebrow label — mono, letterspaced, always paired with a gold hairline */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-label);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 var(--sp-4);
}
.eyebrow::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-dim), transparent);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--ink);
  font-weight: 300;
}

/* Grain overlay — breaks the flatness of large dark fields */
.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-sticky);
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--r-tight);
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.btn--primary {
  background: var(--gold);
  color: var(--ink-on-gold);
}
.btn--primary:hover { background: var(--gold-hi); color: var(--ink-on-gold); }
.btn--primary:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-hi); background: var(--gold-faint); }
.btn--ghost:active { transform: translateY(1px); }

/* Tertiary: a text link that still reads as an action */
.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  font-family: var(--font-label);
  font-size: 0.78rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
}
.btn-text .arrow { transition: transform var(--dur) var(--ease); }
.btn-text:hover { color: var(--gold-hi); }
.btn-text:hover .arrow { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   5. Site header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(7, 13, 19, 0.86);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  min-height: 68px;
  position: relative;
}
.site-header__inner > * { min-width: 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  padding-block: 0.4rem;
}
.brand img {
  width: 34px; height: 34px;
  border-radius: var(--r-tight);
  background: transparent;
}
.brand__name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1;
  letter-spacing: 0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__name span { color: var(--gold); }
.brand:hover { color: var(--ink); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-tight);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-toggle:hover { border-color: var(--gold); color: var(--gold-hi); }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.2rem);
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-label);
  font-size: 0.76rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--gold);
  box-shadow: inset 0 -1px 0 0 var(--gold);
}
.site-nav .btn { min-height: 42px; padding: 0.6rem 1.15rem; }
/* .site-nav a is more specific than .btn--primary, so restate the button
   colours here or the label disappears into its own background. */
.site-nav a.btn--primary { color: var(--ink-on-gold); }
.site-nav a.btn--primary:hover { color: var(--ink-on-gold); }
.site-nav a.btn--ghost { color: var(--ink); }
.site-nav a.btn--ghost:hover { color: var(--gold-hi); }

/* --------------------------------------------------------------------------
   6. Site footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ground-raised);
  padding-block: var(--sp-8) var(--sp-6);
  padding-bottom: max(var(--sp-6), env(safe-area-inset-bottom));
  margin-top: var(--sp-8);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: var(--sp-7) var(--sp-6);
  align-items: start;
}

.site-footer h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.05;
  margin-bottom: var(--sp-3);
}

.site-footer p { color: var(--ink-muted); font-size: var(--fs-small); }

.footer-heading {
  font-family: var(--font-label);
  font-size: var(--fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-3);
}

.footer-list { display: flex; flex-direction: column; }
.footer-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-muted);
  font-size: var(--fs-small);
  text-decoration: none;
}
.footer-list a:hover { color: var(--gold-hi); }

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-6);
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  font-family: var(--font-label);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* --------------------------------------------------------------------------
   7. Closing call to action (shared by every page)
   -------------------------------------------------------------------------- */
.cta-band {
  position: relative;
  overflow: hidden;
  margin-top: var(--sp-10);
  border-block: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 12% 0%, rgba(0, 63, 102, 0.55), transparent 62%),
    var(--ground-raised);
}
.cta-band__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-6);
  padding-block: clamp(3rem, 8vw, 5.5rem);
}
.cta-band h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.03;
  letter-spacing: -0.015em;
}
.cta-band p { color: var(--ink-muted); margin-top: var(--sp-4); max-width: 44ch; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-self: end; }

/* --------------------------------------------------------------------------
   8. Scroll reveal — resting state is VISIBLE. The class is added by JS only
      when motion is welcome, so no-JS and reduced-motion readers see content.
   -------------------------------------------------------------------------- */
.js-reveal.is-armed {
  opacity: 0;
  transform: translateY(18px);
}
.js-reveal.is-armed.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js-reveal.is-armed { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   9. Responsive — header collapse and footer stacking
   -------------------------------------------------------------------------- */
@media (max-width: 60rem) {
  .site-footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-footer__grid > :first-child { grid-column: 1 / -1; }
  .cta-band__inner { grid-template-columns: minmax(0, 1fr); }
  .cta-band__actions { justify-self: start; }
}

@media (max-width: 48rem) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    display: none;
    background: var(--ground-raised);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-4) var(--gutter) var(--sp-6);
  }
  .site-nav[data-open="true"] { display: block; }
  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .site-nav li + li { border-top: 1px solid var(--line); }
  .site-nav a {
    min-height: 56px;
    font-size: 0.85rem;
    color: var(--ink);
  }
  .site-nav .btn { margin-top: var(--sp-4); width: 100%; min-height: 52px; }
  .site-nav li:last-child { border-top: 0; }
}

@media (max-width: 34rem) {
  .site-footer__grid { grid-template-columns: minmax(0, 1fr); }
}
