/* ============================================================
   SPRING AI STUDIO — shared brand system
   Warm paper canvas · warm near-black ink · fire gradient used
   as a precise accent, never as a flood.
   Titillium Web throughout (the logotype face).
   Palette sampled directly from the logo artwork.

   Loaded by every page (index.html, contact/index.html). This is the
   single source of truth — edit the palette and components HERE, never
   in a page's own <style> block.
   ============================================================ */
:root {
  --paper:    #FDFCFA;   /* base canvas                        */
  --paper-2:  #F7F3EE;   /* alt section — warm tint            */
  --card:     #FFFFFF;   /* elevated surface                   */
  --ink:      #16120F;   /* primary text — warm near-black     */
  --ink-soft: #4A423C;   /* body copy                          */
  --muted:    #7A706A;   /* secondary text                     */
  --faint:    #A79C95;   /* labels / tertiary                  */
  --line:     rgba(22,18,15,0.10);  /* hairline                */
  --line-2:   rgba(22,18,15,0.18);  /* stronger hairline       */

  /* Fire — straight off the logo */
  --crimson:  #BE1E2D;
  --orange:   #F15A29;
  --amber:    #F7941D;
  --gold:     #FDC70C;
  --yellow:   #FFF200;
  --fire: linear-gradient(135deg, #FDC70C 0%, #F7941D 32%, #F15A29 66%, #BE1E2D 100%);
  --fire-wide: linear-gradient(90deg, #FFF200 0%, #FDC70C 22%, #F7941D 48%, #F15A29 74%, #BE1E2D 100%);

  /* Solid button fill. --orange darkened until white text clears 4.5:1 (AA);
     #F15A29 itself only reaches 3.37:1. Sits between --orange and --crimson. */
  --orange-red: #D93A1E;

  --radius: 14px;
  /* Page gutter. Shared by .wrap and the mobile nav panel, which sits outside
     .wrap but has to line its text up with it. Narrows at the 700px breakpoint. */
  --gutter: 28px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* overflow-x lives on <html>, not <body> — on <body> it makes body a scroll
   container and silently breaks the sticky nav in Safari */
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: "Titillium Web", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-soft);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type ---------- */
h1, h2, h3 { color: var(--ink); font-weight: 300; line-height: 1.12; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 6.2vw, 4.6rem); font-weight: 200; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); }
h3 { font-size: 1.22rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
p  { font-size: 1.05rem; }
a  { color: inherit; }

/* The one flourish: fire-filled text. Used once per section, at most. */
.fire-text {
  background: var(--fire);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--orange);            /* fallback if clip unsupported */
  font-weight: 700;
}

/* Hero headline is the exception: solid crimson, not the gradient. The whole line
   is accented there, and a full-width gradient at display size reads as a flood.
   Must unset text-fill-color too, or the transparent fill wins over `color`. */
.hero h1 .fire-text {
  background: none;
  -webkit-text-fill-color: var(--crimson);
  color: var(--crimson);
}

/* Short gradient rule that opens a section */
.rule { width: 56px; height: 3px; background: var(--fire-wide); border-radius: 2px; }

.eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}

.lede { font-size: clamp(1.08rem, 1.7vw, 1.28rem); color: var(--ink-soft); max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.5rem 1.15rem; border-radius: 999px;
  font-size: 0.92rem; font-weight: 600; text-decoration: none;
  min-height: 38px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--orange-red); color: #fff;
  box-shadow: 0 4px 12px rgba(241,90,41,0.24);
}
.btn-primary:hover {
  background: var(--crimson);
  transform: translateY(-2px); box-shadow: 0 8px 20px rgba(241,90,41,0.32);
}
.btn-ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { transform: translateY(-2px); }
/* Ghost button sitting on the dark contact block — --ink would vanish there.
   Declared after .btn-ghost so its hover state wins on equal specificity. */
.btn-on-dark { border-color: rgba(255,255,255,0.32); color: #F6F1EC; }
.btn-on-dark:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253,252,250,0.86);
  backdrop-filter: saturate(180%) blur(12px);
  transition: box-shadow .2s ease;
}
/* Full-width fire rule — the nav's separator from whatever scrolls under it.
   Replaces the old hairline border; a 1px grey line under a gradient reads as dirt. */
.nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--fire-wide);
}
.nav.stuck { box-shadow: 0 1px 16px rgba(22,18,15,0.06); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 0.85rem 0; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { width: 34px; height: 34px; display: block; }
.brand span { font-size: 1.12rem; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
  text-decoration: none; font-size: 0.95rem; font-weight: 600; color: var(--muted);
  transition: color .16s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
/* Holds the links (and, on mobile only, a copy of the CTA). On desktop it's an
   invisible flex wrapper; below 900px it becomes the drop-down panel. */
.nav-menu { display: flex; align-items: center; }
.nav-menu-cta { display: none; }

/* Hamburger. Hidden on desktop; the three bars fold into an X when open. */
.nav-toggle {
  display: none; position: relative; z-index: 2;
  width: 42px; height: 38px; padding: 0; margin-right: -6px;
  background: none; border: 0; cursor: pointer;
  align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle .bar {
  position: absolute; left: 10px; width: 22px; height: 2px; border-radius: 2px;
  background: var(--ink);
  transition: transform .24s ease, opacity .18s ease, top .24s ease;
}
.nav-toggle .bar:nth-child(1) { top: 12px; }
.nav-toggle .bar:nth-child(2) { top: 18px; }
.nav-toggle .bar:nth-child(3) { top: 24px; }
.nav.open .nav-toggle .bar:nth-child(1) { top: 18px; transform: rotate(45deg); }
.nav.open .nav-toggle .bar:nth-child(2) { opacity: 0; }
.nav.open .nav-toggle .bar:nth-child(3) { top: 18px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
/* The hero is the one section with atmosphere. Three layers, all low-alpha:
   a warm cream wash that settles back to paper, an amber ember off the top-right,
   and a crimson one low-left to keep the fire palette on both diagonals. */
.hero {
  position: relative;
  padding: clamp(2.25rem, 4.5vw, 3.5rem) 0 clamp(3.5rem, 8vw, 6rem);
  overflow: hidden;
  /* confines the grain's multiply blend to this section's own backdrop */
  isolation: isolate;
  background:
    radial-gradient(900px 620px at 88% -12%, rgba(247,148,29,0.22) 0%, rgba(241,90,41,0.09) 44%, transparent 72%),
    radial-gradient(700px 540px at -8% 112%, rgba(190,30,45,0.11) 0%, rgba(241,90,41,0.04) 46%, transparent 70%),
    linear-gradient(180deg, #FFFCF4 0%, var(--paper) 62%);
}
/* Paper grain. Inline SVG turbulence, desaturated — no external asset, and it keeps
   the large flat washes above from banding on wide displays. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
}
/* Hairline at the hero's foot so the wash ends on a decision, not a fade */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--line); z-index: 0; pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { margin: 0.7rem 0 1.4rem; max-width: 24ch; }
.hero .lede { max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.4rem; }
.hero-cta.center { justify-content: center; margin-top: 0; }

/* Two-column hero — copy left, a screenshot of real work right. Opt-in via
   .hero-grid, so a hero without an image (the contact page) is untouched. */
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
/* The display clamp is tuned for a full-width line; in half the width it has to
   come down or the headline turns into six short ones. */
.hero-grid h1 { font-size: clamp(2.4rem, 4.4vw, 3.5rem); max-width: 18ch; }
.hero-grid .lede { max-width: 46ch; }
.hero-grid .hero-cta { margin-top: 2rem; }

/* The screenshot frame. Reads as a window onto the work: hairline border, a soft
   warm shadow to lift it off the paper, and the fire as a 3px top edge — the same
   idiom as the service cards, but always on, since this one is the hero's accent. */
.hero-shot {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1px solid var(--line-2);
  box-shadow: 0 26px 60px -30px rgba(22,18,15,0.55), 0 3px 10px rgba(22,18,15,0.05);
  transition: transform .25s ease, box-shadow .25s ease;
}
.hero-shot::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; z-index: 2;
  background: var(--fire-wide);
}
.hero-shot:hover { transform: translateY(-3px); box-shadow: 0 32px 70px -30px rgba(22,18,15,0.6), 0 3px 10px rgba(22,18,15,0.05); }
.hero-shot img { display: block; width: 100%; height: auto; }
.hero-figure { margin: 0; }
.hero-figure figcaption {
  margin-top: 0.9rem; font-size: 0.86rem; color: var(--muted); line-height: 1.5;
}
.hero-figure figcaption a { color: var(--crimson); text-decoration-color: rgba(190,30,45,0.35); text-underline-offset: 3px; }
.hero-figure figcaption a:hover { text-decoration-color: var(--crimson); }

/* ---------- Sections ---------- */
/* scroll-margin keeps anchored sections clear of the sticky nav */
.section, .cta-block, .hero { scroll-margin-top: 70px; }
/* Deep links from the home teasers land on a single service card, not a section */
.card[id] { scroll-margin-top: 90px; }
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section.alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: clamp(2.5rem, 5vw, 3.6rem); }
.section-head .rule { margin-bottom: 1.4rem; }
.section-head h2 { margin-bottom: 1.1rem; }

/* "All services →" — the link out of a home-page teaser into its full page */
.more-link {
  display: inline-flex; align-items: center; gap: 0.4em; margin-top: 2rem;
  font-size: 0.95rem; font-weight: 600; color: var(--crimson); text-decoration: none;
}
.more-link:hover { color: var(--orange-red); }
.more-link .arrow { transition: transform .2s ease; }
.more-link:hover .arrow { transform: translateX(3px); }

/* ---------- Service cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2.1rem 1.9rem 1.9rem; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
/* Gradient top-edge: hidden until hover, so the fire stays a reward not a wallpaper */
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--fire-wide); transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(22,18,15,0.07); border-color: var(--line-2); }
.card:hover::before { transform: scaleX(1); }
/* On the home page the teaser cards are whole-tile links into /services */
a.card { display: block; text-decoration: none; color: inherit; }
.card .num {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--faint); display: block; margin-bottom: 0.9rem;
}
.card h3 { margin-bottom: 0.65rem; }
.card p { font-size: 0.99rem; color: var(--ink-soft); }

/* ---------- Approach steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.step { border-top: 1px solid var(--line-2); padding-top: 1.4rem; }
.step .n {
  font-size: 2.6rem; font-weight: 700; line-height: 1; display: block; margin-bottom: 0.7rem;
  background: var(--fire); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--orange);
}
.step h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.step p { font-size: 0.96rem; color: var(--muted); }
/* Three-up variant — the contact page's "what to expect" */
.steps.three { grid-template-columns: repeat(3, 1fr); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.about-copy p + p { margin-top: 1.1rem; }
.about-copy a { color: var(--crimson); text-decoration-color: rgba(190,30,45,0.35); text-underline-offset: 3px; }
.about-copy a:hover { text-decoration-color: var(--crimson); }
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--card); padding: 1.7rem 1.4rem; }
.stat .figure {
  font-size: 2.3rem; font-weight: 700; line-height: 1; display: block; margin-bottom: 0.4rem;
  background: var(--fire); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--orange);
}
.stat .label { font-size: 0.86rem; color: var(--muted); line-height: 1.45; display: block; }

/* ---------- FAQ ---------- */
/* Plain <details> accordion — no JS, and the answers stay in the DOM whether or
   not they're open, so search and answer engines read all of it. */
.faq { border-top: 1px solid var(--line-2); max-width: 80ch; }
.faq details { border-bottom: 1px solid var(--line); padding: 1.1rem 0; }
.faq summary {
  cursor: pointer; list-style: none; display: flex; gap: 1.5rem;
  align-items: center; justify-content: space-between;
  font-size: 1.08rem; font-weight: 600; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; font-size: 1.5rem; font-weight: 300; line-height: 1;
  color: var(--orange-red); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--crimson); }
.faq p { margin-top: 0.75rem; font-size: 1rem; color: var(--ink-soft); max-width: 70ch; }

/* ---------- Work gallery ---------- */
/* Same card grammar as .card — white surface, hairline, fire top-edge on hover —
   but the whole tile is the link, and the screenshot carries the top of it. */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem; }
/* Three-up variant — the home page's preview row */
.work-grid.three { grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.work-grid.three .work-body { padding: 1.3rem 1.4rem 1.5rem; }
.work-grid.three .work-body p { font-size: 0.95rem; }
.work-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.work-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; z-index: 2;
  background: var(--fire-wide); transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.work-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(22,18,15,0.09); border-color: var(--line-2); }
.work-card:hover::before { transform: scaleX(1); }
/* Fixed 16:9 window so tiles line up regardless of how tall each capture is */
.work-shot {
  aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.work-shot img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  transition: transform .5s ease;
}
.work-card:hover .work-shot img { transform: scale(1.03); }
.work-body { padding: 1.6rem 1.7rem 1.75rem; }
.work-body h3 { margin-bottom: 0.5rem; }
.work-body p { font-size: 0.99rem; color: var(--ink-soft); }
.work-domain {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint); display: block; margin-bottom: 0.7rem;
}
/* Tag row under the copy — what was actually built */
.work-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.1rem; }
.work-tags span {
  font-size: 0.76rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.18rem 0.7rem;
  background: var(--paper);
}
.work-visit {
  display: inline-flex; align-items: center; gap: 0.4em; margin-top: 1.2rem;
  font-size: 0.9rem; font-weight: 600; color: var(--crimson);
}
.work-card:hover .work-visit { color: var(--orange-red); }
.work-visit .arrow { transition: transform .2s ease; }
.work-card:hover .work-visit .arrow { transform: translateX(3px); }

/* ---------- Contact (dark anchor — lets the mark glow) ---------- */
.cta-block { position: relative; background: #16120F; color: #F6F1EC; padding: clamp(4rem, 9vw, 6.5rem) 0; overflow: hidden; }
.cta-block::before {
  content: ""; position: absolute; bottom: -55%; left: 50%; transform: translateX(-50%);
  width: min(900px, 120vw); aspect-ratio: 2/1;
  background: radial-gradient(ellipse, rgba(241,90,41,0.30) 0%, rgba(190,30,45,0.10) 45%, transparent 72%);
  pointer-events: none;
}
.cta-block .wrap { position: relative; text-align: center; }
.cta-block img { width: 62px; height: 62px; margin: 0 auto 1.6rem; display: block; }
.cta-block h2 { color: #FFFFFF; margin-bottom: 1.1rem; }
.cta-block p { color: #C9BEB6; max-width: 52ch; margin: 0 auto 2.2rem; }

/* ---------- Footer ---------- */
footer { background: #0F0C0A; color: #8A7F78; padding: 2.6rem 0; font-size: 0.9rem; }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.6rem; }
footer a { text-decoration: none; color: #A89C94; transition: color .16s ease; }
footer a:hover { color: var(--amber); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  /* .steps.three is listed explicitly — it outranks a bare .steps selector */
  .steps, .steps.three { grid-template-columns: repeat(2, 1fr); gap: 1.8rem; }
  .about-grid { grid-template-columns: 1fr; }
  .work-grid, .work-grid.three { grid-template-columns: 1fr; }
  /* Hero stacks: copy first, screenshot under it, headline back to full width */
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-grid h1 { max-width: 24ch; }
  .hero-grid .lede { max-width: 56ch; }

  /* ---- Mobile nav ----
     Five links won't sit in a phone-width bar, so they move into a drop-down
     panel that hangs off the bottom of the sticky bar. The bar keeps its fire
     rule (.nav::after), which becomes the seam between bar and open panel. */
  .nav-toggle { display: inline-flex; }
  /* The panel leaves the flex flow, so the bar's space-between would strand the
     CTA mid-bar. Push everything right and let the brand hold the left. */
  .nav-inner { justify-content: flex-end; gap: 0.9rem; }
  .brand { margin-right: auto; }
  .nav-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    display: block; padding: 0.35rem 0 1.15rem;
    background: rgba(253,252,250,0.97);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 34px -22px rgba(22,18,15,0.4);
    /* closed: kept in the DOM but inert, so the panel can animate both ways */
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .nav.open .nav-menu { opacity: 1; visibility: visible; transform: none; }
  .nav-menu .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-menu .nav-links a {
    padding: 0.85rem var(--gutter); font-size: 1.05rem; color: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .nav-menu .nav-links a:last-child { border-bottom: 0; }
  .nav-menu .nav-links a.active { color: var(--crimson); }
  .nav-menu-cta {
    display: inline-flex; justify-content: center;
    margin: 1.1rem var(--gutter) 0; padding: 0.65rem 1.15rem;
  }
}
@media (max-width: 700px) {
  :root { --gutter: 20px; }
  .steps, .steps.three { grid-template-columns: 1fr; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
}
/* Narrowest phones: the bar keeps brand + hamburger only. The CTA is still one
   tap away — it sits at the foot of the panel. */
@media (max-width: 560px) {
  .nav-cta { display: none; }
  .nav-inner { gap: 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
