/* CLS public website — v2 shared stylesheet
   Palette per CLS-PUBLIC-WEBSITE-REDESIGN-V2-DESIGN-PROPOSAL.md §7.1
   Same-origin only asset. No external fonts/scripts (AC-SEC-01). */

:root {
  /* base / brand */
  --navy-900: #0F172A;
  --navy-800: #111c30;
  --navy-700: #1E293B;
  /* neutrals / background */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --line: #E2E8F0;
  --line-dark: #1E293B;
  /* text */
  --text: #0F172A;
  --muted: #475569;
  --text-on-dark: #E2E8F0;
  --muted-on-dark: #CBD5E1;
  /* accent / action (10% budget) */
  --cobalt: #2563EB;
  --cobalt-strong: #1D4ED8;
  --teal: #0EA5E9;
  --focus: #0369A1;
  /* semantic */
  --warn-bg: #FEF3C7;
  --warn-text: #92400E;
  --ok-bg: #DCFCE7;
  --ok-text: #166534;
  /* metrics */
  --maxw: 1120px;
  --radius: 14px;
  --radius-lg: 18px;
  --ease: cubic-bezier(.2,.6,.2,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.03em; margin: 0; }
p { margin: 0 0 10px; }
a { color: var(--cobalt); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
img, svg { max-width: 100%; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 18px 0; }
.section-tight { padding: 8px 0 14px; }
.eyebrow {
  display: inline-block; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--cobalt-strong);
  font-size: 0.72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 10px;
}

/* ---------- focus ---------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(248,250,252,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  max-width: 1320px; min-height: 52px; display: flex; align-items: center; gap: 16px; justify-content: space-between;
}
.brand {
  display: inline-flex; align-items: center;
  font-size: 2rem; font-weight: 900; letter-spacing: -0.06em; color: var(--text); flex-shrink: 0;
}
.brand svg { display: none; }
.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-item {
  border: 0; background: transparent; cursor: pointer; font: inherit;
  color: var(--muted); font-weight: 650; font-size: 0.8rem;
  padding: 7px 9px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .8; }
.nav-item:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-item:hover svg { opacity: 1; }
.nav-item[aria-expanded="true"] { color: var(--text); background: var(--surface-2); }
.nav-item[aria-current="page"] {
  color: var(--text); font-weight: 800;
  box-shadow: inset 0 -2px 0 var(--cobalt);
}
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-dl {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--cobalt); background: #fff;
  color: var(--cobalt-strong); font-weight: 750; font-size: .82rem; white-space: nowrap;
}
.header-dl:hover { background: var(--cobalt); color: #fff; text-decoration: none; }
.auth-placeholder {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--muted); font: inherit; font-weight: 750; font-size: 0.8rem; cursor: not-allowed;
  white-space: nowrap;
}
.action-short { display: none; }
.pill {
  padding: 2px 7px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text);
  font-size: 0.6rem; font-weight: 850; text-transform: uppercase; letter-spacing: .04em;
}
.menu-toggle {
  display: none; width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.1rem;
}

/* ---------- navigation preview dialog ---------- */
.modal-open { overflow: hidden; }
.preview-backdrop {
  position: fixed; inset: 0; z-index: 100; padding: 72px 24px 24px;
  background: rgba(15,23,42,.62); overflow: auto;
}
.preview-backdrop[hidden] { display: none; }
.preview-dialog {
  width: min(860px, 100%); margin: 0 auto; padding: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(15,23,42,.28);
}
.preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.preview-head h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
.preview-close {
  width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--text); font: 700 1.6rem/1 sans-serif; cursor: pointer;
}
.preview-intro { max-width: 700px; margin: 10px 0 18px; color: var(--muted); font-size: .94rem; }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.preview-grid > div { padding: 16px; background: var(--surface-2); border-radius: 12px; }
.preview-grid h3 { font-size: .95rem; margin-bottom: 6px; }
.preview-grid p { margin: 0; color: var(--muted); font-size: .82rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 750; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-strong); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); text-decoration: none; }
.btn-disabled {
  background: var(--surface-2); color: var(--muted); border-color: var(--line);
  cursor: not-allowed;
}

/* ---------- hero ---------- */
.hero { padding: 16px 0 14px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.04em; }
.hero-copy { max-width: 600px; margin-top: 10px; color: var(--muted); font-size: 0.86rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hero-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px;
}
.hero-panel h2 { font-size: 0.98rem; }
.hero-panel .lead { color: var(--cobalt-strong); font-weight: 800; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.hero-panel .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.hero-panel .grid2 > div {
  background: var(--surface-2); border-radius: 9px; padding: 8px 10px;
  font-size: 0.76rem; font-weight: 700; color: var(--text);
}

/* ---------- obsidian graph cards (Platform) ---------- */
.ops { padding: 2px 0 12px; }
.ops-head { max-width: 760px; margin-bottom: 10px; }
.ops-head span { color: var(--cobalt); font-size: .68rem; font-weight: 850;
  text-transform: uppercase; letter-spacing: .08em; }
.ops-head h2 { margin-top: 3px; font-size: clamp(1.15rem, 2vw, 1.55rem); letter-spacing: -0.03em; }
.ops-head p { margin-top: 6px; color: var(--muted); font-size: .84rem; }
.ops-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ops-card {
  position: relative; overflow: hidden;
  background: var(--navy-900); color: var(--text-on-dark);
  border: 1px solid var(--line-dark); border-radius: var(--radius);
  padding: 13px 13px 12px;
}
.ops-card::before { /* corner connector tick */
  content: ""; position: absolute; top: 12px; left: 12px; width: 14px; height: 14px;
  border-top: 2px solid var(--teal); border-left: 2px solid var(--teal); opacity: .8;
}
.ops-card .graph {
  position: absolute; inset: 0; opacity: .14; pointer-events: none;
}
.ops-card .body { position: relative; }
.ops-card .k { color: var(--teal); font-size: .66rem; font-weight: 850;
  text-transform: uppercase; letter-spacing: .09em; }
.ops-card h3 { margin: 4px 0 4px; font-size: .9rem; color: #F8FAFC; }
.ops-card p { color: var(--muted-on-dark); font-size: .78rem; margin: 0; }
.ops-bus { height: 1px; background: var(--line); margin: 0 8px; }

/* ---------- feature panel (dark CTA band) ---------- */
.feature {
  background: var(--navy-900); color: var(--text-on-dark);
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.feature > div { min-width: 0; }
.feature h2 { color: #F8FAFC; font-size: clamp(1rem, 1.8vw, 1.25rem); }
.feature p { color: var(--muted-on-dark); margin-top: 4px; max-width: 640px; font-size: .82rem; }
.feature .btn-secondary { margin-top: 0; flex-shrink: 0; }

/* ---------- generic content / legal ---------- */
.content { padding: 16px 0 24px; }
.content h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.panel-summary { max-width: 760px; margin: 8px 0 4px; color: var(--muted); font-size: .92rem; }
.panel-summary p { margin: 0 0 8px; }
.content-body {
  margin-top: 16px; max-width: 780px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px;
}
.content-body h2 { font-size: 1.1rem; margin: 14px 0 6px; }
.content-body h2:first-child { margin-top: 0; }
.content-body p { color: var(--muted); }
.status-banner {
  margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-text);
  font-weight: 700; font-size: 0.9rem;
}
.status-banner .chip { padding: 4px 10px; border-radius: 999px; background: #fff; font-size: .74rem; font-weight: 850; }
.meta-row {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted);
}
.meta-row strong { color: var(--text); }
.back-link { display: inline-block; margin-top: 14px; color: var(--cobalt-strong); font-weight: 700; }

/* ---------- download rows ---------- */
.dl-rows { display: grid; gap: 10px; margin-top: 16px; }
.dl-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.dl-row .os { font-weight: 750; }
.dl-row .st { font-size: .8rem; color: var(--muted); }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 14px; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px;
}
.step .n { color: var(--cobalt); font-weight: 850; font-size: .78rem; letter-spacing: .06em; }
.step h3 { margin: 6px 0 6px; font-size: 1rem; }
.step p { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 11px 0; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.foot-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .86rem; }
.foot-brand { color: var(--text); font-weight: 850; }
.foot-link { border: 0; background: transparent; font: inherit; cursor: pointer; color: var(--muted); padding: 3px 0; }
.foot-link:hover { color: var(--text); text-decoration: underline; }
.foot-note { color: var(--muted); font-size: .82rem; }

/* ---------- Support & Learning: CLS Community preview ---------- */
.community-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--warn-bg); color: var(--warn-text);
  border-radius: 12px; padding: 10px 14px; font-size: .82rem; font-weight: 650; margin-bottom: 14px;
}
.community-note .chip { background: #fff; padding: 3px 9px; border-radius: 999px; font-size: .7rem; font-weight: 850; }

.classification-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.classification-card { padding: 13px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.classification-card h2 { display: flex; align-items: center; gap: 8px; font-size: .9rem; margin-bottom: 9px; }
.classification-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 10px; margin: 0; font-size: .74rem; }
.classification-meta dt { color: var(--muted); font-weight: 750; }
.classification-meta dd { margin: 0; color: var(--text); }

.community-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.community-layout.rail-left { grid-template-columns: 320px 1fr; }
.community-layout.rail-left .rail { order: -1; }

.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.feed-head h2 { font-size: 1.05rem; }
.seg { display: flex; gap: 2px; background: var(--surface-2); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; font: inherit; font-size: .76rem; font-weight: 700;
  color: var(--muted); padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.thread { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.thread:last-child { border-bottom: 0; }
.votes { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted);
  font-size: .78rem; flex-shrink: 0; width: 30px; }
.votes button { border: 0; background: transparent; cursor: pointer; color: var(--muted); line-height: 1; font-size: .8rem; }
.votes .n { font-weight: 800; color: var(--text); }
.t-main { min-width: 0; flex: 1; }
.t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: .74rem; color: var(--muted); margin-bottom: 3px; }
.t-meta .comm { font-weight: 800; color: var(--navy-900); }
.badge { font-size: .62rem; font-weight: 850; text-transform: uppercase; letter-spacing: .02em;
  padding: 2px 6px; border-radius: 999px; color: #fff; }
.b-official { background: #1D4ED8; }
.b-org { background: #7C3AED; }
.b-mod { background: #B45309; }
.b-community { background: #475569; }
.pin { color: #B45309; font-weight: 850; }
.t-title { font-size: .96rem; font-weight: 750; margin: 2px 0 4px; }
.t-title a { color: var(--text); }
.t-excerpt { color: var(--muted); font-size: .84rem; margin: 0 0 5px; }
.t-foot { display: flex; flex-wrap: wrap; gap: 12px; font-size: .76rem; color: var(--muted); }

.thread-view { padding: 16px 18px; margin-top: 14px; }
.tv-back { font-size: .78rem; font-weight: 700; }
.tv-title { font-size: 1.2rem; font-weight: 800; margin: 8px 0 6px; }
.tv-op { color: var(--muted); font-size: .88rem; margin: 8px 0 12px; }
.reply { display: flex; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.reply .rb { min-width: 0; }
.reply .r-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: .72rem; color: var(--muted); margin-bottom: 3px; }
.reply p { margin: 2px 0; font-size: .86rem; }
.reply code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .82em; }
.reply .r-actions { font-size: .74rem; color: var(--muted); margin-top: 4px; display: flex; gap: 12px; }
.reply.nested { margin-left: 32px; }

.rail { display: flex; flex-direction: column; gap: 12px; }
.rail .card { padding: 13px; }
.rail h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 9px; }
.rail-toggle { display: flex; align-items: center; justify-content: space-between; font-size: .74rem; color: var(--muted); }
.rail-toggle button { border: 1px solid var(--line); background: var(--surface-2); font: inherit;
  font-size: .72rem; font-weight: 750; color: var(--muted); padding: 4px 9px; border-radius: 7px; cursor: pointer; }
.profile { display: flex; gap: 10px; align-items: center; }
.profile .pn { font-weight: 800; }
.profile .ps { font-size: .76rem; color: var(--muted); }
.kv { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 7px; }
.kv strong { color: var(--text); }
.rail-links { display: flex; gap: 8px; margin-top: 11px; }
.rail-links button { flex: 1; border: 1px solid var(--line); background: var(--surface-2); font: inherit;
  font-size: .74rem; font-weight: 700; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; }
.comm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0;
  border-top: 1px solid var(--line); font-size: .82rem; }
.comm-row:first-of-type { border-top: 0; }
.comm-row .cn { font-weight: 750; }
.comm-row .cd { font-size: .72rem; color: var(--muted); }
.follow { border: 1px solid var(--cobalt); background: #fff; color: var(--cobalt-strong); font: inherit;
  font-size: .7rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.follow.on { background: var(--cobalt); color: #fff; }
.act { display: flex; gap: 9px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .8rem; }
.act:first-of-type { border-top: 0; }
.act .ai { width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; color: var(--muted); font-size: .8rem; }
.act .at { color: var(--muted); }
.act .at b { color: var(--text); font-weight: 750; }
.act .ax { font-size: .7rem; color: var(--muted); }
.avatar { border-radius: 50%; flex-shrink: 0; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .community-layout, .community-layout.rail-left { grid-template-columns: 1fr; }
  .community-layout.rail-left .rail { order: 0; }
}
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .ops-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .hero-panel .grid2 { grid-template-columns: 1fr; }
  .nav { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-header.menu-open .nav {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 14px; gap: 2px;
  }
  .site-header.menu-open .nav-item { text-align: left; padding: 12px 8px; }
}

@media (max-width: 700px) {
  .header-dl { display: none; }
  .auth-placeholder { padding: 0 9px; min-height: 36px; font-size: .72rem; }
  .auth-placeholder .pill { display: none; }
  .preview-backdrop { padding: 62px 12px 12px; }
  .preview-dialog { padding: 18px; }
  .preview-grid, .classification-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .site-header .container { gap: 8px; padding: 0 12px; }
  .auth-placeholder { width: 40px; overflow: hidden; justify-content: center; padding: 0; }
  .auth-placeholder .action-long { display: none; }
  .auth-placeholder .action-short { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
