/* Flowgear handoff packet — tokens aligned with homepage v01-A */
:root {
  --turquoise: #29baab;
  --yellow: #f2c23e;
  --navy: #0f1229;
  --purple: #ab8ab6;
  --royal: #6a8bc7;
  --red: #f3715f;
  --orange: #f59f58;
  --surface: #0f1229;
  --card: #161b35;
  --elevated: #1e2545;
  --t1: #ffffff;
  --t2: rgba(255, 255, 255, 0.65);
  --t3: rgba(255, 255, 255, 0.4);
  --border: rgba(255, 255, 255, 0.08);
  --maxw: 1200px;
  --sticky-offset: 120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--surface);
  color: var(--t1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.drawer-open {
  overflow: hidden;
}

a {
  color: var(--turquoise);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Sticky header + nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header-inner--top {
  padding-top: 10px;
  padding-bottom: 8px;
}

.site-header img.logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.site-header .wordmark {
  font-size: 19px;
  font-weight: 600;
  color: var(--turquoise);
  letter-spacing: -0.01em;
}

.header-progress {
  flex: 1;
  min-width: 160px;
  max-width: 280px;
}

.progress-summary {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 6px;
}

.progress-bar {
  height: 5px;
  background: var(--elevated);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: var(--turquoise);
  border-radius: 6px;
  transition: width 0.25s ease;
}

.reset-btn {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(243, 113, 95, 0.5);
  background: transparent;
  color: var(--red);
  font-family: inherit;
}

.reset-btn:hover {
  background: rgba(243, 113, 95, 0.12);
}

.site-tagline {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 8px;
  font-size: 12px;
  color: var(--t3);
}

.nav-chips-wrap {
  border-top: 1px solid var(--border);
  background: rgba(15, 18, 41, 0.95);
  backdrop-filter: blur(8px);
}

.nav-chips {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 24px 12px;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.nav-chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  background: var(--elevated);
  border: 1px solid var(--border);
  text-decoration: none;
  white-space: nowrap;
}

.nav-chip:hover {
  color: var(--t1);
  border-color: rgba(41, 186, 171, 0.4);
  text-decoration: none;
}

.nav-chip--done {
  border-color: rgba(41, 186, 171, 0.65);
  color: var(--turquoise);
}

.nav-chip--done::after {
  content: " ✓";
  font-weight: 700;
}

/* Hero */
.hero {
  padding: 40px 0 32px;
  background: radial-gradient(
      ellipse 70% 60% at 8% 30%,
      rgba(41, 186, 171, 0.08) 0%,
      transparent 60%
    ),
    var(--surface);
}

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero .lead {
  font-size: 17px;
  color: var(--t2);
  max-width: 640px;
  margin-bottom: 8px;
}

.hero .label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--turquoise);
  border: 1px solid rgba(41, 186, 171, 0.3);
  border-radius: 40px;
  padding: 4px 12px;
  margin-bottom: 16px;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 24px 0 56px;
  scroll-margin-top: var(--sticky-offset);
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  padding-top: 28px;
  transition: border-color 0.2s, opacity 0.2s;
}

.card:hover {
  border-color: rgba(41, 186, 171, 0.35);
}

.card--done {
  border-color: rgba(41, 186, 171, 0.45);
  opacity: 0.92;
}

.card-check {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  pointer-events: none;
}

.card--done .card-check {
  background: rgba(41, 186, 171, 0.2);
  border-color: var(--turquoise);
}

.card--done .card-check::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--turquoise);
}

.card h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.card h2 a {
  color: var(--t1);
}

.card h2 a:hover {
  color: var(--turquoise);
}

.card .slug {
  font-size: 12px;
  color: var(--t3);
  font-family: ui-monospace, monospace;
  margin-bottom: 8px;
}

.card .kw {
  font-size: 13px;
  color: var(--t2);
}

/* Post sections */
.post-section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: var(--sticky-offset);
}

.post-section--stripe {
  background: rgba(22, 27, 53, 0.45);
}

.post-section--done {
  border-left: 3px solid var(--turquoise);
}

.post-head {
  margin-bottom: 20px;
}

.post-head__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.post-head h1 {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 200px;
  margin: 0;
}

.post-done-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy);
  background: var(--turquoise);
  padding: 4px 10px;
  border-radius: 6px;
}

.post-head__actions {
  margin-bottom: 16px;
}

.publish-checklist {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.publish-checklist__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--turquoise);
  margin-bottom: 10px;
}

.publish-checklist__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 14px;
}

.check-item {
  font-size: 13px;
  color: var(--t2);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.check-item input {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--turquoise);
}

/* Collapsible folds */
.fold {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
}

.fold__summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
  padding: 12px 16px;
  background: var(--elevated);
  list-style: none;
}

.fold__summary::-webkit-details-marker {
  display: none;
}

.fold__summary::after {
  content: " ▾";
  color: var(--t3);
  font-size: 12px;
}

.fold[open] .fold__summary::after {
  content: " ▴";
}

.fold__body {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.meta-toolbar {
  margin-bottom: 12px;
}

/* Article body */
.article-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--t2);
}

.article-body h1 {
  display: none;
}

.article-body h2 {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 600;
  color: var(--t1);
  margin: 1.4em 0 0.6em;
  letter-spacing: -0.01em;
}

.article-body h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--t1);
  margin: 1.2em 0 0.5em;
}

.article-body p {
  margin: 0.85em 0;
  color: var(--t2);
}

.article-body ul,
.article-body ol {
  margin: 0.85em 0;
  padding-left: 1.35em;
  color: var(--t2);
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  margin: 0.35em 0;
}

.article-body blockquote {
  margin: 1.2em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--turquoise);
  background: var(--elevated);
  border-radius: 0 8px 8px 0;
  color: var(--t2);
}

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: rgba(41, 186, 171, 0.12);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  color: var(--turquoise);
}

.article-body pre {
  margin: 1em 0;
  padding: 16px;
  background: var(--elevated);
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.article-body pre code {
  background: none;
  padding: 0;
  color: var(--t2);
  font-size: 13px;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.article-body strong {
  color: var(--t1);
}

.article-body a {
  color: var(--turquoise);
}

.meta-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.meta-table th,
.meta-table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.meta-table tr:last-child th,
.meta-table tr:last-child td {
  border-bottom: none;
}

.meta-table th {
  width: 180px;
  max-width: 35%;
  background: var(--elevated);
  color: var(--turquoise);
  font-weight: 600;
  white-space: nowrap;
}

.meta-table td {
  color: var(--t2);
  background: var(--card);
}

/* Schema panel */
.schema-panel {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.schema-panel .schema-actions {
  margin-bottom: 10px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--turquoise);
  background: transparent;
  color: var(--turquoise);
  font-family: inherit;
}

.copy-btn:hover {
  background: var(--turquoise);
  color: var(--navy);
}

.copy-btn.copied {
  border-color: var(--yellow);
  color: var(--yellow);
}

.schema-panel pre {
  margin: 0;
  padding: 14px;
  background: var(--elevated);
  border-radius: 8px;
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.schema-panel code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--t2);
  white-space: pre;
}

.schema-panel .missing {
  color: var(--t3);
  font-size: 14px;
}

/* Prev / next */
.post-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.post-nav__link {
  font-size: 14px;
  font-weight: 600;
}

.post-nav__link--muted {
  color: var(--t3);
  cursor: default;
}

.post-nav__hub {
  color: var(--t2);
  font-weight: 500;
  font-size: 13px;
}

/* Mobile drawer + FAB */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 24, 0.65);
  z-index: 280;
}

.article-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 360px);
  height: 100%;
  background: var(--card);
  border-left: 1px solid var(--border);
  z-index: 300;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
}

.article-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.article-drawer__title {
  font-weight: 700;
  font-size: 15px;
}

.article-drawer__list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.drawer-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--t2);
  border: 1px solid transparent;
}

.drawer-row:hover {
  background: var(--elevated);
  color: var(--t1);
  text-decoration: none;
}

.drawer-row__chip {
  font-size: 12px;
  font-weight: 700;
  color: var(--turquoise);
}

.drawer-row__title {
  font-size: 13px;
  line-height: 1.35;
  color: inherit;
}

.drawer-row--done .drawer-row__chip::after {
  content: " ✓";
}

.fab-articles {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 250;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: var(--yellow);
  color: var(--navy);
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.fab-articles:hover {
  filter: brightness(1.05);
}

@media (min-width: 900px) {
  .fab-articles {
    display: none;
  }
}

@media (max-width: 899px) {
  body {
    padding-bottom: 72px;
  }
}

/* Footer */
.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--t3);
}

@media print {
  .site-header,
  .fab-articles,
  .article-drawer,
  .drawer-overlay,
  .reset-btn,
  .copy-btn,
  .publish-checklist,
  .nav-chips-wrap {
    display: none !important;
  }

  .post-section {
    break-inside: avoid;
  }
}
