/* Cormorant website — landing and legal pages.
   Sea-chart palette from the portal ("sea foam" light, "night sea" dark):
   a serif for headings like the labels on a nautical chart, system sans for
   reading, and one deep-water panel (the fetch pipeline) as the signature. */

:root {
  --bg: #f4f8f9;
  --bg-2: #e8f0f2;
  --panel: #ffffff;
  --ink: #0c1d26;
  --ink-2: #2b3f49;
  --muted: #4f646e;
  --line: #d3e1e6;
  --line-2: #b9ccd3;
  --accent: #0b7d6e;
  --accent-hover: #075f54;
  --accent-ink: #ffffff;
  --accent-soft: rgba(11, 125, 110, 0.14);
  --focus: #0b7d6e;
  --error: #b3261e;
  --error-soft: rgba(179, 38, 30, 0.08);
  --water-top: #134552;
  --water-bottom: #04161d;
  --water-ink: #e3f4f1;
  --water-muted: #a9c9ce;
  --foam: #43e9c7;
  --code-bg: #071820;
  --code-ink: #d5e7ec;
  --code-com: #7d98a4;
  --code-str: #9cecc4;
  --ok: #138a52;
  --warn: #b26a00;
  --bad: #c0352b;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1180px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #04090e;
    --bg-2: #07121a;
    --panel: #0a1821;
    --ink: #e7f1f5;
    --ink-2: #c4d5dc;
    --muted: #93a8b4;
    --line: rgba(140, 205, 225, 0.14);
    --line-2: rgba(140, 205, 225, 0.26);
    --accent: #34e8c6;
    --accent-hover: #6ff4db;
    --accent-ink: #032019;
    --accent-soft: rgba(52, 232, 198, 0.16);
    --focus: #5ff0d4;
    --error: #ff9b8f;
    --error-soft: rgba(255, 155, 143, 0.08);
    --water-top: #0d2c37;
    --water-bottom: #020a0f;
    --code-bg: #061119;
    --ok: #3ddc84;
    --warn: #f5b44a;
    --bad: #ff7a6e;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, pre { font-family: var(--mono); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border: 1px solid var(--accent); border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 0.98rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 0.9rem; }

/* ------------------------------------------------------------ header / footer */

.site-head { border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font: 700 1.2rem/1 var(--serif); letter-spacing: -0.005em;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; }
.head-nav { display: flex; gap: 4px; margin-left: auto; }
.head-nav a {
  color: var(--ink-2); text-decoration: none; font-size: 0.95rem;
  padding: 8px 10px; border-radius: 8px;
}
.head-nav a:hover { color: var(--ink); background: var(--accent-soft); }
.site-head .btn-small { display: none; }
@media (max-width: 479px) { .head-nav a[href="/docs/reference"] { display: none; } }
@media (min-width: 720px) { .site-head .btn-small { display: inline-flex; } .head-nav { margin-right: 8px; } }

.site-foot { border-top: 1px solid var(--line); margin-top: 24px; padding: 40px 0 48px; }
.foot-row { display: grid; gap: 22px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot-links a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }
.foot-note { color: var(--muted); font-size: 0.9rem; }
@media (min-width: 900px) {
  .foot-row { grid-template-columns: auto 1fr auto; align-items: center; gap: 40px; }
}

/* ------------------------------------------------------------ hero */

.hero { padding: 48px 0 56px; }
.hero-grid { display: grid; gap: 44px; align-items: center; }
@media (min-width: 980px) {
  .hero { padding: 80px 0 72px; }
  .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 64px; }
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.55rem, 4.4vw + 1.1rem, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.024em;
  max-width: 13ch;
  text-wrap: balance;
}
.lede {
  margin-top: 24px; max-width: 34em;
  font-size: clamp(1.06rem, 0.4vw + 1rem, 1.22rem); line-height: 1.55; color: var(--ink-2);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.status-badge {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 28px;
  color: var(--muted); font-size: 0.92rem; text-decoration: none;
  padding: 6px 12px 6px 10px; margin-left: -10px; border-radius: 999px;
}
.status-badge:hover { color: var(--ink); background: var(--accent-soft); }
.status-badge .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none;
}
.status-badge[data-status="operational"] .dot { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: ping 2.4s ease-out 3; }
.status-badge[data-status="maintenance"] .dot,
.status-badge[data-status="degraded"] .dot { background: var(--warn); }
.status-badge[data-status="partial_outage"] .dot,
.status-badge[data-status="major_outage"] .dot { background: var(--bad); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55); } 100% { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); } }
@media (prefers-reduced-motion: reduce) { .status-badge .dot { animation: none !important; } }

/* The dive: the fetch pipeline as depths on a sea chart. */
.dive {
  position: relative; overflow: hidden; margin: 0;
  padding: 26px 22px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--water-top) 0%, var(--water-bottom) 100%);
  color: var(--water-ink);
  isolation: isolate;
  border: 1px solid transparent;
}
@media (prefers-color-scheme: dark) { .dive { border-color: rgba(67, 233, 199, 0.22); } }
@media (min-width: 720px) { .dive { padding: 32px 34px 28px; } }
.contours { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--foam); opacity: 0.32; z-index: -1; }
.dive-cap {
  display: grid; gap: 8px; max-width: 28em;
  padding-bottom: 18px; border-bottom: 1px solid rgba(67, 233, 199, 0.28);
}
.dive-title {
  font: 400 clamp(1.4rem, 1vw + 1.1rem, 1.7rem)/1.15 var(--serif);
  letter-spacing: -0.012em; color: var(--water-ink);
}
.dive-sub { color: var(--water-muted); font-size: 0.95rem; line-height: 1.5; }
/* Depth scale: soundings at the top and bottom of the dashed line. */
.dive-scale {
  margin: 12px 0 -4px; padding-left: 32px;
  font: 600 0.68rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--foam); opacity: 0.8;
}
.dive-scale-end { margin: 6px 0 12px; }
.tiers { position: relative; margin: 0; }
.tiers::before {
  content: ""; position: absolute; left: 7px; top: 18px; bottom: 18px;
  border-left: 1.5px dashed rgba(67, 233, 199, 0.55);
}
.tier {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px;
  padding: 12px 0 12px 32px;
}
.tier + .tier { border-top: 1px solid rgba(169, 201, 206, 0.12); }
.tier::before {
  content: ""; position: absolute; left: 2px; top: 18px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--water-top); border: 2px solid var(--foam);
}
.tier:first-child::before { background: var(--foam); }
.tier:last-child::before { border-radius: 2px; transform: rotate(45deg); }
.tier-name { font: 600 1.02rem/1.3 var(--sans); }
.tier-note { grid-column: 1; color: var(--water-muted); font-size: 0.9rem; line-height: 1.45; }
.tier-tag {
  grid-column: 2; grid-row: 1; align-self: start; white-space: nowrap;
  font: 600 0.72rem/1 var(--mono); padding: 5px 8px; border-radius: 6px;
  color: var(--foam); background: rgba(67, 233, 199, 0.08);
  border: 1px solid rgba(67, 233, 199, 0.4);
}
@media (max-width: 479px) {
  .tier { grid-template-columns: minmax(0, 1fr); }
  .tier-tag { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 6px; }
}
.dive-out {
  padding-top: 16px; border-top: 1px solid rgba(67, 233, 199, 0.28);
  color: var(--water-ink); font-size: 0.95rem; line-height: 1.55;
}
.dive-out span { font-weight: 700; color: var(--foam); margin-right: 4px; }

/* ------------------------------------------------------------ sections */

.block { padding: 64px 0; }
@media (min-width: 980px) { .block { padding: 96px 0; } }
.block h2 {
  font-family: var(--serif); font-size: clamp(1.9rem, 2.2vw + 1.1rem, 2.75rem);
  line-height: 1.1; letter-spacing: -0.018em; text-wrap: balance;
}

/* What you get: one ruled grid, like a chart legend. */
.caps {
  display: grid; margin-top: 36px;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--line); gap: 1px;
}
@media (min-width: 640px) { .caps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .caps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cap { background: var(--bg); padding: 26px 24px 24px; display: flex; flex-direction: column; }
.cap-icon { width: 28px; height: 28px; color: var(--accent); }
.cap h3 { margin-top: 18px; font: 600 1.15rem/1.3 var(--sans); letter-spacing: -0.01em; }
.cap p { margin-top: 8px; color: var(--ink-2); font-size: 0.98rem; line-height: 1.55; flex: 1; }
.cap-ep {
  margin-top: 20px; align-self: flex-start;
  font-size: 0.8rem; color: var(--muted); padding: 4px 8px;
  border-radius: 6px; background: var(--bg-2);
}

/* How it works */
.block-code { background: var(--bg-2); border-block: 1px solid var(--line); }
.code-grid { display: grid; gap: 32px; align-items: start; }
@media (min-width: 980px) { .code-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr); gap: 56px; } }
.code-copy p { margin-top: 18px; color: var(--ink-2); max-width: 30em; }
.text-link { font-weight: 600; }
.code-box {
  min-width: 0; border-radius: 16px; background: var(--code-bg); color: var(--code-ink);
  border: 1px solid rgba(140, 205, 225, 0.16); overflow: hidden;
}
.tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid rgba(140, 205, 225, 0.14); }
.tabs [role="tab"] {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: #9fb6c0; font: 600 0.88rem/1 var(--sans);
  padding: 11px 14px 12px; border-radius: 8px 8px 0 0; position: relative;
}
.tabs [role="tab"]:hover { color: #e7f1f5; }
.tabs [role="tab"][aria-selected="true"] { color: #e7f1f5; }
.tabs [role="tab"][aria-selected="true"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: #43e9c7;
}
.tabs [role="tab"]:focus-visible { outline-color: #43e9c7; outline-offset: -3px; }
html:not(.js) .tabs { display: none; }
html:not(.js) .panel + .panel { border-top: 1px solid rgba(140, 205, 225, 0.14); }
.panel:focus-visible { outline-color: #43e9c7; outline-offset: -3px; }
.panel pre {
  margin: 0; padding: 20px 22px 24px; overflow-x: auto;
  font-size: 0.84rem; line-height: 1.65; tab-size: 4;
}
.c-com { color: var(--code-com); }
.c-str { color: var(--code-str); }

/* Built for production */
.prod { display: grid; gap: 0 48px; margin-top: 28px; }
@media (min-width: 720px) { .prod { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .prod { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.prod li { padding: 22px 0 6px; border-top: 1px solid var(--line); }
.prod h3 { font: 600 1.06rem/1.35 var(--sans); }
.prod h3::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 10px 2px 0;
  border-radius: 50%; background: var(--accent);
}
.prod p { margin-top: 6px; color: var(--ink-2); font-size: 0.97rem; max-width: 34em; }

/* Pricing + request access */
.block-request { border-top: 1px solid var(--line); }
.request-grid { display: grid; gap: 36px; align-items: start; }
@media (min-width: 980px) { .request-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 64px; } }
.lede-sm { margin-top: 18px; color: var(--ink-2); font-size: 1.06rem; max-width: 30em; }

.request-form {
  display: grid; gap: 18px;
  padding: 24px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
}
@media (min-width: 640px) {
  .request-form { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 32px; gap: 20px 22px; }
  .field-wide, .form-actions, .form-error { grid-column: 1 / -1; }
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 0.94rem; }
.opt { font-weight: 400; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.88rem; margin-top: -2px; }
.field input, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font: 400 1rem/1.4 var(--sans); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder { color: var(--muted); opacity: 0.8; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.has-error input, .has-error textarea { border-color: var(--error); }
.error { color: var(--error); font-size: 0.88rem; font-weight: 600; }
.form-error {
  color: var(--error); background: var(--error-soft); border-left: 3px solid var(--error);
  padding: 10px 14px; border-radius: 0 8px 8px 0; font-weight: 600; font-size: 0.95rem;
}
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.form-note { color: var(--muted); font-size: 0.9rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-done {
  padding: 32px; border: 1px solid var(--accent); border-radius: 16px; background: var(--accent-soft);
}
.form-done h3 { font: 400 1.6rem/1.2 var(--serif); }
.form-done p { margin-top: 10px; color: var(--ink-2); }

/* ------------------------------------------------------------ legal */

.prose { max-width: calc(68ch + 2 * var(--gutter)); padding-top: 56px; padding-bottom: 56px; }
.prose h1 {
  font-family: var(--serif); font-size: clamp(2.2rem, 3vw + 1rem, 3rem);
  line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 20px;
}
.prose h2 { font: 600 1.12rem/1.3 var(--sans); margin: 34px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: 10px; }
.prose ul { list-style: disc; padding-left: 1.3em; }
.prose li + li { margin-top: 4px; }
.prose .address { line-height: 1.7; }
.prose strong { color: var(--ink); }
