/* ==========================================================================
   kylenull.org — Cherenkov-themed editorial minimalism
   Design inspiration: joshwcomeau.com (prose), linear.app/developers (cards)
   ========================================================================== */

:root {
  /* Backgrounds */
  --bg: #000a11;
  --bg-alt: #021520;
  --surface: #021520;
  --surface-lifted: #042838;

  /* Borders */
  --border: #0a3040;
  --border-hover: #0077a8;
  --border-bronze: #6b4718;

  /* Cherenkov blues */
  --blue: #00b4d8;
  --blue-deep: #0077a8;
  --teal-dark: #003d52;
  --blue-glow: #48cae4;

  /* Bronze (reactor pole warmth) */
  --bronze: #c9893a;
  --bronze-deep: #a06828;
  --bronze-glow: #e8a44a;

  /* Text */
  --text: #e8f4f8;
  --text-muted: #7ab5c8;
  --text-dim: #3d7a8a;

  /* Category colors */
  --cat-ai:          #48cae4;
  --cat-discoveries: #c9893a;
  --cat-buyers:      #9bd1dc;
  --cat-sellers:     #e8a44a;
  --cat-agents:      #00b4d8;
  --cat-insights:    #7ab5c8;
  --cat-investors:   #9ed4a8;

  /* Typography */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', 'Lora', Georgia, 'Times New Roman', serif;

  /* Layout */
  --max-prose: 680px;
  --max-content: 1200px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --t-fast: 150ms ease;
  --t: 240ms ease;
  --t-slow: 400ms ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--blue); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--blue-glow); }

/* ---------- Containers ---------- */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
}

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 10, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  /* Respect iOS notch / Dynamic Island — push nav content below the status bar */
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

/* Animated gradient-reveal on hover — matches KN logo blue→teal→bronze */
.nav-text {
  position: relative;
  display: inline-block;
  color: var(--text);
  line-height: 1;
}
.nav-text::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  background-image: linear-gradient(
    90deg,
    #0077a8  0%,
    #00b4d8 22%,
    #48cae4 42%,
    #a06828 68%,
    #c9893a 85%,
    #e8a44a 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  transition: width 650ms cubic-bezier(0.33, 1, 0.68, 1);
  pointer-events: none;
}
.nav-logo:hover .nav-text::before {
  width: 100%;
}

.nav-logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform var(--t-fast), filter var(--t-fast);
}
.nav-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.nav-logo:hover .nav-logo-mark {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 8px rgba(72, 202, 228, 0.35));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  position: relative;
  display: inline-block;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color var(--t-fast);
}
/* Brand-gradient wipe-in on hover — same pattern as kylenull.org text */
.nav-links a::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  padding: inherit;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  background-image: linear-gradient(
    90deg,
    #0077a8  0%,
    #00b4d8 22%,
    #48cae4 42%,
    #a06828 68%,
    #c9893a 85%,
    #e8a44a 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  transition: width 550ms cubic-bezier(0.33, 1, 0.68, 1);
  pointer-events: none;
}
.nav-links a:hover::before,
.nav-links a.is-active::before {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed;
    top: calc(64px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 16px 24px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    /* Fully hidden when closed — opacity + visibility avoids the dropdown
       peeking into the viewport regardless of its height */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
      opacity 240ms ease,
      transform 240ms ease,
      visibility 0s linear 240ms;
  }
  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition:
      opacity 240ms ease,
      transform 240ms ease,
      visibility 0s linear 0s;
  }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 120px 0 100px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(0, 180, 216, 0.18), transparent 70%),
    radial-gradient(ellipse 70% 50% at 50% 60%, rgba(72, 202, 228, 0.08), transparent 80%);
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(201, 137, 58, 0.04), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 180, 216, 0.06), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero-eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 24px;
}

/* ---------- Brand gradient text (blue → teal → bronze, matches logo) ---------- */
.brand-gradient {
  background-image: linear-gradient(
    90deg,
    #0077a8  0%,
    #00b4d8 22%,
    #48cae4 42%,
    #a06828 68%,
    #c9893a 85%,
    #e8a44a 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}

/* Hero tagline — small italic serif line above the big headline */
.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(16px, 1.5vw, 19px);
  letter-spacing: -0.005em;
  margin: 0 0 22px;
}

/* Footer tagline — same italic serif feel, smaller */
.footer-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.5;
  margin: 14px 0 6px;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(40px, 6.5vw, 72px);
  line-height: 1.06;
  letter-spacing: -0.022em;
  margin: 0 auto 28px;
  max-width: 14ch;
  color: var(--text);
}
.hero-title em {
  font-style: italic;
  color: var(--blue-glow);
  font-weight: 400;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 auto 40px;
  font-weight: 400;
}

.hero-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bronze);
  background: transparent;
  border: 1px solid var(--bronze-deep);
  border-radius: var(--radius);
  transition: transform var(--t), box-shadow var(--t), color var(--t);
}
.hero-cta:hover {
  color: var(--bronze-glow);
  box-shadow: 0 8px 28px -6px rgba(72, 202, 228, 0.22);
  transform: translateY(-1px);
}
.hero-cta svg { width: 16px; height: 16px; transition: transform var(--t-fast); }
.hero-cta:hover svg { transform: translateX(3px); }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
@media (max-width: 640px) { .section { padding: 56px 0; } }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.section-heading h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text);
}

.section-heading p {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
  max-width: 42ch;
}

.section-heading .see-all {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--blue);
}
.section-heading .see-all:hover { color: var(--blue-glow); }

/* ---------- Cards: Linear-style grid system ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition:
    border-color var(--t),
    transform var(--t),
    box-shadow var(--t),
    background var(--t);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(0, 180, 216, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity var(--t);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px -10px rgba(0, 180, 216, 0.18);
}
.card:hover::before { opacity: 1; }

.card.card-bronze:hover {
  box-shadow: 0 10px 40px -10px rgba(201, 137, 58, 0.25);
}
.card.card-bronze:hover::before {
  background: radial-gradient(circle at 50% 0%, rgba(201, 137, 58, 0.10), transparent 60%);
}

.card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--blue-glow);
}

/* Tag row sits between icon and title on tool cards — compact spacing */
.card .tag-row { margin: 0 0 10px; }
.card-icon svg { width: 22px; height: 22px; stroke-width: 1.5; }

.card.card-bronze .card-icon {
  color: var(--bronze-glow);
  border-color: var(--border-bronze);
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--text);
}

.card p {
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

.card-arrow {
  position: absolute;
  top: 28px;
  right: 28px;
  opacity: 0;
  transition: all var(--t);
  color: var(--blue);
}
.card-bronze .card-arrow { color: var(--bronze); }
.card:hover .card-arrow { opacity: 1; transform: translate(3px, -3px); }
.card-arrow svg { width: 18px; height: 18px; }

/* ---------- Category grid ---------- */
.grid-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .grid-categories { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-categories { grid-template-columns: 1fr; } }

/* ---------- Highlights ---------- */
.highlights {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
}
@media (max-width: 860px) { .highlights { grid-template-columns: 1fr; } }

.highlight-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 22px;
}

.highlight-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.highlight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px -10px rgba(0, 180, 216, 0.2);
}

.highlight-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #021a24 0%, #003d52 50%, #042838 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.highlight-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 700ms cubic-bezier(0.33, 1, 0.68, 1);
}
.highlight-card:hover .highlight-media img {
  transform: scale(1.03);
}
.highlight-card.is-featured .highlight-media { aspect-ratio: 16 / 9; }
.highlight-card.is-compact .highlight-media { aspect-ratio: 16 / 9; }

.highlight-body {
  padding: 24px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.highlight-card.is-compact .highlight-body { padding: 18px 22px 22px; }

.highlight-card.is-featured h3 {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 14px 0 10px;
  color: var(--text);
  font-weight: 600;
}
.highlight-card.is-compact h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.25;
  margin: 10px 0 8px;
  color: var(--text);
  font-weight: 600;
}

.highlight-excerpt {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.highlight-card.is-compact .highlight-excerpt { font-size: 13.5px; line-height: 1.5; }

.read-more {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}
.read-more:hover { color: var(--blue-glow); }

/* ---------- Post cards (recent posts grid) ---------- */
.grid-posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .grid-posts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-posts { grid-template-columns: 1fr; } }

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: transform var(--t), box-shadow var(--t);
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -12px rgba(0, 180, 216, 0.18);
}

.post-card h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 12px 0 8px;
  color: var(--text);
}

.post-card p {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 20px;
  border: 1px solid currentColor;
  color: var(--text-muted);
  background: rgba(10, 48, 64, 0.35);
  line-height: 1;
}

.tag[data-cat="ai"]          { color: var(--cat-ai); }
.tag[data-cat="discoveries"] { color: var(--cat-discoveries); background: rgba(201, 137, 58, 0.10); }
.tag[data-cat="buyers"]      { color: var(--cat-buyers); }
.tag[data-cat="sellers"]     { color: var(--cat-sellers); background: rgba(232, 164, 74, 0.08); }
.tag[data-cat="agents"]      { color: var(--cat-agents); }
.tag[data-cat="insights"]    { color: var(--cat-insights); }
.tag[data-cat="investors"]   { color: var(--cat-investors); background: rgba(158, 212, 168, 0.08); }

/* ---------- Tag row (category tag + status tag side-by-side) ---------- */
.tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.post-card .tag-row { margin-bottom: 8px; }
.tag-row .tag { margin: 0; }

/* ---------- Status tags (post publication state) ---------- */
.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 20px;
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
}

/* NEW — real, published posts. Bold, bronze-glow, pops. */
.status-tag.status-new {
  background: linear-gradient(135deg, var(--bronze) 0%, var(--bronze-glow) 100%);
  color: #1a0f00;
  font-weight: 800;
  letter-spacing: 0.18em;
  border-color: var(--bronze-glow);
  box-shadow: 0 0 0 1px rgba(232, 164, 74, 0.25), 0 0 14px rgba(232, 164, 74, 0.4);
  animation: status-pulse 2.8s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(232, 164, 74, 0.25), 0 0 14px rgba(232, 164, 74, 0.35); }
  50%      { box-shadow: 0 0 0 1px rgba(232, 164, 74, 0.35), 0 0 22px rgba(232, 164, 74, 0.55); }
}

/* COMING SOON — in progress, real work underway. */
.status-tag.status-soon {
  color: var(--blue-glow);
  border-color: var(--blue-deep);
  background: rgba(0, 119, 168, 0.14);
  font-weight: 600;
}

/* AI PLACEHOLDER — filler content, disclosed honestly. */
.status-tag.status-placeholder {
  color: var(--text-dim);
  border-color: var(--border);
  background: transparent;
  font-weight: 500;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

/* Coming-soon posts feel slightly dim in grids (not clickable) */
.post-card.is-coming-soon,
.post-card.is-placeholder {
  cursor: default;
}
.post-card.is-coming-soon:hover,
.post-card.is-placeholder:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}
.post-card.is-placeholder { opacity: 0.75; }
.post-card.is-placeholder:hover { opacity: 0.85; }

/* ---------- Compact category chip bar (for homepage section headings) ---------- */
.cat-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.cat-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.cat-chip:hover {
  background: var(--surface-lifted);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(0, 180, 216, 0.25);
}
.cat-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}
.cat-chip[data-cat="ai"]          { color: var(--cat-ai); }
.cat-chip[data-cat="discoveries"] { color: var(--cat-discoveries); }
.cat-chip[data-cat="buyers"]      { color: var(--cat-buyers); }
.cat-chip[data-cat="sellers"]     { color: var(--cat-sellers); }
.cat-chip[data-cat="agents"]      { color: var(--cat-agents); }
.cat-chip[data-cat="insights"]    { color: var(--cat-insights); }

@media (max-width: 760px) {
  .cat-chips {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* ---------- Tools section ---------- */
.tools-section {
  background: linear-gradient(180deg, transparent 0%, rgba(201, 137, 58, 0.025) 50%, transparent 100%);
}

.grid-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 1040px) { .grid-tools { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-tools { grid-template-columns: 1fr; } }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all var(--t-fast);
}
.filter-chip:hover {
  border-color: var(--blue-deep);
  color: var(--text);
}
.filter-chip.is-active {
  background: var(--teal-dark);
  border-color: var(--blue-deep);
  color: var(--blue-glow);
}

/* ---------- Page header (category/page intros) ---------- */
.page-header {
  padding: 80px 0 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 20% 0%, rgba(0, 180, 216, 0.08), transparent 60%);
  pointer-events: none;
}
.page-header > * { position: relative; }

.page-eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 16px;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(36px, 5.5vw, 56px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--text);
  max-width: 16ch;
}

.page-header .lede {
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
  max-width: 52ch;
}

.page-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  padding: 24px 0 0;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-dim);
}
.breadcrumb a {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb a:hover { color: var(--blue-glow); }

/* ---------- Post article layout (Josh Comeau editorial) ---------- */
.article {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 56px 24px 96px;
}
@media (max-width: 640px) { .article { padding: 40px 20px 72px; } }

.article-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.article-header .tag { margin-bottom: 20px; }

.article h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--text);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-dim);
}

.prose {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.75;
  color: var(--text);
}
.prose > * + * { margin-top: 1.4em; }
.prose p { margin: 0 0 1.4em; }

.prose h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 2.2em 0 0.6em;
  color: var(--text);
}
.prose h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  margin: 1.8em 0 0.5em;
  color: var(--text);
}

.prose a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(0, 180, 216, 0.3);
  text-underline-offset: 3px;
  transition: all var(--t-fast);
}
.prose a:hover {
  color: var(--blue-glow);
  text-decoration-color: var(--blue-glow);
}

.prose blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--bronze);
  color: var(--text-muted);
  font-style: italic;
}

.prose ul, .prose ol {
  padding-left: 1.4em;
  margin: 1.4em 0;
}
.prose li { margin: 0.5em 0; }
.prose li::marker { color: var(--bronze); }

.prose code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 2px 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--blue-glow);
}

.prose pre {
  margin: 1.6em 0;
  padding: 20px 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 3em 0;
}

.prose img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.6em 0;
}

/* ---------- Related posts ---------- */
.related {
  padding: 64px 0 96px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(0, 180, 216, 0.02));
}

/* ---------- Contact ---------- */
.contact-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}
.contact-wrap h1 {
  font-family: var(--font-serif);
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--text);
}
.contact-wrap .lede {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 40px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field label,
.field legend {
  display: block;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0;
}

.field .req {
  color: var(--bronze);
  margin-left: 2px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue-deep);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

.field textarea { min-height: 140px; resize: vertical; }

/* Honeypot — completely hidden from users, visible to bots */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

/* Two-column row (email + phone) */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}

/* Radio group — dark Cherenkov-styled pills */
.radio-group {
  border: none;
  margin: 0;
  padding: 0;
}
.radio-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  user-select: none;
}
.radio input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.radio-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg);
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.radio-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-glow);
  transform: scale(0);
  transition: transform var(--t-fast);
}
.radio:hover {
  border-color: var(--blue-deep);
  color: var(--text);
}
.radio:has(input:checked) {
  border-color: var(--blue-deep);
  color: var(--text);
  background: var(--surface-lifted);
}
.radio:has(input:checked) .radio-mark {
  border-color: var(--blue-glow);
  background: var(--bg);
}
.radio:has(input:checked) .radio-mark::after {
  transform: scale(1);
}

/* Form actions row — button + status message */
.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bronze);
  background: transparent;
  border: 1px solid var(--bronze-deep);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--t), transform var(--t), box-shadow var(--t);
}
.btn-primary svg { width: 16px; height: 16px; transition: transform var(--t-fast); }
.btn-primary:hover {
  color: var(--bronze-glow);
  box-shadow: 0 8px 28px -6px rgba(72, 202, 228, 0.22);
  transform: translateY(-1px);
}
.btn-primary:hover svg { transform: translateX(3px); }
.btn-primary:disabled,
.btn-primary.is-sending {
  opacity: 0.55;
  cursor: wait;
  transform: none;
  box-shadow: none;
}
.btn-primary.is-sending::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(201, 137, 58, 0.3);
  border-top-color: var(--bronze-glow);
  border-radius: 50%;
  animation: btn-spin 700ms linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-primary.is-sending svg,
.btn-primary.is-sending [data-submit-label] { visibility: hidden; }

/* Status message */
.form-status {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
  min-height: 1.5em;
}
.form-status.is-success {
  color: var(--blue-glow);
}
.form-status.is-error {
  color: #f07b5b;
}

.contact-direct {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-muted);
}
.contact-direct a {
  color: var(--bronze);
  font-weight: 500;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-brand {
  max-width: 320px;
}
.footer-brand p {
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 14px 0 0;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 16px 56px;
}

.footer-col h4 {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 14px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li + li { margin-top: 8px; }
.footer-col a {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-muted);
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Copy-to-clipboard bar (blog posts) ---------- */
.copy-bar {
  position: sticky;
  top: 72px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 32px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(4, 40, 56, 0.85), rgba(4, 40, 56, 0.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px -8px rgba(0, 180, 216, 0.18);
}
.copy-bar-text {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.copy-bar-text strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
  font-size: 13.5px;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--bronze);
  background: transparent;
  border: 1px solid var(--bronze-deep);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t);
}
.copy-btn svg { width: 15px; height: 15px; transition: transform var(--t-fast); }
.copy-btn:hover {
  background: var(--bronze);
  color: var(--bg);
  border-color: var(--bronze);
  box-shadow: 0 0 0 4px rgba(201, 137, 58, 0.15);
  transform: translateY(-1px);
}
.copy-btn.is-copied {
  background: var(--blue-deep);
  color: var(--text);
  border-color: var(--blue-glow);
  box-shadow: 0 0 0 4px rgba(72, 202, 228, 0.18);
}
.copy-btn.is-copied svg { transform: scale(1.1); }

@media (max-width: 640px) {
  .copy-bar { flex-direction: column; align-items: flex-start; padding: 14px; }
  .copy-bar-text { font-size: 12.5px; }
  .copy-btn { width: 100%; justify-content: center; }
}

/* ---------- Questionnaire sections (hash-anchored for readability) ---------- */
.prose .q-section {
  margin: 2.4em 0 1.8em;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.prose .q-section h3 {
  margin-top: 0;
  margin-bottom: 0.6em;
  color: var(--bronze);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-ui);
}
.prose .q-section ol {
  margin: 0;
  padding-left: 1.8em;
  list-style: decimal;
}
.prose .q-section ol li {
  padding-left: 6px;
  margin: 0.9em 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
}
.prose .q-section ol li::marker {
  color: var(--blue);
  font-weight: 600;
  font-family: var(--font-ui);
  font-feature-settings: 'tnum';
}

/* Final prompt template callout */
.prompt-callout {
  margin: 2.2em 0;
  padding: 28px;
  background: linear-gradient(145deg, rgba(0, 61, 82, 0.35), rgba(4, 21, 32, 0.75));
  border: 1px solid var(--border-bronze);
  border-radius: var(--radius);
}
.prompt-callout-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze-glow);
  margin: 0 0 14px;
}
.prompt-callout p {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 1em;
}
.prompt-callout ul { margin: 0.8em 0 0; padding-left: 1.3em; }
.prompt-callout li { margin: 0.5em 0; }
.prompt-callout li::marker { color: var(--bronze); }

/* ==========================================================================
   Shared brand gradient border — hover state for every clickable link-card.
   Matches the blue→teal→bronze gradient of the "kylenull.org" text hover.
   Applied uniformly across tools, posts, highlights, and category chips.
   ========================================================================== */
a.card::after,
a.post-card::after,
a.highlight-card::after,
a.cat-chip::after,
a.hero-cta::after,
a.social-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;                 /* thickness of the gradient ring */
  background: linear-gradient(
    90deg,
    #0077a8  0%,
    #00b4d8 22%,
    #48cae4 42%,
    #a06828 68%,
    #c9893a 85%,
    #e8a44a 100%
  );
  background-size: 200% 100%;
  background-position: 100% 0;    /* start: gradient "off-stage" to the right */
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition:
    opacity 350ms ease,
    background-position 700ms cubic-bezier(0.33, 1, 0.68, 1);
  pointer-events: none;
  z-index: 2;
}
a.card:hover::after,
a.post-card:hover::after,
a.highlight-card:hover::after,
a.cat-chip:hover::after,
a.hero-cta:hover::after,
a.social-link:hover::after {
  opacity: 1;
  background-position: 0 0;       /* gradient slides fully in */
}

/* Placeholder + coming-soon cards are <div>, not <a> — already excluded
   by the `a.post-card` selector. */

/* ==========================================================================
   About page — portrait vignette, inline photos, YouTube embed, social grid
   ========================================================================== */

/* Vignette portrait — radial-mask blend into dark backdrop */
.about-portrait {
  display: flex;
  justify-content: center;
  margin: -40px 0 8px;
  pointer-events: none;
}

/* About-specific centered header */
.article-header.about-header {
  text-align: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 32px;
  margin-bottom: 40px;
}
.about-header .page-eyebrow {
  display: inline-block;
  margin: 0 0 14px;
}
.about-header h1 {
  margin: 0 auto 18px;
  max-width: 18ch;
}
.about-header .article-meta {
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--text-muted);
  font-size: 13px;
}
.about-header .article-meta svg {
  width: 7px;
  height: 7px;
  color: var(--bronze);
  flex-shrink: 0;
}
.about-portrait picture {
  display: block;
  width: 100%;
  max-width: 520px;
}
.about-portrait img {
  width: 100%;
  max-width: 520px;
  height: auto;
  -webkit-mask-image: radial-gradient(ellipse 62% 78% at 55% 42%, #000 38%, transparent 88%);
          mask-image: radial-gradient(ellipse 62% 78% at 55% 42%, #000 38%, transparent 88%);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}

/* <picture> wrapper support for inline photos and photo pair */
.prose .about-photo picture {
  display: inline-block;
  width: 100%;
  max-width: 600px;
}
.prose .about-photo-pair picture {
  display: block;
  width: 100%;
  height: 100%;
}

/* Inline photo embedded in article prose */
.prose .about-photo {
  margin: 2em 0;
  text-align: center;
}
.prose .about-photo img {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
}
.prose .about-photo figcaption {
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

/* Two-up photo pair (for Frank) */
.prose .about-photo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 2em 0;
}
.prose .about-photo-pair img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.5);
}
@media (max-width: 560px) {
  .prose .about-photo-pair { grid-template-columns: 1fr; }
}

/* YouTube embed — 16:9 aspect-ratio container */
.prose .video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 2.4em 0 0.6em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
}
.prose .video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.prose .video-caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
  max-width: 560px;
  margin: 0 auto 2.4em;
}

/* Social / contact grid */
.about-socials {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 2em 0 0;
}
.social-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.social-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -14px rgba(0, 180, 216, 0.22);
}
.social-link-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--blue-glow);
  flex-shrink: 0;
}
.social-link-icon svg { width: 18px; height: 18px; stroke-width: 1.5; }
.social-link-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}
.social-link-label {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.social-link-value {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 560px) {
  .about-socials { grid-template-columns: 1fr; }
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.spacer-sm { height: 24px; }
.spacer-md { height: 48px; }

/* ---------- Mobile tweaks ---------- */
@media (max-width: 640px) {
  .hero { padding: 80px 0 64px; }
  .section-heading { margin-bottom: 28px; }
  .card { padding: 22px; }
  .post-card { padding: 20px; }
  .footer-inner { flex-direction: column; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 24px 32px; }
}
