/* Krowded Blog. Tokens mirror src/styles/globals.css and Brand Book v2:
   Deep Navy ground, white type, Electric Teal as a small accent,
   Energy Orange only on the call to action. */

:root {
  --brand-blue: #12326A;
  --deep-navy: #0A1D3E;
  --pure-white: #FFFFFF;
  --energy-orange: #EE6C4D;
  --electric-teal: #00E6FF;

  --surface-0: #0A1D3E;
  --surface-1: #0F244A;
  --surface-2: #132C57;

  --text: rgba(255, 255, 255, 0.80);
  --text-soft: rgba(255, 255, 255, 0.62);
  --text-faint: rgba(255, 255, 255, 0.45);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  --display: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --measure: 700px;
  --wide: 1180px;
  --radius: 1.1rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(70% 45% at 85% -5%, rgba(18, 50, 106, 0.55), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
img { max-width: 100%; height: auto; display: block; }
svg { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.fill { fill: currentColor; stroke: none; }
a { color: inherit; }
::selection { background: rgba(0, 230, 255, 0.25); color: #fff; }
:focus-visible { outline: 2px solid var(--electric-teal); outline-offset: 3px; border-radius: 6px; }

.shell { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2rem); }
.col { width: 100%; max-width: var(--measure); margin: 0 auto; }

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--pure-white); color: var(--deep-navy);
  padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 1rem; }

h1, h2, h3 { font-family: var(--display); color: var(--pure-white); font-weight: 600; margin: 0; }

.grad {
  background: linear-gradient(90deg, #4E86D9, var(--electric-teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

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

.btn-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--energy-orange); color: var(--deep-navy);
  font-weight: 600; font-size: 0.9rem; text-decoration: none; white-space: nowrap;
  padding: 0.6rem 1.1rem; border-radius: 999px;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.btn-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-cta svg { font-size: 1.05rem; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font: 500 0.875rem/1 var(--body); color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 0.6rem 1rem;
  text-decoration: none; cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.btn-ghost:hover { border-color: rgba(0, 230, 255, 0.45); color: var(--pure-white); background: rgba(0, 230, 255, 0.07); }
.btn-ghost svg { font-size: 1rem; }

/* ------------------------------------------------------------ top bar */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 29, 62, 0.78);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4.25rem; }
.brand { display: inline-flex; flex: none; }
.brand img { height: 36px; width: auto; }
.topnav { display: flex; align-items: center; gap: 0.25rem; }
.topnav a:not(.btn-cta) {
  font-size: 0.9rem; font-weight: 500; color: var(--text-soft); text-decoration: none;
  padding: 0.5rem 0.8rem; border-radius: 0.6rem; transition: color 0.2s ease, background 0.2s ease;
}
.topnav a:not(.btn-cta):hover { color: var(--pure-white); background: rgba(255, 255, 255, 0.05); }
.topnav a[aria-current] { color: var(--electric-teal); }
.topnav .btn-cta { margin-left: 0.5rem; }

@media (max-width: 560px) {
  .brand img { height: 30px; }
  .topnav a[href="/#how-it-works"] { display: none; }
}

/* ------------------------------------------------------------ blog index */

.blog-hero { padding-top: clamp(3.5rem, 9vw, 6rem); padding-bottom: clamp(2rem, 4vw, 3rem); }
.eyebrow {
  display: inline-flex; align-items: center;
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.01em;
  color: var(--electric-teal);
  border: 1px solid rgba(0, 230, 255, 0.3); background: rgba(0, 230, 255, 0.05);
  border-radius: 999px; padding: 0.4rem 0.95rem;
}
.blog-hero h1 {
  margin-top: 1.25rem; max-width: 16ch;
  font-size: clamp(2.3rem, 5.5vw + 0.5rem, 3.9rem); line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance;
}
.blog-hero .lede { margin: 1.1rem 0 0; max-width: 36em; font-size: clamp(1.05rem, 1vw + 0.8rem, 1.25rem); line-height: 1.6; color: var(--text-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.chip {
  font-size: 0.85rem; font-weight: 500; color: var(--text-soft); text-decoration: none;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.45rem 0.95rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.chip:hover { color: var(--pure-white); border-color: rgba(255, 255, 255, 0.35); }
.chip[aria-current="page"] { color: var(--deep-navy); background: var(--pure-white); border-color: var(--pure-white); }

.listing { display: grid; gap: clamp(1.25rem, 3vw, 2rem); padding-bottom: clamp(3rem, 6vw, 5rem); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.25rem, 2.5vw, 1.75rem); }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ cards */

.card { min-width: 0; }
.card-link {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: inherit;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.card-link:hover { border-color: rgba(0, 230, 255, 0.35); transform: translateY(-2px); }
.card-link:hover .card-title { color: var(--pure-white); text-decoration: underline; text-decoration-color: rgba(0, 230, 255, 0.6); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.card-media { aspect-ratio: 1200 / 627; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 0.55rem; padding: clamp(1.1rem, 2vw, 1.4rem); flex: 1; }
.card-cat { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--electric-teal); }
.card-title { font-size: 1.15rem; line-height: 1.35; letter-spacing: -0.01em; color: var(--pure-white); text-wrap: balance; }
.card-desc {
  margin: 0; font-size: 0.93rem; line-height: 1.55; color: var(--text-soft);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin-top: auto; padding-top: 0.4rem; font-size: 0.8rem; color: var(--text-faint); display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }

.card-featured .card-link { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.card-featured .card-media { aspect-ratio: auto; min-height: 100%; }
.card-featured .card-body { padding: clamp(1.5rem, 3.5vw, 2.75rem); justify-content: center; gap: 0.8rem; }
.card-featured .card-title { font-size: clamp(1.5rem, 2.2vw + 0.6rem, 2.1rem); line-height: 1.2; letter-spacing: -0.02em; }
.card-featured .card-desc { font-size: 1.02rem; -webkit-line-clamp: 4; }
.card-featured .card-meta { margin-top: 0.4rem; }
@media (max-width: 820px) {
  .card-featured .card-link { grid-template-columns: 1fr; }
  .card-featured .card-media { aspect-ratio: 1200 / 627; }
}

/* placeholder art for posts without an image */
.ph {
  position: relative; width: 100%; height: 100%; min-height: 160px;
  display: flex; align-items: flex-end;
  padding: 1.1rem 1.25rem;
  background:
    radial-gradient(55% 70% at 88% 18%, rgba(0, 230, 255, 0.16), transparent 70%),
    linear-gradient(145deg, var(--brand-blue) 0%, var(--surface-1) 58%, var(--deep-navy) 100%);
  overflow: hidden;
}
.ph::before {
  content: ''; position: absolute; inset: auto -10% -35% -10%; height: 85%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320' preserveAspectRatio='none'%3E%3Cpath fill='rgba(0,230,255,0.07)' d='M0,160L60,170.7C120,181,240,203,360,192C480,181,600,139,720,128C840,117,960,139,1080,165.3C1200,192,1320,224,1380,240L1440,256L1440,320L0,320Z'/%3E%3Cpath fill='rgba(255,255,255,0.04)' d='M0,224L80,213.3C160,203,320,181,480,186.7C640,192,800,224,960,229.3C1120,235,1280,213,1360,202.7L1440,192L1440,320L0,320Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}
.ph span {
  position: relative;
  font-family: var(--display); font-weight: 600; letter-spacing: -0.02em;
  font-size: clamp(1.4rem, 3vw, 2.2rem); color: rgba(255, 255, 255, 0.16);
}
.ph-perspective { background:
    radial-gradient(55% 70% at 12% 20%, rgba(0, 230, 255, 0.13), transparent 70%),
    linear-gradient(200deg, var(--brand-blue) 0%, var(--surface-1) 55%, var(--deep-navy) 100%); }
.ph-news { background:
    radial-gradient(60% 80% at 50% 0%, rgba(0, 230, 255, 0.15), transparent 70%),
    linear-gradient(180deg, var(--brand-blue) 0%, var(--deep-navy) 100%); }

.empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1.2rem;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.75rem);
}
.empty p { margin: 0; max-width: 34em; font-size: 1.05rem; color: var(--text-soft); }

.follow {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--line); padding-top: 1.75rem; padding-bottom: 1.75rem;
}
.follow p { margin: 0; color: var(--text-soft); }
.follow-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ------------------------------------------------------------ article */

.art-head { padding-top: clamp(2.5rem, 7vw, 4.5rem); }
.crumbs { display: flex; align-items: center; gap: 0.55rem; font-size: 0.85rem; }
.crumbs a { color: var(--text-soft); text-decoration: none; }
.crumbs a:hover { color: var(--pure-white); }
.crumbs a:last-child { color: var(--electric-teal); font-weight: 500; }
.crumbs span { color: var(--text-faint); }

.art-head h1 {
  margin-top: 1.1rem;
  font-size: clamp(2rem, 4vw + 0.9rem, 3.1rem); line-height: 1.14; letter-spacing: -0.022em; text-wrap: balance;
}
.art-head .lede { margin: 1.1rem 0 0; font-size: clamp(1.08rem, 0.8vw + 0.9rem, 1.28rem); line-height: 1.6; color: var(--text-soft); text-wrap: pretty; }

.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 0.9rem;
  margin-top: 1.75rem; padding: 1.1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.avatar {
  width: 2.5rem; height: 2.5rem; border-radius: 999px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; font-size: 0.85rem; color: var(--pure-white);
  background: linear-gradient(145deg, var(--brand-blue), var(--surface-2));
  border: 1px solid rgba(0, 230, 255, 0.35);
}
.avatar-lg { width: 3.25rem; height: 3.25rem; font-size: 1rem; }
.by-who { display: flex; flex-direction: column; line-height: 1.3; }
.by-name { font-weight: 600; color: var(--pure-white); font-size: 0.95rem; }
.by-role { font-size: 0.85rem; color: var(--text-soft); }
.by-when { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--text-faint); }
@media (max-width: 560px) { .by-when { margin-left: 0; width: 100%; } }
.dot { color: var(--text-faint); }

.art-hero { margin-top: clamp(2rem, 4vw, 2.75rem); max-width: 1040px; }
.art-hero img { width: 100%; aspect-ratio: 1200 / 627; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-1); }

/* ------------------------------------------------------------ prose */

.prose { padding-top: clamp(2rem, 4vw, 2.75rem); font-size: 1.1rem; line-height: 1.78; color: var(--text); }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.45em; text-wrap: pretty; }
.prose h2 { margin: 2.3em 0 0.75em; font-size: clamp(1.45rem, 1.6vw + 0.9rem, 1.85rem); line-height: 1.28; letter-spacing: -0.015em; scroll-margin-top: 6rem; }
.prose h3 { margin: 2em 0 0.6em; font-size: clamp(1.15rem, 0.8vw + 0.9rem, 1.35rem); line-height: 1.35; scroll-margin-top: 6rem; }
.prose strong { color: var(--pure-white); font-weight: 600; }
.prose a { color: var(--electric-teal); text-decoration: underline; text-decoration-color: rgba(0, 230, 255, 0.4); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-color: var(--electric-teal); }
.prose ul, .prose ol { margin: 0 0 1.45em; padding-left: 1.3em; }
.prose li { margin: 0 0 0.55em; padding-left: 0.25em; }
.prose li::marker { color: var(--electric-teal); }
.prose ol li::marker { font-family: var(--mono); font-size: 0.85em; }
.prose blockquote {
  margin: 2em 0; padding: 0.2em 0 0.2em 1.4em;
  border-left: 2px solid var(--electric-teal);
  font-family: var(--display); font-weight: 500; font-size: 1.22rem; line-height: 1.55; color: var(--pure-white);
}
.prose blockquote p { margin: 0 0 0.8em; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; height: 1px; background: var(--line-strong); margin: 2.75em 0; }
.prose figure { margin: 2.2em 0; }
.prose figure img { width: 100%; border-radius: 0.85rem; border: 1px solid var(--line); }
.prose figure .zoom { display: block; cursor: zoom-in; text-decoration: none; }
.prose figure .zoom:hover img { border-color: rgba(0, 230, 255, 0.35); }
.prose figcaption { margin-top: 0.7rem; font-size: 0.88rem; line-height: 1.5; color: var(--text-faint); }
.prose code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 0.35rem; padding: 0.1em 0.4em; color: var(--pure-white);
}
.table-wrap { margin: 2em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 0.85rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.5; }
.prose th, .prose td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; color: var(--pure-white); background: var(--surface-1); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------ article foot */

.art-foot { padding-top: 1rem; padding-bottom: clamp(2.5rem, 5vw, 3.5rem); }

.sources { margin: 1rem 0 2.25rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.sources h2 { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-soft); }
.sources ol { margin: 1rem 0 0; padding-left: 1.4em; font-size: 0.92rem; line-height: 1.55; color: var(--text-faint); }
.sources li { margin-bottom: 0.5rem; padding-left: 0.2em; }
.sources li::marker { font-family: var(--mono); font-size: 0.85em; }
.sources a { color: var(--text-soft); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; overflow-wrap: anywhere; }
.sources a:hover { color: var(--pure-white); text-decoration-color: var(--electric-teal); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 1.5rem 0; border-top: 1px solid var(--line); }
.share-label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-right: 0.35rem; }

.author {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}
.author p { margin: 0; }
.author-name { font-family: var(--display); font-weight: 600; color: var(--pure-white); }
.author-bio { margin-top: 0.25rem !important; font-size: 0.93rem; line-height: 1.55; color: var(--text-soft); }

/* ------------------------------------------------------------ call to action */

.cta-band { padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.cta-card {
  position: relative; overflow: hidden;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(0, 230, 255, 0.10), transparent 60%),
    linear-gradient(135deg, rgba(18, 50, 106, 0.85), rgba(15, 36, 74, 0.9));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.cta-card > div { flex: 1 1 26rem; }
.cta-card h2 { font-size: clamp(1.35rem, 1.6vw + 0.8rem, 1.8rem); line-height: 1.25; letter-spacing: -0.015em; text-wrap: balance; }
.cta-card p { margin: 0.6rem 0 0; color: var(--text-soft); max-width: 36em; }

/* ------------------------------------------------------------ more */

.more { padding-bottom: clamp(3.5rem, 7vw, 5.5rem); }
.more-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.4rem; }
.more-head h2 { font-size: clamp(1.3rem, 1.2vw + 0.9rem, 1.6rem); }
.more-head a { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; font-weight: 500; color: var(--electric-teal); text-decoration: none; }
.more-head a:hover { text-decoration: underline; text-underline-offset: 3px; }
.more .card-title { font-size: 1.05rem; }

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

.site-foot { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.1rem 2rem; }
.foot-in .brand img { height: 32px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; }
.foot-links a { font-size: 0.875rem; color: var(--text-soft); text-decoration: none; }
.foot-links a:hover { color: var(--electric-teal); }
.foot-note { margin: 0; font-size: 0.8rem; color: var(--text-faint); }

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

@media print {
  .topbar, .cta-band, .more, .share, .site-foot, body::before { display: none; }
  body { background: #fff; color: #111; }
  h1, h2, h3, .prose strong { color: #000; }
  .prose a { color: #000; }
}
