/* =========================================
   Precision Torque — Global Styles (v3)
   One stylesheet for every page.
   Home uses: <section class="hero hero--dark">
   Service pages can use: .two grid helper
   ========================================= */

/* ---------- Reset / base sanity ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body{
  font-family: "Montserrat", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: #222;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

h1,h2,h3,h4{ line-height: 1.2; margin: 0; font-weight: 800; color: var(--dark); }
p{ margin: 0; color: var(--dark); }

h1{ font-size: clamp(34px, 4vw, 46px); letter-spacing: -.3px; }
h2{ font-size: clamp(26px, 3vw, 34px); }
h3{ font-size: 20px; }
h4{ font-size: 16px; }

a{ color: var(--muted); text-decoration: none; }
a:hover{ color: var(--accent-dark); }

/* Better keyboard accessibility */
:focus-visible{
  outline: 3px solid rgba(122,31,47,.35);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Root tokens ---------- */
:root{
  --bg:#f7f5f5;
  --surface:#ffffff;
  --surface-muted:#f2f2f2;

  --accent:#7a1f2f;
  --accent-dark:#5e1722;

  --on-dark: rgba(255,255,255,.94);
  --on-dark-muted: rgba(255,255,255,.78);
  --on-dark-subtle: rgba(255,255,255,.62);

  --muted:#6b7280;
  --dark:#111827;

  --border: rgba(0,0,0,0.08);
  --shadow-sm: 0 8px 18px rgba(0,0,0,0.06);
  --shadow-md: 0 12px 26px rgba(0,0,0,0.08);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 16px;
}

/* ---------- Skip link ---------- */
.skip-link{
  position:absolute;
  left:-999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.skip-link:focus{
  left:10px;
  top:10px;
  width:auto;
  height:auto;
  padding:8px 12px;
  background:#fff;
  color:var(--accent-dark);
  border-radius:6px;
  box-shadow:0 2px 6px rgba(0,0,0,0.2);
  text-decoration:none;
  z-index:9999;
}

/* ---------- Layout helpers ---------- */
.wrap{ max-width:1180px; margin:0 auto; padding:0 22px; }
.section{ padding:68px 0; }

.section-header{ display:flex; flex-direction:column; gap:10px; margin-bottom:24px; max-width:820px; }
.section-header .kicker{ letter-spacing:.12em; }
.section-intro{ color: var(--muted); max-width: 78ch; line-height:1.8; font-size: 16px; }

.page-hero{ padding:72px 0 56px; background: linear-gradient(180deg,#f7f5f5 0%,#f0eeee 100%); border-bottom:1px solid rgba(0,0,0,0.05); }
.page-hero.page-hero--brand{
  background:
    radial-gradient(900px 460px at 18% 8%, rgba(255,255,255,.08), transparent 60%),
    radial-gradient(1000px 520px at 85% 0%, rgba(122,31,47,.28), transparent 58%),
    linear-gradient(180deg, #141013 0%, #241218 55%, #2f171f 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #fff;
}
.page-hero.page-hero--brand h1,
.page-hero.page-hero--brand h2,
.page-hero.page-hero--brand h3,
.page-hero.page-hero--brand h4{ color: var(--on-dark); }

.page-hero.page-hero--brand .intro,
.page-hero.page-hero--brand .lede,
.page-hero.page-hero--brand p{ color: var(--on-dark-muted); }

.page-hero.page-hero--brand .page-panel{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 30px rgba(0,0,0,.25);
}

.page-hero.page-hero--brand .kicker{ color: rgba(255,255,255,.78); }
.page-hero.page-hero--brand .badge{
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.18);
}
.page-head{ display:grid; grid-template-columns: 1.05fr .95fr; gap:24px; align-items:start; }
.page-head .intro{ color: var(--muted); line-height:1.8; font-size: 16px; max-width: 78ch; }

.page-panel{ background: var(--surface); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); display:flex; flex-direction:column; gap:10px; }
.page-panel h3{ margin: 4px 0; }

.lede{ font-size: 18px; color: var(--muted); line-height: 1.8; max-width: 82ch; }

.stack{ display:flex; flex-direction:column; gap: 14px; }
.stack-lg{ display:flex; flex-direction:column; gap: 18px; }

.text-max{ max-width: 78ch; }

.pill-row{ display:flex; flex-wrap:wrap; gap:10px; }

.list-muted{ margin: 0; padding-left: 18px; color: #4b5563; line-height: 1.8; }

.kicker{
  color: var(--accent);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

.muted{ color:#4b5563; }

/* ---------- Header / nav ---------- */
header{
  background:#111;
  color:#fff;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 18px;
  padding:18px 32px;
  position:sticky;
  top:0;
  z-index:100;
  box-shadow:0 2px 8px rgba(0,0,0,0.15);
}

.logo{ display:flex; flex-direction:column; }
.logo h2{ margin:0; font-size:20px; font-weight:700; letter-spacing: .2px; color: var(--on-dark); }
.tagline{ font-size:13px; color: var(--on-dark-muted); font-weight:600; margin-top:4px; }

nav{
  display:flex;
  gap:18px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:center;
}

nav a{
  color: var(--on-dark-muted);
  font-weight:600;
  font-size: 13.5px;
  white-space: nowrap;
  opacity: 1;
  transition: color .15s ease;
}
nav a:hover{ color: var(--on-dark); }
nav a[aria-current="page"]{ color: var(--on-dark); position: relative; }
nav a[aria-current="page"]::after{ content:""; position:absolute; left:0; right:0; bottom:-6px; height:2px; background: var(--accent); border-radius:999px; }
.nav-cta{ margin-left: 4px; }

/* ---------- Buttons ---------- */
.cta,
.btn-ghost{
  transition: background .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}

.cta{
  background: var(--accent);
  color:#fff;
  padding:10px 16px;
  border-radius:8px;
  font-weight:700;
  display:inline-block;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}
.cta:hover{
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.16);
}

.btn-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-start;
  margin-top:18px;
}

.btn-ghost{
  border:1px solid rgba(122,31,47,0.35);
  color: var(--accent);
  background: rgba(122,31,47,0.06);
  padding:10px 14px;
  border-radius:8px;
  font-weight:800;
  display:inline-block;
}
.btn-ghost:hover{
  background: rgba(122,31,47,0.10);
  border-color: rgba(122,31,47,0.55);
  transform: translateY(-1px);
}

/* Optional “secondary” style if you use <a class="cta secondary"> */
.cta.secondary{
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(122,31,47,.35);
  box-shadow: none;
}
.cta.secondary:hover{
  background: rgba(122,31,47,.08);
  transform: translateY(-1px);
}

/* ---------- Cards / notes ---------- */
.card{
  background:#fff;
  border-radius: var(--radius-lg);
  padding:20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.06);
  display:flex;
  flex-direction:column;
  gap:12px;
}

.card h3{ margin:0; font-size:18px; color: var(--dark); }
.card p{ margin:0; color:#4b5563; line-height:1.7; font-size:14px; }
.card ul{
  margin: 0;
  padding-left: 18px;
  color:#374151;
  line-height:1.8;
  font-size:14px;
}

.note{
  border-left:4px solid var(--accent);
  background: rgba(122,31,47,.06);
  padding:14px;
  border-radius:12px;
  color:#111;
  margin-top: 16px;
}

/* CTA band */
.cta-band{
  margin-top:18px;
  border-radius: var(--radius-lg);
  padding:22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}
.cta-band h3{ margin:0; font-size:18px; }
.cta-band p{ margin:4px 0 0; color: rgba(255,255,255,.90); }
.cta-band .cta{ background:#111; box-shadow:none; }
.cta-band .cta:hover{ background:#000; }

.cta-minor{ color: var(--accent); font-weight:700; text-decoration: underline; text-decoration-thickness: 2px; }

/* ---------- HERO (default = light) ---------- */
.hero{
  padding:48px 0 32px;
  background: linear-gradient(180deg,#f7f5f5 0%,#f2f2f2 100%);
  border-bottom:1px solid rgba(0,0,0,0.05);
  color:#111;
}

.hero-grid{
  display:grid;
  grid-template-columns: .95fr 1.05fr;
  gap:22px;
  align-items:center;
}

.hero h1{
  margin:10px 0 10px;
  font-size:38px;
  line-height:1.1;
  letter-spacing: -.2px;
}

.hero p{
  margin:0;
  max-width:70ch;
  color:#4b5563;
  line-height:1.75;
}

.grid-3{ display:grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-top:18px; }
.grid-2{ display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top:18px; }

/* Hero “side box” styles */
.hero-card,
.hero-panel{
  background:#fff;
  border-radius: var(--radius-lg);
  padding:18px;
  border:1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-md);
}

.hero-panel ul{ margin: 0; padding-left: 18px; line-height: 1.8; }
.hero-panel li{ color: #1f2937; }

/* Badges (light) */
.badge-row{ display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.badge{
  font-size:12px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,0.08);
  background: rgba(122,31,47,.06);
  color:#111;
  font-weight:700;
}

/* ---------- HERO DARK (Home) ---------- */
.hero--dark{
  padding:56px 0 42px;
  background:
    radial-gradient(1200px 380px at 20% 0%, rgba(122,31,47,.30), transparent 60%),
    radial-gradient(900px 360px at 80% 10%, rgba(94,23,34,.28), transparent 60%),
    linear-gradient(180deg, #0f0f10 0%, #151517 55%, #1b1b1e 100%);
  color:#fff;
  border-bottom:1px solid rgba(255,255,255,0.06);
}

/* Home-only brightness tweak for hero; keeps global brand palette unchanged */
body.page-home .hero--dark{
  background:
    radial-gradient(900px 460px at 18% 8%, rgba(255,255,255,.08), transparent 60%),
    radial-gradient(1000px 520px at 85% 0%, rgba(122,31,47,.28), transparent 58%),
    linear-gradient(180deg, #141013 0%, #241218 55%, #2f171f 100%);
}

.hero--dark .kicker{ color: rgba(255,255,255,.85); }
.hero--dark p,
.hero--dark .intro,
.hero--dark .lede{ color: var(--on-dark-muted); }
.hero--dark h1,
.hero--dark h2,
.hero--dark h3,
.hero--dark h4{ color: var(--on-dark); }

.hero--dark .hero-grid{
  grid-template-columns: 1.15fr .85fr;
  gap:26px;
}

.hero--dark h1{ font-size:48px; }

.hero--dark .hero-panel,
.hero--dark .hero-card{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 30px rgba(0,0,0,.25);
}

.hero--dark .hero-panel li{ color: var(--on-dark-muted); }

.page-hero--brand .page-panel li{ color: var(--on-dark-muted); }

.hero--dark .hero-panel,
.page-hero--brand .page-panel{ background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }

.hero--dark .badge{
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.18);
}

/* ---------- Home sections (Services / Steps / Quotes) ---------- */
.service-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:16px;
  margin-top:22px;
}
.service-card{
  position: relative;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: var(--shadow-sm);
  background:#fff;
  overflow: hidden;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-height: 230px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.service-card .card-link{
  position:absolute;
  inset:0;
  z-index:1;
  border-radius: var(--radius-lg);
  text-indent:-9999px;
  overflow:hidden;
}
.service-card > *:not(.card-link){ position: relative; z-index: 2; }
.service-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(122,31,47,0.22);
}
.service-card:focus-within{ outline: 3px solid rgba(122,31,47,0.22); outline-offset: 3px; }
.service-card p{ margin:0; color:#4b5563; line-height:1.7; }
.service-card .btn-row{ margin-top:auto; }
.service-grid .card{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:210px;
}
.service-grid .card .cta{ align-self:flex-start; margin-top:auto; }

/* Process steps */
.steps{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
  margin-top:18px;
}
.step{
  background:#fff;
  border-radius: var(--radius-md);
  padding:16px;
  border:1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-sm);
}
.step .num{
  width:34px; height:34px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background: rgba(122,31,47,.10);
  color: var(--accent);
  font-weight:800;
  margin-bottom:10px;
}
.step h4{ margin:0 0 6px; }
.step p{ margin:0; color:#4b5563; font-size:14px; line-height:1.6; }

/* Testimonials */
.quote-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:14px;
  margin-top:18px;
}
.quote{
  background:#fff;
  border-radius: var(--radius-md);
  padding:18px;
  border:1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-sm);
}
.quote p{ margin:0 0 12px; color:#111827; line-height:1.7; font-size:16px; }
.quote .who{ font-weight:700; color:#374151; font-size:13px; }
.quote .sub{ font-size:12px; color:#6b7280; margin-top:2px; }

/* ---------- Service pages helper grids ---------- */
.two{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

/* ---------- Footer ---------- */
footer{
  background:#111;
  color:#fff;
  padding:40px 20px;
  margin-top:40px;
}
.footer-content{
  max-width:1100px;
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:30px;
  text-align:left;
}
.footer-section h4{
  margin:0 0 15px 0;
  font-weight:600;
  font-size:16px;
  color: var(--on-dark);
}
.footer-section p{
  margin:8px 0;
  font-size:14px;
  color: var(--on-dark-muted);
}
.footer-section a{ color: var(--on-dark-muted); }
.footer-section a:hover{ color: var(--on-dark); text-decoration: underline; }

.footer-bottom{
  text-align:center;
  margin-top:30px;
  padding-top:20px;
  border-top:1px solid rgba(255,255,255,0.06);
  font-size:14px;
  color: var(--on-dark-subtle);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .hero-grid{ grid-template-columns:1fr; }
  .hero--dark .hero-grid{ grid-template-columns:1fr; }
  .hero--dark h1{ font-size:36px; }

  .service-grid{ grid-template-columns:1fr; }
  .steps{ grid-template-columns:1fr 1fr; }
  .quote-grid{ grid-template-columns:1fr; }

  .two{ grid-template-columns:1fr; }
  .grid-3{ grid-template-columns:1fr; }
  .grid-2{ grid-template-columns:1fr; }
  .page-head{ grid-template-columns:1fr; }
  .post-header{ grid-template-columns:1fr; }
}

/* Make header behave better on small screens */
@media (max-width: 760px){
  header{
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }
  nav{
    width: 100%;
    justify-content: flex-start;
    gap: 14px;
  }
}

@media (max-width: 520px){
  .steps{ grid-template-columns:1fr; }
}

/* ---------- Blog layout ---------- */
.article-shell{ padding: 64px 0; }
.post-header{ display:grid; grid-template-columns: 1.1fr .9fr; gap: 22px; align-items: start; margin-bottom: 28px; }
.post-meta{ display:flex; gap:12px; flex-wrap:wrap; color: var(--muted); font-size: 14px; align-items:center; }
.post-meta .pill{ padding:6px 12px; border-radius:999px; background: rgba(122,31,47,.08); border:1px solid rgba(122,31,47,.15); color: var(--accent); font-weight:800; }
.post-panel{ background: var(--surface); border-radius: var(--radius-lg); padding: 18px; border:1px solid var(--border); box-shadow: var(--shadow-sm); }
.post-callout{ background: var(--surface); border-radius: var(--radius-lg); padding: 18px; border:1px solid var(--border); box-shadow: var(--shadow-sm); }
.post-callout .kicker{ margin-bottom: 8px; color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .02em; text-transform: uppercase; }
.post-callout ul{ margin: 0; padding-left: 18px; line-height: 1.7; color:#1f2937; }
.article-body{ display:flex; flex-direction:column; gap: 18px; font-size: 16px; line-height:1.85; color: #1f2937; max-width: 880px; }
.article-body h2{ font-size: clamp(20px, 2.2vw, 28px); margin-top: 14px; }
.article-body h3{ font-size: clamp(18px, 1.8vw, 22px); margin-top: 12px; }
.article-body h4{ font-size: 16px; margin-top: 10px; }
.article-body p{ color: #374151; }
.article-body ul,
.article-body ol{ margin: 0; padding-left: 20px; line-height: 1.8; }
.article-body li{ color: #374151; }
.callout{ border-left:4px solid var(--accent); background: rgba(122,31,47,.05); border-radius: 12px; padding: 14px 16px; color: #111; }
.cta-band.post{ margin-top:32px; }
.disclaimer{ margin-top:18px; color: var(--muted); font-size: 13px; }
/* === FIX BLOG THUMBNAIL OVERSIZE ISSUE === */
.resource-thumb {
  width: 100%;
  max-width: 160px;     /* THIS is the missing piece */
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain; /* SVG-safe */
  border-radius: var(--radius-md);
  background: rgba(0,0,0,.04);
}

/* =========================================
   Resources Page Layout (match Services feel)
   ========================================= */

/* Optional: a consistent page header row */
.page-head{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  align-items: start;
  margin-top: 12px;
}

.page-panel{
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.page-panel .kicker{ margin-bottom: 6px; }
.page-panel p{ margin-top: 6px; color: #4b5563; }

/* Resources grid like service cards */
.resource-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
  margin-top: 22px;
}

.resource-card{
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display:flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .18s ease, box-shadow .18s ease;
  min-height: 320px;
}

.resource-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Thumbnail becomes a subtle header, not a giant graphic */
.resource-card .resource-thumb{
  width: 100%;
  height: 120px;
  object-fit: contain;          /* SVG-safe */
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  padding: 12px;               /* gives the SVG breathing room */
}

/* Typography */
.resource-card h3{
  font-size: 16px;
  line-height: 1.25;
  margin: 0;
}
.resource-card h3 a{ color:#111; }
.resource-card h3 a:hover{ color: var(--accent); }

.resource-card .meta{
  font-size: 12px;
  color: var(--muted);
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.resource-card .pill{
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.03);
  color: rgba(0,0,0,.75);
  font-weight: 700;
}

.resource-card p{
  color:#4b5563;
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

/* Make the Read button feel consistent */
.resource-card .cta{
  margin-top: auto;
  align-self: flex-start;
}

/* Responsive */
@media (max-width: 980px){
  .page-head{ grid-template-columns: 1fr; }
  .resource-grid{ grid-template-columns: 1fr; }
}