/* ==========================================================================
   Soft Oceans — components.css
   Component patterns from design-system.md §2 + review decisions D-1..D-14
   (PLAN.md). All colors via tokens.css custom properties — zero raw hexes;
   translucent overlays use color-mix() over tokens.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Header / navigation (§2.2, D-6)
   -------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--c-white); border-bottom: 1px solid var(--c-line); }
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 29px; width: auto; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav > a, .nav__toggle { color: var(--c-ink); font-weight: 500; font-size: 15px; }
.nav > a:hover { color: var(--c-link); }
.nav > a.active, .nav__toggle.active {
  color: var(--c-link);
  text-decoration: underline; text-underline-offset: 7px; text-decoration-thickness: 2px;
}
.nav .btn { padding: 10px 20px; }

.nav__dropdown { position: relative; }
.nav__toggle {
  background: none; border: 0; font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 0;
}
.nav__toggle svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform var(--dur) var(--ease); }
.nav__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 250px;
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 8px; margin: 0; list-style: none;
}
.dropdown a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 6px; font-size: 14.5px; font-weight: 500; color: var(--c-ink);
}
.dropdown a:hover { background: var(--c-soft); color: var(--c-link); }

.nav-burger {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--c-navy); border-radius: var(--radius-sm);
}
.nav-burger svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Mobile drawer (§2.2, D-6): full-height slide-in, services as a static list */
.drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.drawer.open { display: block; }
.drawer__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--c-navy-700) 55%, transparent); }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 88vw);
  background: var(--c-white); padding: 16px 20px 32px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.drawer__close {
  align-self: flex-end; width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  color: var(--c-navy); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
}
.drawer__close svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
.drawer__group { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--c-grey); margin: 16px 8px 4px; }
.drawer nav a { display: block; padding: 12px 8px; font-weight: 500; color: var(--c-ink); border-radius: 8px; }
.drawer nav a:hover { background: var(--c-soft); color: var(--c-link); }
.drawer .btn { margin-top: 20px; }
body.no-scroll { overflow: hidden; }

/* --------------------------------------------------------------------------
   Buttons (§2.1; primary bg = --c-link for AA white text, D-13)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block; padding: 14px 28px; border-radius: var(--radius-pill);
  font-family: inherit; font-weight: 700; font-size: 15px; text-align: center;
  border: 0; cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.btn--primary { background: var(--c-link); color: var(--c-white); }
.btn--primary:hover { background: var(--c-primary-600); color: var(--c-white); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: var(--c-navy); border: 1.5px solid var(--c-line); padding: 12.5px 26.5px; }
.btn--ghost:hover { border-color: var(--c-link); color: var(--c-link); }

/* Inversions on dark surfaces */
.band-dark .btn--primary, .panel-ai .btn--primary { background: var(--c-white); color: var(--c-navy); }
.band-dark .btn--primary:hover, .panel-ai .btn--primary:hover { background: var(--c-white); color: var(--c-navy); }
.band-dark .btn--ghost { color: var(--c-white); border-color: color-mix(in srgb, var(--c-white) 55%, transparent); }
.band-dark .btn--ghost:hover { color: var(--c-white); border-color: var(--c-white); background: color-mix(in srgb, var(--c-white) 12%, transparent); }

/* --------------------------------------------------------------------------
   Eyebrow + section head (§2.3; eyebrow on --c-link, D-13)
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .14em;
  font-size: var(--fs-eyebrow); font-weight: 700; color: var(--c-link); margin-bottom: 14px;
}
.section-head { text-align: center; max-width: 720px; margin: 0 auto 52px; }
.section-head h2 { font-size: var(--fs-h2); margin-bottom: 14px; }
.section-head p { color: var(--c-grey); font-size: 17px; }

/* --------------------------------------------------------------------------
   Dark bands (hero + final CTA only, D-2). Gradient's blue end is pushed
   past the frame (130%) so text always sits on the navy zone (D-13).
   -------------------------------------------------------------------------- */
.band-dark {
  background: linear-gradient(160deg, var(--c-navy-700), var(--c-navy) 55%, var(--c-primary) 130%);
  color: var(--c-white); border-bottom: none;
}
.band-dark h1, .band-dark h2, .band-dark h3 { color: var(--c-white); }
.band-dark p { color: var(--c-on-dark); }
.band-dark .eyebrow { color: var(--c-on-dark-accent); }

/* Home hero (D-1): split text + CSS-built visual */
.hero { padding: 96px 0; }
.hero__grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: 48px; align-items: center; }
.hero h1 { font-size: var(--fs-hero); margin-bottom: 18px; }
.hero p { font-size: var(--fs-lead); max-width: 640px; }
.cta-row { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }
.trust { margin-top: 28px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--c-on-dark-muted); }
.trust b { color: var(--c-white); font-weight: 600; }
.trust img { height: 36px; width: auto; }

/* Hero visual (D-1, updated): client-supplied AI workflow art, background
   keyed out so it floats on the hero gradient. One-time fade-in is the only
   entrance animation on the page (D-11). */
.hero-visual img { width: 100%; height: auto; }
.js .hero-visual img { opacity: 0; animation: hv-in .5s var(--ease) forwards; }
@keyframes hv-in { to { opacity: 1; } }

/* Service-page hero (D-14.5) */
.page-hero { padding: var(--s-8) 0; }
.page-hero h1 { font-size: var(--fs-h1); margin-bottom: 14px; max-width: 760px; }
.page-hero p { font-size: var(--fs-lead); max-width: 680px; }
.page-hero .cta-row { margin-top: 26px; }

/* --------------------------------------------------------------------------
   Service cards (§2.4, D-9: cards without a destination carry no link)
   -------------------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }  /* collapses with .grid at ≤900/≤600 */
.card {
  position: relative; background: var(--c-white); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 30px 26px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--c-line-hover); }
.card__icon {
  width: 52px; height: 52px; border-radius: 12px; background: var(--c-primary-050);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.card__icon svg { width: 26px; height: 26px; stroke: var(--c-primary); fill: none; stroke-width: 1.8; }
.card h3 { font-size: var(--fs-h3); margin-bottom: 10px; }
.card p { color: var(--c-grey); font-size: 15px; margin: 0; }
.card__link { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 14px; color: var(--c-link); }
.badge {
  position: absolute; top: 18px; right: 18px; background: var(--c-link); color: var(--c-white);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--radius-pill);
}
.badge--inline { position: static; margin-left: auto; }

/* Featured AI panel (D-2): solid navy, leads the services grid */
.panel-ai {
  grid-column: 1 / -1; background: var(--c-navy); border: 0; border-radius: var(--radius-lg);
  color: var(--c-white); padding: 38px 36px;
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center;
  position: relative;
}
.panel-ai h3 { color: var(--c-white); font-size: 24px; margin-bottom: 10px; }
.panel-ai p { color: var(--c-on-dark); font-size: 15.5px; margin: 0 0 4px; }
.panel-ai .card__link { color: var(--c-on-dark-accent); }
.panel-ai .chips { justify-content: flex-start; }
.panel-ai .chip {
  background: color-mix(in srgb, var(--c-white) 12%, transparent);
  border-color: color-mix(in srgb, var(--c-white) 18%, transparent);
  color: var(--c-on-dark);
}

/* --------------------------------------------------------------------------
   About (2-col editorial)
   -------------------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.about-grid h2 { font-size: var(--fs-h2); }
.about-grid p { color: var(--c-grey); }

/* --------------------------------------------------------------------------
   Work tiles (images local, 4:3, lazy — D-8a)
   -------------------------------------------------------------------------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.tile { border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; background: var(--c-white); }
.tile img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--c-soft); }
.tile__body { padding: 18px 20px; }
.tile__tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tile h3 { font-size: 18px; }
.tag {
  background: var(--c-primary-050); color: var(--c-navy); font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: .04em;
}

/* --------------------------------------------------------------------------
   Process rail (§2.5 reworked per D-11): connected numbers, no card boxes
   -------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 28px; }
.step { position: relative; padding: 0 4px; }
.step__num {
  position: relative; z-index: 1; width: 38px; height: 38px; border-radius: 10px;
  background: var(--c-navy); color: var(--c-white); font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.step::after { content: ""; position: absolute; left: 56px; right: -14px; top: 18px; height: 2px; background: var(--c-line); }
.step:nth-child(3n)::after { display: none; }
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { color: var(--c-grey); font-size: 14px; margin: 0; }

/* --------------------------------------------------------------------------
   Chips / stack groups (§2.6)
   -------------------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--c-primary-050); color: var(--c-navy); border: 1px solid var(--c-line-hover);
  padding: 8px 16px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600;
}
.stack-group { margin-bottom: 22px; }
.stack-group h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }

/* --------------------------------------------------------------------------
   Case-study card (§2.7)
   -------------------------------------------------------------------------- */
.case {
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  padding: 36px; margin-bottom: 28px; box-shadow: var(--shadow-lg);
}
.case > h3 { font-size: 22px; margin-bottom: 6px; }
.case__meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; }
.case h4 { color: var(--c-link); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 22px 0 8px; }
.case p { color: var(--c-grey); font-size: 15.5px; }
.case ul { list-style: none; margin: 0 0 8px; padding: 0; }
.case li { position: relative; padding-left: 24px; margin-bottom: 8px; color: var(--c-grey); font-size: 15px; }
.case li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--c-primary); }
.case li b { color: var(--c-ink); }
.stackline { font-size: 13.5px; color: var(--c-grey); font-style: italic; border-left: 3px solid var(--c-primary-050); padding-left: 14px; margin-top: 10px; }

table.res { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14.5px; }
table.res th, table.res td { text-align: left; padding: 11px 14px; border: 1px solid var(--c-line); }
table.res th { background: var(--c-primary-050); color: var(--c-navy); }
table.res td:first-child { color: var(--c-ink); font-weight: 600; width: 46%; }
table.res td:last-child { color: var(--c-grey); }

/* --------------------------------------------------------------------------
   Client logo wall (§2.8, D-8a: grayscale lifts on hover AND focus;
   full color on touch widths)
   -------------------------------------------------------------------------- */
.logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px; }
.logo-item {
  display: flex; align-items: center; justify-content: center; height: 72px; padding: 12px;
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-white);
}
.logo-item img {
  max-height: 44px; width: auto; max-width: 100%;
  filter: grayscale(1); opacity: .6;
  transition: filter var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.logo-item:hover img, .logo-item:focus-visible img { filter: none; opacity: 1; }
.logo-item--text { color: var(--c-grey); font-weight: 600; font-size: 14px; opacity: .75; }

/* --------------------------------------------------------------------------
   Shared CTA band + contact modal (§2.10, D-5)
   -------------------------------------------------------------------------- */
.cta-band { text-align: center; }
.cta-band .section-head { margin-bottom: 30px; }

.modal { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--c-navy-700) 60%, transparent); }
.modal__panel {
  position: relative; width: min(560px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--c-white); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-lg);
}
.modal__panel h2 { font-size: 26px; margin-bottom: 8px; padding-right: 40px; }
.modal__lead { color: var(--c-grey); margin: 0; }
.modal__close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; background: none;
  cursor: pointer; color: var(--c-grey); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.modal__close:hover { background: var(--c-soft); color: var(--c-navy); }
.modal__close svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.modal__alt { margin: 18px 0 0; font-size: 13.5px; color: var(--c-grey); }

/* Form + states (D-5): labels always visible; error/sending/success/failure */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.form__field { display: flex; flex-direction: column; gap: 6px; }
.form__field--full { grid-column: 1 / -1; }
.form label { font-size: 13.5px; font-weight: 600; color: var(--c-navy); }
.form input, .form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  font: inherit; font-size: 15px; color: var(--c-ink); background: var(--c-white);
}
.form textarea { min-height: 110px; resize: vertical; }
.form__field.invalid input, .form__field.invalid textarea { border-color: var(--c-error); }
.form__error { color: var(--c-error); font-size: 13px; margin: 0; }
.form__fail {
  grid-column: 1 / -1; margin: 0; padding: 12px 14px; font-size: 14px;
  background: color-mix(in srgb, var(--c-error) 8%, var(--c-white));
  border: 1px solid var(--c-error); border-radius: var(--radius-sm); color: var(--c-ink);
}
.form__submit { grid-column: 1 / -1; justify-self: start; }
.form__submit[disabled] { opacity: .7; cursor: default; transform: none; box-shadow: none; }
.form__success { text-align: center; padding: 24px 0 8px; }
.form__success h3 { font-size: 20px; margin-bottom: 18px; }
.botcheck { position: absolute; left: -9999px; }

/* --------------------------------------------------------------------------
   Footer (§2.9, D-4: five columns)
   -------------------------------------------------------------------------- */
.site-footer { background: var(--c-navy); color: var(--c-on-dark-muted); padding: 64px 0 28px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h3 { color: var(--c-white); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; font-size: 14px; }
.site-footer a { color: var(--c-on-dark-muted); }
.site-footer a:hover { color: var(--c-white); }
.foot-brand img { height: 26px; width: auto; filter: brightness(0) invert(1); }
.foot-brand p { font-size: 14px; margin: 14px 0 0; color: var(--c-on-dark-muted); }
.foot-bottom {
  border-top: 1px solid color-mix(in srgb, var(--c-white) 12%, transparent);
  margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; font-size: 13px;
}

/* --------------------------------------------------------------------------
   AI results strip (D-15: approved case-study metrics as stat tiles)
   -------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat__num { display: block; font-size: clamp(30px, 3.5vw, 44px); font-weight: 700; color: var(--c-navy); line-height: 1.1; }
.stat__label { color: var(--c-grey); font-size: 14px; margin-top: 8px; }
.stats-cta { text-align: center; margin-top: 34px; }

/* Compact "other services" pill list (D-15): linked pills are obviously
   clickable; pageless services render as static pills until pages exist */
.pill-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 860px; margin: 0 auto; }
a.chip { color: var(--c-link); padding: 11px 18px; }
a.chip:hover { border-color: var(--c-link); color: var(--c-primary-600); }
.chip--static { color: var(--c-grey); padding: 11px 18px; }

/* --------------------------------------------------------------------------
   Misc: benefits checklist (Dedicated Team), hero stat chips
   -------------------------------------------------------------------------- */
.checklist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px; list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.checklist svg { width: 20px; height: 20px; stroke: var(--c-success); fill: none; stroke-width: 2; flex: none; margin-top: 3px; }

/* --------------------------------------------------------------------------
   Responsive: 3-col → 2-col ≤900px → 1-col ≤600px
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .nav-burger { display: flex; }
  .grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(3n)::after { display: block; }
  .step:nth-child(2n)::after { display: none; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 480px; }
  .panel-ai { grid-template-columns: 1fr; gap: 20px; }
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .checklist { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .hero { padding: 72px 0; }
  .hero-visual { display: none; }        /* D-1: visual hidden on mobile */
  .grid, .steps, .work-grid, .foot-grid, .form, .checklist { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .case { padding: 24px; }
  .section-head { margin-bottom: 36px; }

  /* Process rail turns vertical (D-11) */
  .step { padding-left: 2px; }
  .step::after, .step:nth-child(2n)::after, .step:nth-child(3n)::after {
    display: block; left: 18px; right: auto; top: 52px; bottom: -30px; width: 2px; height: auto;
  }
  .step:last-child::after { display: none; }

  /* Results tables stack into label/value pairs (D-14.1) */
  table.res thead { position: absolute; left: -9999px; }
  table.res, table.res tbody, table.res tr, table.res td { display: block; width: 100%; }
  table.res tr { border-bottom: 1px solid var(--c-line); padding: 10px 0; }
  table.res td { border: 0; padding: 2px 0; }
  table.res td:first-child { width: 100%; }

  /* Touch has no hover: logos always full-color (D-8a) */
  .logo-item img { filter: none; opacity: 1; }

  .modal__panel { padding: 26px 20px; }
}
