/* ==========================================================================
   CAVENAUGH MEDIA — main.css
   Theme: edit ONLY the :root block below to retune the entire site.
   To swap the blue accent back to gold: set --accent / --accent-bright.
   ========================================================================== */

:root {
  /* Color */
  --bg: #0A0A0A;
  --surface: #141414;            /* cards */
  --surface-2: #1E1E1E;          /* media placeholders, sub-cards */
  --border: #2A2A2A;
  --border-dashed: #3A3A3A;
  --band-border: #1C2733;        /* stats band hairlines */
  --accent: #1E5A8E;             /* Cavenaugh royal blue (primary) */
  --accent-bright: #2E7BC4;      /* Cavenaugh blue (highlight) */
  --gold: #F5C518;               /* star ratings only */
  --green: #3DBE6B;              /* featured case-study stat */
  --text: #FFFFFF;
  --text-muted: #A8B3BD;
  --text-dim: #8A98A5;

  /* Type */
  --font-display: 'Anton', 'Arial Narrow', Impact, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
  --h1-size: clamp(2.4rem, 3.8vw + 0.8rem, 4.6rem);
  --h2-size: clamp(1.9rem, 2.6vw + 0.6rem, 3.4rem);

  /* Shape & space */
  --radius-panel: 24px;
  --radius-card: 20px;
  --radius-tile: 12px;
  --radius-chip: 999px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  /* The ONLY vertical rhythm token between major sections. Each section gets
     half of it top and bottom, so any two adjacent sections sum to one token. */
  --space-section: clamp(4rem, 7vw, 6.5rem);
  --container: 1200px;
  --container-wide: min(96%, 1680px);   /* hero, CTA, header all share this width */

  /* Shared hero/CTA panel background — pure CSS, no image dependency */
  --panel-bg:
    radial-gradient(900px 500px at 78% 18%, rgba(46, 123, 196, 0.22), transparent 60%),
    radial-gradient(700px 420px at 15% 85%, rgba(30, 90, 142, 0.16), transparent 65%),
    linear-gradient(135deg, #0B1622 0%, #060B12 55%, #0A1420 100%);

  /* Subtle repeating "+" texture used on section backgrounds */
  --plus-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M14 10v8M10 14h8' stroke='%23ffffff' stroke-opacity='0.035' stroke-width='1.4'/%3E%3C/svg%3E");

  /* Irregular hand-torn frame for bonus cards (stroke = accent blue; if you
     change --accent-bright, update stroke='%232E7BC4' inside this data URI). */
  --torn-border: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'%3E%3Cdefs%3E%3Cfilter id='r' x='-5%25' y='-5%25' width='110%25' height='110%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.035' numOctaves='2' seed='7' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='4'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M25.8 8.2 L44.3 5.5 L67.0 8.6 L78.9 6.2 L101.6 9.1 L121.1 7.8 L141.5 8.8 L161.3 7.0 L180.7 9.7 L193.2 6.2 L212.9 7.2 Q230.5 6.8 232.6 25.6 L233.6 48.7 L231.3 58.1 L231.3 72.4 L234.0 98.3 L231.5 115.4 L234.4 133.2 L232.3 144.5 L230.5 165.9 L234.3 177.9 L230.6 192.6 L230.2 215.2 Q231.0 232.2 213.8 230.8 L191.4 231.5 L161.5 232.6 L138.1 235.0 L125.4 233.5 L95.3 229.3 L77.0 229.6 L48.3 231.1 L24.3 230.8 Q8.4 230.5 7.5 214.5 L8.4 185.3 L7.0 162.9 L6.1 138.9 L11.1 123.5 L11.3 99.9 L6.1 71.8 L5.7 54.7 L8.8 25.0 Q9.0 8.3 25.8 8.2 Z' fill='none' stroke='%232E7BC4' stroke-opacity='0.85' stroke-width='2' stroke-linejoin='round' filter='url(%23r)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--plus-texture);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent-bright); }

h1, h2, h3 { line-height: 1.15; margin: 0 0 var(--space-2); }

:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-2);
}

.section { padding-block: calc(var(--space-section) / 2); }

/* Display headings */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.section-header {
  text-align: center;
  font-size: var(--h2-size);
  line-height: 1.08;
  max-width: 900px;
  margin: 0 auto 2.5rem;     /* header -> content gap, fixed */
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  max-width: 700px;
  margin: -1.5rem auto 1rem; /* tucks under its header */
}

.section-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0 auto 2.5rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  border-radius: 14px;
  padding: 1.1rem 2.2rem;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(46, 123, 196, 0.35);
}

/* ==========================================================================
   Header / nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;       /* appears on scroll via JS */
  transition: border-color 0.2s ease;
}

.site-header.scrolled { border-bottom-color: rgba(255, 255, 255, 0.06); }

.site-header .container {
  max-width: none;
  width: var(--container-wide);
  padding-inline: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}

.logo-img { height: 42px; width: auto; }

.logo-mark { width: 38px; height: 38px; flex: none; }

.logo-word {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-word span { color: var(--accent-bright); }

/* Hamburger: two lines -> X when body.nav-open */
.nav-toggle {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 70;
}

.nav-toggle-box { width: 30px; height: 14px; position: relative; }

.nav-toggle-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, top 0.25s ease;
}

.nav-toggle-line:nth-child(1) { top: 0; }
.nav-toggle-line:nth-child(2) { top: 11px; }

body.nav-open .nav-toggle-line:nth-child(1) { top: 5.5px; transform: rotate(45deg); }
body.nav-open .nav-toggle-line:nth-child(2) { top: 5.5px; transform: rotate(-45deg); }

/* Right-side dropdown panel overlay */
.nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(420px, 100%);
  background: #101010;
  border-left: 1px solid var(--border);
  padding: 7rem var(--space-4) var(--space-4);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 60;
  overflow-y: auto;
}

body.nav-open .nav-panel { transform: translateX(0); }

.nav-panel ul { list-style: none; margin: 0; padding: 0; }

.nav-panel a {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
  text-decoration: none;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s ease;
}

.nav-panel a:hover { color: var(--accent-bright); }

.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 55;
}

body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }

/* ==========================================================================
   Hero panel (shared background + streak with CTA panel)
   ========================================================================== */

.hero { padding-block: 0 calc(var(--space-section) / 2); }

.hero .container { max-width: none; width: 100%; padding-inline: 0; }

.hero-panel,
.cta-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-panel);
  border: 1px solid var(--border);
  background: var(--panel-bg);
}

/* Very subtle diagonal light streak so the panels don't read flat */
.hero-panel::after,
.cta-panel::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.04) 50%, transparent 58%);
  transform: rotate(2deg);
  pointer-events: none;
}

.hero-panel {
  min-height: 56vh;
  max-height: 72vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 5rem 2rem;
  width: var(--container-wide);
  margin: 1.5rem auto 0;
}

.hero-panel h1 {
  font-size: var(--h1-size);
  line-height: 1.04;
  letter-spacing: 0.01em;
  text-wrap: balance;
  max-width: 22ch;
  margin-inline: auto;
  margin-bottom: var(--space-2);
}

.hero-sub {
  color: var(--text-muted);
  font-size: clamp(1.05rem, 0.6vw + 0.85rem, 1.3rem);
  line-height: 1.6;
  max-width: 62ch;
  margin: 0 auto;
}

/* Single gentle fade-in on load — hero text only */
@keyframes heroFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.hero-panel h1, .hero-sub { animation: heroFade 0.7s ease both; }
.hero-sub { animation-delay: 0.12s; }

/* ==========================================================================
   Cards
   ========================================================================== */

.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  align-items: stretch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
}

.card h3 { font-size: 1.25rem; margin-top: var(--space-2); }

.card p { color: var(--text-muted); margin: 0; }

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-tile);
  background: var(--accent);
  display: grid;
  place-items: center;
  color: #fff;
}

.card-icon svg { width: 26px; height: 26px; }

/* Bonus card: irregular hand-torn accent frame (border-image, see --torn-border).
   The transparent border + padding keep all content fully inside the frame. */
.card-bonus {
  border: 12px solid transparent;
  border-image-source: var(--torn-border);
  border-image-slice: 30;
  border-image-repeat: stretch;
  border-radius: 18px;
  padding: calc(2.25rem - 12px);
  background: var(--surface);
}

/* ==========================================================================
   Media placeholders
   ========================================================================== */

.media-placeholder {
  background: var(--surface-2);
  border: 1px dashed var(--border-dashed);
  border-radius: var(--radius-tile);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2);
  text-align: center;
  width: 100%;
}

.media-placeholder svg { width: 44px; height: 44px; color: var(--text-dim); flex: none; }

.ph-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  word-break: break-word;
}

/* Aspect ratios used across the site */
.ratio-9x16 { aspect-ratio: 9 / 16; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-16x7 { aspect-ratio: 16 / 7; background: #f4f4f4; border-color: #cfcfcf; }
.ratio-16x7 .ph-label, .ratio-16x7 svg { color: #555; }
.ratio-4x5  { aspect-ratio: 4 / 5; }
.ratio-1x1  { aspect-ratio: 1 / 1; }
.ratio-banner { aspect-ratio: 16 / 4; }

.logo-ph { width: 64px; flex: none; padding: var(--space-1); }
.logo-ph svg { width: 24px; height: 24px; }
.logo-ph .ph-label { font-size: 0.55rem; }

/* Stacked media (testimonial proof variant): the callout banner sits INSIDE the
   9:16 media box, pinned to the top, so the card's media height matches siblings. */
.media-stack { position: relative; }

.media-stack > .media-placeholder { position: absolute; }

.media-stack > .media-placeholder:not(.proof-banner) {
  inset: 0;
  height: 100%;
  aspect-ratio: auto;
}

.media-stack > .proof-banner {
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  width: auto;
  z-index: 2;
  padding: 0.6rem;
  background: rgba(30, 30, 30, 0.92);
}

.media-stack > .proof-banner svg { width: 26px; height: 26px; }

/* ==========================================================================
   Filter chips
   ========================================================================== */

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-1);
  margin: 0 0 2.5rem;
}

.chip {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  background: #1A1A1A;
  border: 1px solid #2A2A2A;
  border-radius: var(--radius-chip);
  padding: 0.6rem 1.3rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover { border-color: #4A5663; }

.chip.active {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: #fff;
}

/* ==========================================================================
   Results page
   ========================================================================== */

.expectations-card { max-width: 820px; margin-inline: auto; }

.expectations-card ul { color: var(--text-muted); margin: var(--space-2) 0; padding-left: 1.4rem; }

.expectations-card li { margin-bottom: 0.4rem; }

.expectations-card em { color: var(--text-dim); }

.results-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); align-items: stretch; }

.result-card .result-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.result-card h2 { font-size: 1.5rem; margin: 0; }

.stats-list {
  list-style: disc;
  color: var(--text-muted);
  padding-left: 1.4rem;
  margin: 0 0 var(--space-2);
}

.stats-list li { margin-bottom: 0.65rem; }

.stats-list strong { color: var(--text); }

/* ==========================================================================
   Case studies
   ========================================================================== */

.featured-row { display: grid; grid-template-columns: 1fr; gap: var(--space-3); align-items: stretch; }

.stat-headline {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  text-transform: uppercase;
  text-wrap: balance;
  margin: var(--space-2) 0;
}

.stat-green { color: var(--green); }
.stat-blue { color: var(--accent-bright); }

.case-card p { color: var(--text-muted); }

/* ==========================================================================
   Testimonials
   ========================================================================== */

.stars { display: flex; gap: 4px; margin-top: var(--space-1); }
.stars svg { width: 20px; height: 20px; color: var(--gold); }

/* Keep name + quote + stars aligned across a row */
.quote-line { color: var(--text-muted); font-size: 0.95rem; margin: 0; min-height: 2.4em; }

/* ==========================================================================
   Websites page
   ========================================================================== */

.check-card { text-align: center; }
.check-card .card-icon { margin-inline: auto; border-radius: 50%; }

.bold-line {
  text-align: center;
  font-weight: 700;
  font-size: 1.2rem;
  margin: 2.5rem auto 0;
}

.include-rows { display: grid; gap: var(--space-2); margin-top: var(--space-2); }

.include-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.include-row svg { width: 22px; height: 22px; color: var(--accent-bright); flex: none; }

.portfolio-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); align-items: stretch; }

.portfolio-card { margin: 0; }

.portfolio-card figcaption {
  margin-top: var(--space-2);
  font-weight: 600;
  text-align: center;
}

/* ==========================================================================
   Shared CTA section
   ========================================================================== */

.cta-section { padding-block: calc(var(--space-section) / 2); }

.cta-section .container { max-width: none; width: 100%; padding-inline: 0; }

.cta-panel {
  width: var(--container-wide);
  margin-inline: auto;
  padding: 5rem;
}

.cta-panel > * { position: relative; z-index: 1; }   /* above the streak */

.cta-panel h2 {
  font-size: var(--h2-size);
  line-height: 1.08;
  max-width: 680px;
  text-align: left;
  margin-bottom: var(--space-3);
}

/* ==========================================================================
   Stats band + footer
   ========================================================================== */

.site-footer {
  background: #0c0c0c;
  color: var(--text-muted);
}

.footer-stats-band {
  border-top: 1px solid var(--band-border);
  border-bottom: 1px solid var(--band-border);
  padding: 3.5rem 2rem;
}

.footer-stats {
  max-width: 1100px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.footer-stats strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 3vw, 3.2rem);
  line-height: 1.1;
  color: var(--accent-bright);
}

.footer-stats span {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.site-footer .container { padding-block: var(--space-4) var(--space-3); }

.footer-cols { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }

.footer-cols h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--text);
}

.footer-cols ul { list-style: none; margin: 0; padding: 0; }

.footer-cols a {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-block;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

.footer-cols a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: space-between;
  margin-top: var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.footer-bottom a { color: var(--text-muted); }

/* ==========================================================================
   Scroll reveal (IntersectionObserver adds .revealed; JS staggers rows 60ms)
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-panel h1, .hero-sub { animation: none; }
}

/* ==========================================================================
   Breakpoints (mobile-first): 768px, 1200px
   ========================================================================== */

@media (max-width: 767px) {
  .hero-panel {
    min-height: 0;
    max-height: 70vh;
    padding: 3.5rem 1.25rem;
  }
  .nav-panel { width: 100%; border-left: 0; }
  .footer-stats { grid-template-columns: 1fr; gap: 2rem; }
  .cta-panel { padding: 3rem 1.5rem; }
}

@media (min-width: 768px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .featured-row { grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1200px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .cards-grid--4 { grid-template-columns: repeat(4, 1fr); }
  .results-grid { grid-template-columns: 1fr; }
  .result-card { max-width: 980px; margin-inline: auto; width: 100%; }
}
