/* ============================================================
   Gorilla Tuned — design tokens & base styles
   ============================================================ */
:root {
  /* Palette */
  --bg: #0a0908;
  --bg-elev-1: #14110f;
  --bg-elev-2: #1a1714;
  --line: #2a251f;
  --line-strong: #3a3128;

  --ink: #ede8df;
  --ink-muted: #a59c8c;
  --ink-dim: #6e6557;

  --brass: #c8a24b;        /* primary accent — matches logo gold */
  --brass-bright: #e6bf6a;
  --brass-deep: #8e6e29;

  --chrome-1: #f4f3ef;
  --chrome-2: #b8b3aa;
  --chrome-3: #6a655c;

  --danger: #c33;

  /* Type */
  --f-display: 'Oswald', 'Arial Narrow', sans-serif;
  --f-body: 'Barlow', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --maxw: 1320px;
  --pad-x: clamp(20px, 4vw, 56px);
  --rule: 1px solid var(--line);
  --rule-strong: 1px solid var(--line-strong);

  /* Motion */
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* Reset-ish */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* Page-level grit texture (very subtle) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ============================================================
   Typography helpers
   ============================================================ */
.display {
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 0.92;
  text-transform: uppercase;
  text-wrap: balance;
}
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
}
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; }

.chrome-text {
  background: linear-gradient(180deg,
    #f7f5ef 0%,
    #d8d4cb 22%,
    #ffffff 38%,
    #a8a299 58%,
    #6a655c 78%,
    #c0bbb1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.6));
}
.brass-text {
  background: linear-gradient(180deg, #f4d27a 0%, #d8a93f 45%, #8e6e29 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* Top section delimiter — gold hairline + mono label */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-top: 24px;
  margin-bottom: 36px;
  border-top: 1px solid var(--line-strong);
  position: relative;
}
.section-head::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 80px; height: 2px;
  background: var(--brass);
}
.section-head .num {
  font-family: var(--f-mono);
  color: var(--brass);
  font-size: 12px;
  letter-spacing: .18em;
}
.section-head .label {
  font-family: var(--f-mono);
  color: var(--ink-muted);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* ============================================================
   Components
   ============================================================ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: var(--brass);
  color: #1a1208;
  position: relative;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: all .25s var(--ease);
}
.btn:hover {
  background: var(--brass-bright);
  transform: translateY(-1px);
}
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.btn-ghost:hover {
  border-color: var(--brass);
  color: var(--brass-bright);
  background: rgba(200,162,75,.06);
}

/* Card with chamfered corners */
.card {
  background: var(--bg-elev-1);
  border: 1px solid var(--line);
  position: relative;
  padding: 28px;
  clip-path: polygon(
    14px 0,
    100% 0,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    0 100%,
    0 14px
  );
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.card:hover {
  background: var(--bg-elev-2);
  border-color: var(--line-strong);
}
.card .corner-tl,
.card .corner-br {
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--brass);
}
.card .corner-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.card .corner-br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* Spec strip — small numbered data display */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), transparent),
    var(--bg-elev-1);
}
.spec-strip > div {
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}
.spec-strip > div:last-child { border-right: 0; }
.spec-strip .v {
  font-family: var(--f-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -.01em;
}
.spec-strip .v .unit {
  font-size: 14px;
  color: var(--brass);
  margin-left: 4px;
  letter-spacing: .04em;
}
.spec-strip .k {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 8px;
}

/* Marquee */
.marquee {
  display: flex;
  overflow: hidden;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: var(--bg);
}
.marquee-track {
  display: flex;
  gap: 56px;
  padding: 18px 0;
  animation: marquee 38s linear infinite;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 56px;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
.marquee .item {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 56px;
  flex-shrink: 0;
}
.marquee .item .star {
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--brass);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* Image placeholder — striped */
.img-placeholder {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(200,162,75,.06) 0 12px,
      rgba(200,162,75,.02) 12px 24px
    ),
    var(--bg-elev-1);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}
.img-placeholder::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--line-strong);
  pointer-events: none;
}

/* Form */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.field .req { color: var(--brass); }
.input, .textarea, .select {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 14px 16px;
  font-family: var(--f-body);
  font-size: 15px;
  outline: none;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brass);
  background: var(--bg-elev-1);
}
.textarea { min-height: 140px; resize: vertical; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,9,8,.86);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.nav-brand .mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--brass);
  color: #1a1208;
  font-weight: 700;
  font-family: var(--f-display);
  font-size: 18px;
  clip-path: polygon(20% 0, 100% 0, 80% 100%, 0 100%);
}
.nav-links {
  display: flex; gap: 0;
  font-family: var(--f-display);
  font-weight: 500;
  letter-spacing: .12em;
  font-size: 14px;
  text-transform: uppercase;
}
.nav-links button {
  background: none;
  border: 0;
  color: var(--ink-muted);
  padding: 12px 20px;
  position: relative;
  transition: color .2s var(--ease);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.nav-links button:hover { color: var(--ink); }
.nav-links button.active { color: var(--brass-bright); }
.nav-links button.active::after {
  content: "";
  position: absolute;
  left: 20px; right: 20px;
  bottom: 4px;
  height: 2px;
  background: var(--brass);
}
.nav-cta { display: flex; align-items: center; gap: 16px; }
.nav-cta .phone {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-cta .phone::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--brass);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--brass);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* Page transition */
.page {
  animation: pageIn .55s var(--ease) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.footer {
  margin-top: 120px;
  background: #060504;
  border-top: 1px solid var(--line-strong);
  position: relative;
}
.footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 2px;
  background: var(--brass);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px var(--pad-x) 36px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-inner h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 16px;
  font-weight: 500;
}
.footer-inner ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-inner a, .footer-inner li { color: var(--ink-muted); font-size: 14px; }
.footer-inner a:hover { color: var(--brass-bright); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 22px var(--pad-x);
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

/* ============================================================
   RESPONSIVE — utility grid classes + breakpoint rules
   ============================================================ */

/* All responsive grids share these base props */
.r-grid {
  display: grid;
}

/* 1.1 : 1 hero split — collapses under 960px with image on top */
.r-grid-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}

/* 1.4 : 1 main + sidebar (contact) */
.r-grid-sidebar {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
}

/* 2 : 1 (about) */
.r-grid-2-1 {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
}

/* 1 : 1 generic */
.r-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}
.r-grid-2-tight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* 3-col cards */
.r-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* 4-col (process) */
.r-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

/* Service block — image right by default, flips on alternate rows */
.r-grid-service {
  display: grid;
  grid-template-columns: 0.95fr 1fr;
  gap: 56px;
  align-items: start;
}
.r-grid-service.flip { grid-template-columns: 1fr 0.95fr; }

/* Featured-work magazine grid */
.r-grid-feature {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
}
.r-grid-feature > .tall { grid-row: span 2; }
.r-grid-feature > .wide { grid-column: span 2; }

/* ─── Tablet (≤ 1000px) ─── */
@media (max-width: 1000px) {
  .r-grid-sidebar {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .r-grid-sidebar > aside { position: static !important; }
}

/* ─── Small tablet / large phone (≤ 900px) ─── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }

  .r-grid-hero {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  /* On mobile, photo first */
  .r-grid-hero > .hero-photo { order: -1; }

  .r-grid-2-1 {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .r-grid-2,
  .r-grid-2-tight {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .r-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .r-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .r-grid-4 > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }
  .r-grid-4 > div:nth-child(2) { border-right: 0 !important; }

  .r-grid-service,
  .r-grid-service.flip {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .r-grid-service.flip > :first-child { order: -1; }
  /* On mobile always show photo first */
  .r-grid-service > .service-visual { order: -1; }

  .r-grid-feature {
    grid-template-columns: 1fr 1fr;
  }
  .r-grid-feature > .tall { grid-row: span 1; }
  .r-grid-feature > .wide { grid-column: span 2; }

  .nav-cta .phone { display: none; }

  /* Tighten section paddings */
  section.container { padding-top: 64px !important; }
  .container { padding-left: var(--pad-x); padding-right: var(--pad-x); }
}

/* ─── Phone (≤ 600px) ─── */
@media (max-width: 600px) {
  :root {
    --pad-x: 18px;
    --maxw: 100vw;
  }
  body { font-size: 15px; }

  .nav-inner { height: 60px; }
  .nav-cta .btn { padding: 10px 14px !important; font-size: 12px !important; }

  /* Hero photo badge shouldn't crowd content on phone */
  .r-grid-hero .hero-photo > div:last-child {
    width: 84px !important;
    right: -8px !important;
    bottom: -8px !important;
  }

  .r-grid-3 { grid-template-columns: 1fr; }
  .r-grid-4 {
    grid-template-columns: 1fr;
    border-left: 0;
    border-right: 0;
  }
  .r-grid-4 > div {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }
  .r-grid-4 > div:last-child { border-bottom: 0 !important; }

  .r-grid-feature {
    grid-template-columns: 1fr;
  }
  .r-grid-feature > .wide { grid-column: span 1; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 48px var(--pad-x) 28px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 18px var(--pad-x);
  }

  section.container { padding-top: 56px !important; }

  /* Spec strip — single column on phone */
  .spec-strip { grid-template-columns: 1fr 1fr; }
  .spec-strip > div { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); }
  .spec-strip > div:nth-child(2n) { border-right: 0 !important; }
  .spec-strip > div:last-child { border-bottom: 0; }

  /* Marquee smaller */
  .marquee .item { font-size: 20px; gap: 32px; }
  .marquee-track { gap: 32px; padding-right: 32px; }

  /* Service nav chips wrap nicer */
  .chip-row a { font-size: 10px !important; padding: 8px 12px !important; }
}

/* ─── Mobile nav menu ─── */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mobile-menu-btn:hover { border-color: var(--brass); color: var(--brass); }
.mobile-menu-btn .bars {
  display: flex; flex-direction: column; gap: 4px;
}
.mobile-menu-btn .bars span {
  display: block; width: 18px; height: 2px; background: currentColor;
}
@media (max-width: 900px) {
  .mobile-menu-btn { display: inline-flex; }
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10,9,8,0.96);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  padding: 24px var(--pad-x) 40px;
  transform: translateX(100%);
  transition: transform .35s var(--ease);
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  margin-bottom: 24px;
}
.mobile-drawer .close {
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  width: 40px; height: 40px;
  font-size: 22px;
  cursor: pointer;
}
.mobile-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.mobile-drawer nav button {
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  font-family: var(--f-display);
  font-size: 32px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-drawer nav button.active { color: var(--brass); }
.mobile-drawer nav button .arrow { color: var(--brass); font-size: 22px; }
.mobile-drawer .foot {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
}
.mobile-drawer .foot a {
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .12em;
}
.mobile-drawer .foot a span:first-child { color: var(--ink-muted); }

/* Density variants (set via data-density on <html>) */
:root[data-density="compact"] {
  --pad-x: clamp(16px, 3vw, 40px);
}
:root[data-density="compact"] .container > section,
:root[data-density="compact"] section.container {
  padding-top: 72px !important;
  padding-bottom: 0 !important;
}
:root[data-density="compact"] body { font-size: 15px; }
:root[data-density="compact"] .section-head { margin-bottom: 24px; padding-top: 18px; }
