/* ─────────────────────────────────────────────────────────────
   ChatHub — shared sub-page stylesheet
   Used by: about, support, privacy, terms, feedback, success
   Mirrors the design tokens from index.html exactly.
   ───────────────────────────────────────────────────────────── */

:root {
  --paper:   #f4efe6;
  --paper-2: #ece6d8;
  --ink:     #14130f;
  --ink-2:   #2a2823;
  --ink-3:   #6b6658;
  --line:    #1413100f;
  --line-2:  #14131019;

  --cobalt:      #2547ff;
  --cobalt-deep: #1a32c4;
  --apricot:     #ff7a3d;
  --moss:        #4a8f5e;
  --plum:        #6b3fa0;

  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: var(--grain);
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ─── Skip link ─── */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 0 0 8px 0;
  z-index: 9999; font-size: 14px; font-weight: 500;
}
.skip-link:focus { left: 0; }

/* ─── Nav ─── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: color-mix(in oklab, var(--paper) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; position: relative; z-index: 2; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--ink);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; color: var(--paper); }
.brand-name { font-family: var(--serif); font-size: 22px; letter-spacing: -0.02em; font-weight: 400; }
.brand-name em { font-style: italic; color: var(--cobalt); }

.nav-links {
  display: flex; gap: 28px;
  font-size: 14px; color: var(--ink-2);
}
.nav-links a {
  position: relative; padding: 4px 0;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s cubic-bezier(.7,0,.2,1);
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--ink); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink); color: var(--paper);
  box-shadow: 0 1px 0 #fff inset, 0 8px 24px -8px var(--ink);
}
.btn-primary:hover { transform: translateY(-1px); background: var(--cobalt); }
.btn-outline {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn-outline:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-cobalt {
  background: var(--cobalt); color: #fff;
  box-shadow: 0 8px 24px -10px var(--cobalt);
}
.btn-cobalt:hover { transform: translateY(-1px); background: var(--cobalt-deep); }

/* ─── Page header band ─── */
.page-head {
  max-width: 1240px; margin: 0 auto;
  padding: 80px 28px 48px;
  position: relative; z-index: 2;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--ink-3); }

.page-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 6vw, 88px);
  line-height: 0.98; letter-spacing: -0.025em;
  margin: 18px 0 0; color: var(--ink);
  max-width: 22ch;
}
.page-title em { font-style: italic; color: var(--cobalt); }
.page-sub {
  font-family: var(--sans); font-size: 18px;
  color: var(--ink-2); max-width: 60ch;
  margin: 22px 0 0;
}
.page-meta {
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-3); margin-top: 14px;
  letter-spacing: 0.04em;
}

/* ─── Page body ─── */
.page-body {
  max-width: 760px; margin: 0 auto;
  padding: 24px 28px 80px;
  position: relative; z-index: 2;
}
.page-body.wide { max-width: 1100px; }

/* ─── Prose blocks ─── */
.pb {
  padding: 36px 0;
  border-top: 1px solid var(--line);
}
.pb:last-child { border-bottom: 1px solid var(--line); }
.pb h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3.4vw, 38px);
  letter-spacing: -0.02em; line-height: 1.1;
  margin: 0 0 18px;
  color: var(--ink);
}
.pb h2 em { font-style: italic; color: var(--cobalt); }
.pb h3 {
  font-family: var(--sans); font-size: 16px;
  font-weight: 600; letter-spacing: -0.005em;
  margin: 28px 0 8px;
  color: var(--ink);
}
.pb p {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 16px; line-height: 1.7;
}
.pb p:last-child { margin-bottom: 0; }
.pb ul {
  margin: 0 0 14px;
  padding: 0; list-style: none;
}
.pb ul li {
  position: relative;
  padding: 6px 0 6px 22px;
  color: var(--ink-2);
  font-size: 16px; line-height: 1.65;
}
.pb ul li::before {
  content: ""; position: absolute;
  left: 4px; top: 16px;
  width: 6px; height: 6px;
  background: var(--cobalt); border-radius: 50%;
}
.pb a {
  color: var(--cobalt);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease;
}
.pb a:hover { color: var(--cobalt-deep); }
.pb code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--paper-2);
  padding: 2px 7px; border-radius: 5px;
  border: 1px solid var(--line-2);
  color: var(--ink);
}
.pb strong { color: var(--ink); font-weight: 600; }
.pb.tc { text-align: center; }

/* ─── Two-column feature grid (about, success) ─── */
.feat-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.feat-2-item {
  padding: 22px 22px 24px;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.feat-2-item:hover { transform: translateY(-2px); border-color: var(--cobalt); }
.feat-2-title {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  color: var(--ink);
}
.feat-2-desc {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ─── Step list (success page) ─── */
.step-list { display: flex; flex-direction: column; gap: 0; margin-top: 8px; }
.step-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  align-items: flex-start;
}
.step-row:last-child { border-bottom: 1px solid var(--line); }
.step-n {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  flex-shrink: 0;
}
.step-t { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }
.step-t strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.step-t span { color: var(--ink-2); font-size: 15px; line-height: 1.5; }

/* ─── Support tiles ─── */
.support-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 8px 0 24px;
}
.s-tile {
  display: flex; flex-direction: column;
  padding: 26px 24px 28px;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  cursor: pointer;
}
.s-tile:hover {
  transform: translateY(-3px);
  border-color: var(--cobalt);
  background: #fff;
}
.s-tile-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  border-radius: 10px;
  margin-bottom: 14px;
}
.s-tile-icon svg { width: 20px; height: 20px; }
.s-tile-title {
  font-family: var(--serif); font-size: 22px;
  letter-spacing: -0.015em; color: var(--ink);
  margin-bottom: 4px;
}
.s-tile-desc { font-size: 14px; color: var(--ink-2); line-height: 1.5; }

/* ─── Success ring (success, feedback) ─── */
.success-ring {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--moss) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--moss) 40%, transparent);
  display: grid; place-items: center;
}
.success-ring svg { width: 30px; height: 30px; color: var(--moss); }

/* ─── Form (feedback) ─── */
.form-stack { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.form-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
}
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--cobalt) 16%, transparent);
  background: #fff;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.form-end { display: flex; justify-content: flex-end; padding-top: 6px; }

/* ─── Footer (matches homepage) ─── */
footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  position: relative; z-index: 2;
}
.footer-grid {
  max-width: 1240px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding: 56px 28px 32px;
}
.footer-grid h4 {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a {
  font-size: 14px; color: var(--ink-2);
  transition: color 0.2s ease;
}
.footer-grid a:hover { color: var(--cobalt); }
.footer-tag {
  font-size: 14px; color: var(--ink-2);
  max-width: 30ch; line-height: 1.55;
  margin: 12px 0 0;
}
.footer-bottom {
  max-width: 1240px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 28px 28px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  flex-wrap: wrap; gap: 12px;
}
.footer-bottom a { color: var(--ink-3); transition: color 0.2s ease; }
.footer-bottom a:hover { color: var(--ink); }

/* ─── Responsive ─── */
@media (max-width: 920px) {
  .nav-links { display: none; }
  .feat-2 { grid-template-columns: 1fr; }
  .support-2 { grid-template-columns: 1fr; }
  .form-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; padding: 44px 24px 24px; }
  .page-head { padding: 56px 24px 36px; }
  .page-body { padding: 16px 24px 64px; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .step-row { grid-template-columns: 36px 1fr; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
