/* ============================================================
   RIPTIDE AI — shared site styles
   ============================================================ */

:root {
  --ink: #0a1929;
  --ink-2: #0f2438;
  --ink-3: #1a3552;
  --paper: #f4f1e8;
  --paper-2: #ebe6d8;
  --paper-3: #e0dbcd;
  --teal: #14e0d2;
  --teal-deep: #0a8a82;
  --teal-ink: #062b29;
  --blue: #2563eb;
  --rule: rgba(10, 25, 41, 0.12);
  --rule-dark: rgba(244, 241, 232, 0.14);
  --muted: rgba(10, 25, 41, 0.62);
  --muted-dark: rgba(244, 241, 232, 0.62);

  --serif: "Instrument Serif", "Newsreader", Georgia, serif;
  --sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.dark hr { border-top-color: var(--rule-dark); }

/* type */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--teal-deep);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow.on-dark { color: var(--teal); }
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 99px; background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in oklab, currentColor 22%, transparent);
}

h1, h2, h3, h4 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em;
  margin: 0; line-height: 1.05; text-wrap: balance;
}
h1 { font-size: clamp(48px, 7.6vw, 112px); letter-spacing: -0.02em; }
h2 { font-size: clamp(36px, 5.2vw, 72px); letter-spacing: -0.018em; }
h3 { font-size: clamp(24px, 2.6vw, 36px); letter-spacing: -0.012em; line-height: 1.1; }
h4 { font-size: clamp(20px, 1.8vw, 24px); line-height: 1.15; }
.serif { font-family: var(--serif); font-weight: 400; }
.mono { font-family: var(--mono); }
em.t { color: var(--teal-deep); font-style: italic; }
.on-dark em.t, .dark em.t { color: var(--teal); }

/* layout */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(64px, 10vw, 140px) 0; }
.section-tight { padding: clamp(48px, 7vw, 96px) 0; }
.dark { background: var(--ink); color: var(--paper); }
.dark .muted { color: var(--muted-dark); }
.muted { color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: clamp(32px,6vw,96px); align-items: start; }
.split.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .split, .split.even { grid-template-columns: 1fr; gap: 36px; } }
.sh { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: clamp(24px,5vw,80px); align-items: end; }
@media (max-width: 820px) { .sh { grid-template-columns: 1fr; gap: 16px; } }
.sh .lead { max-width: 38ch; color: var(--muted); font-size: 17px; line-height: 1.5; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  font-family: var(--sans); font-weight: 500; font-size: 15px; letter-spacing: -0.005em;
  transition: transform .15s, background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-3); }
.dark .btn-primary { background: var(--teal); color: var(--teal-ink); }
.dark .btn-primary:hover { background: #1cf3e3; }
.btn-ghost { border: 1px solid var(--rule); color: var(--ink); }
.dark .btn-ghost,
.final .btn-ghost,
.page-head .btn-ghost { border-color: var(--rule-dark); color: var(--paper); }
.btn-ghost:hover { border-color: currentColor; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translate(3px,-3px); }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--ink) 92%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  color: var(--paper);
  border-bottom: 1px solid var(--rule-dark);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
}
.nav-logo { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.nav-logo span { white-space: nowrap; }
.nav-logo svg { height: 22px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; white-space: nowrap; }
.nav-links a { color: color-mix(in oklab, var(--paper) 78%, transparent); transition: color .15s; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--paper); }
.nav-links a[aria-current="page"] { color: var(--teal); }
.nav-cta {
  background: var(--teal); color: var(--teal-ink);
  padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-cta:hover { background: #1cf3e3; }
.nav-toggle { display: none; }
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 99px;
    border: 1px solid var(--rule-dark); color: var(--paper);
  }
  .nav-cta-wrap { display: none; }
  .nav.menu-open .mobile-panel { display: flex; }
}
.mobile-panel {
  display: none; position: absolute; top: 68px; left: 0; right: 0;
  background: var(--ink-2); border-bottom: 1px solid var(--rule-dark);
  padding: 18px var(--gutter) 28px; flex-direction: column; gap: 4px;
}
.mobile-panel a {
  font-size: 22px; font-family: var(--serif); padding: 10px 0;
  border-bottom: 1px solid var(--rule-dark);
}
.mobile-panel a:last-of-type { border-bottom: 0; }
.mobile-panel .btn { margin-top: 16px; align-self: flex-start; }

/* page header (non-home) */
.page-head {
  background: var(--ink); color: var(--paper);
  padding: clamp(56px, 9vw, 112px) 0 clamp(48px, 8vw, 96px);
  position: relative; overflow: hidden; isolation: isolate;
}
.page-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 40% at 88% 10%, rgba(20,224,210,0.10), transparent 70%),
    radial-gradient(50% 50% at 8% 100%, rgba(11,55,240,0.18), transparent 70%);
}
.page-head .crumb {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: color-mix(in oklab, var(--paper) 60%, transparent);
  margin-bottom: 18px;
}
.page-head .crumb a:hover { color: var(--teal); }
.page-head h1 { font-size: clamp(44px, 7vw, 96px); max-width: 18ch; padding-bottom: 0.12em; }
.page-head h1 em { color: var(--teal); font-style: italic; }
.page-head .lede {
  margin-top: 28px; max-width: 56ch;
  font-size: clamp(17px,1.5vw,20px); line-height: 1.5;
  color: color-mix(in oklab, var(--paper) 78%, transparent);
}

/* footer */
footer { background: var(--ink); color: var(--paper); padding: 64px 0 40px; border-top: 1px solid var(--rule-dark); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in oklab, var(--paper) 56%, transparent); font-weight: 500; margin: 0 0 16px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-grid ul a { color: color-mix(in oklab, var(--paper) 78%, transparent); }
.footer-grid ul a:hover { color: var(--paper); }
.footer-tagline { font-family: var(--serif); font-size: 22px; line-height: 1.2; max-width: 22ch; margin: 16px 0 0; }
.footer-bottom {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule-dark);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: color-mix(in oklab, var(--paper) 56%, transparent);
}

/* final cta band (reusable) */
.final {
  background: var(--ink); color: var(--paper);
  position: relative; overflow: hidden; isolation: isolate;
}
.final::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 50% at 50% 100%, rgba(20,224,210,0.22), transparent 70%);
}
.final-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: end; }
@media (max-width: 820px) { .final-inner { grid-template-columns: 1fr; gap: 32px; } }
.final h2 { font-size: clamp(44px, 6.5vw, 96px); }
.final h2 em { color: var(--teal); font-style: italic; }
.final-meta { display: flex; flex-direction: column; gap: 14px; font-family: var(--mono); font-size: 13px; color: var(--muted-dark); }
.final-meta .row { display: flex; align-items: center; gap: 10px; }
.final-meta .row::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--teal); }
.final-cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.final-bottom {
  margin-top: 32px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted-dark); text-transform: uppercase;
}

/* utility */
::selection { background: var(--teal); color: var(--teal-ink); }
*:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.icn { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.icn-lg { width: 22px; height: 22px; }

/* P1 mobile fix — touch targets on footer + breadcrumb links */
@media (max-width: 760px) {
  .footer-grid ul a { display: inline-block; padding: 8px 0; min-height: 44px; line-height: 28px; }
  .page-head .crumb a { display: inline-block; padding: 8px 0; }
  .case-card .read, article .read { display: inline-block; padding: 12px 0; min-height: 44px; line-height: 20px; }
}
