/* ==========================================================================
   The Tech Unravel — Blog stylesheet
   Brand: deep navy (#060531) + cyan → blue → indigo gradient (from the logo)
          + thumbnail yellow (#FFD23F) for small highlights.
   Sections:
     1. Design tokens (colors, fonts, spacing) + dark mode
     2. Base / reset
     3. Layout helpers & buttons
     4. Header & navigation
     5. Hero (homepage) + handheld console illustration
     6. Post cards, featured post, filters
     7. Video strip & call-to-action band
     8. Footer
     9. Article page (header, prose, video embed, TOC, share, author)
    10. Static pages (About, Contact, 404)
    11. Utilities, motion & print
   ========================================================================== */

/* 1. DESIGN TOKENS ======================================================== */
:root {
  /* Brand */
  --navy-950: #060531;
  --navy-900: #0b0a45;
  --navy-800: #15145c;
  --cyan: #3fd3f7;
  --blue: #1c6bec;
  --indigo: #3a22ee;
  --yellow: #ffd23f;
  --red: #ff2d55;
  --gradient: linear-gradient(120deg, var(--cyan) 0%, var(--blue) 50%, var(--indigo) 100%);
  --gradient-soft: linear-gradient(120deg, rgba(63, 211, 247, .14), rgba(58, 34, 238, .14));

  /* Light theme (default) */
  --bg: #f5f7fc;
  --surface: #ffffff;
  --surface-2: #eef1fa;
  --text: #0e1030;
  --text-muted: #565b78;
  --border: #e1e5f2;
  --link: #1657c9;
  --link-hover: #3a22ee;
  --shadow-sm: 0 1px 2px rgba(14, 16, 48, .06), 0 2px 8px rgba(14, 16, 48, .05);
  --shadow-md: 0 8px 30px rgba(14, 16, 48, .10);
  --shadow-glow: 0 10px 40px rgba(28, 107, 236, .25);

  /* Typography */
  --font-head: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Sizing */
  --container: 1180px;
  --prose: 720px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

/* Dark theme: follows the device setting, unless the visitor picked a theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07062a;
    --surface: #0f0e3c;
    --surface-2: #16154a;
    --text: #eceeff;
    --text-muted: #a6abd3;
    --border: rgba(255, 255, 255, .09);
    --link: #6fd9fa;
    --link-hover: #a9e9ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07062a;
  --surface: #0f0e3c;
  --surface-2: #16154a;
  --text: #eceeff;
  --text-muted: #a6abd3;
  --border: rgba(255, 255, 255, .09);
  --link: #6fd9fa;
  --link-hover: #a9e9ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* 2. BASE ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); font-weight: 700; }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); font-weight: 600; }
p { margin: 0 0 1.1em; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s var(--ease); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(63, 211, 247, .35); }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 1000;
  background: var(--yellow); color: #111; padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 3. LAYOUT & BUTTONS ===================================================== */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(48px, 7vw, 88px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--text-muted); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--blue);
}
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 3px; background: var(--gradient); }
.nowrap { white-space: nowrap; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-head); font-weight: 600; font-size: .95rem; line-height: 1;
  background: var(--btn-bg); color: var(--btn-fg); text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); color: var(--btn-fg); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { --btn-fg: #fff; background: var(--gradient); background-size: 160% 100%; box-shadow: 0 6px 20px rgba(28, 107, 236, .3); }
.btn-primary:hover { background-position: 100% 0; box-shadow: var(--shadow-glow); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--blue); }
.btn-light { --btn-bg: rgba(255, 255, 255, .08); --btn-fg: #fff; border-color: rgba(255, 255, 255, .22); }
.btn-light:hover { --btn-bg: rgba(255, 255, 255, .16); }
.btn-youtube { --btn-bg: var(--red); --btn-fg: #fff; }
.btn-youtube:hover { box-shadow: 0 8px 26px rgba(255, 45, 85, .35); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: .85rem; }

/* 4. HEADER =============================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6, 5, 49, .92);
  -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.brand-logo { width: 36px; height: 36px; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: 1.12rem; letter-spacing: -.01em; white-space: nowrap; }
.brand-name span { font-weight: 400; opacity: .7; }

.main-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  position: relative; display: block; padding: 8px 14px; border-radius: 999px;
  color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.main-nav a[aria-current="page"] { color: #fff; }
.main-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--gradient);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16); background: transparent; color: #fff; cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .header-actions .btn-youtube span { display: none; }
  .header-actions .btn-youtube { padding: 0 12px; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--navy-950); border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding: 12px 20px 20px; transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .25s var(--ease), visibility .2s;
  }
  .main-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .main-nav ul { flex-direction: column; align-items: stretch; }
  .main-nav a { padding: 14px 12px; font-size: 1.05rem; border-radius: var(--radius-sm); }
  .main-nav a[aria-current="page"]::after { left: 12px; right: auto; width: 24px; bottom: 8px; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 1rem; }
  .brand-logo { width: 32px; height: 32px; }
  .header-inner { gap: 10px; }
}

/* 5. HERO ================================================================= */
.hero {
  position: relative; overflow: hidden; color: #fff; isolation: isolate; border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: radial-gradient(1200px 500px at 85% -10%, rgba(58, 34, 238, .55), transparent 60%),
              radial-gradient(800px 400px at -10% 110%, rgba(63, 211, 247, .25), transparent 60%),
              var(--navy-950);
}
.hero::before { /* subtle grid, like a level-select screen */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent);
          mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(32px, 5vw, 64px); padding-block: clamp(56px, 8vw, 104px); }
.hero h1 { color: #fff; margin-bottom: 18px; font-size: clamp(2.2rem, 4.2vw, 3.2rem); text-wrap: balance; }
.hero .eyebrow { color: var(--yellow); }
.hero .eyebrow::before { background: var(--yellow); }
.hero-lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: rgba(255, 255, 255, .78); max-width: 34em; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; padding: 0; list-style: none; }
.hero-tags li {
  font-size: .8rem; font-weight: 500; color: rgba(255, 255, 255, .7);
  padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04);
}

/* Handheld console illustration — the latest article lives on its "screen" */
.handheld {
  position: relative; display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; gap: 16px;
  padding: 22px 20px; border-radius: 46px;
  background: linear-gradient(160deg, #1b1a5e, #0c0b3d 70%);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), inset 0 -8px 20px rgba(0, 0, 0, .35), 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 6px rgba(255, 255, 255, .02);
  transform: rotate(-2deg);
  transition: transform .5s var(--ease);
  color: #fff; text-decoration: none;
}
.handheld:hover { transform: rotate(0) translateY(-4px); color: #fff; }
.handheld-screen {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: #000; border: 6px solid #05041f; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 0 40px rgba(63, 211, 247, .25);
}
.handheld-screen img { width: 100%; height: 100%; object-fit: cover; }
.handheld-screen::after { /* screen glare */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), transparent 40%);
  pointer-events: none;
}
.screen-label {
  position: absolute; left: 10px; top: 10px; z-index: 1;
  font-family: var(--font-head); font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: var(--yellow); color: #111; padding: 4px 8px; border-radius: 6px;
}
.dpad { position: relative; width: 62px; height: 62px; justify-self: center; }
.dpad::before, .dpad::after {
  content: ""; position: absolute; background: #07062b; border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 2px 4px rgba(0, 0, 0, .5);
}
.dpad::before { left: 21px; top: 0; width: 20px; height: 62px; }
.dpad::after { top: 21px; left: 0; width: 62px; height: 20px; }
.abxy { position: relative; width: 66px; height: 66px; justify-self: center; }
.abxy span {
  position: absolute; width: 22px; height: 22px; border-radius: 50%;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), 0 2px 6px rgba(0, 0, 0, .45);
}
.abxy span:nth-child(1) { top: 0; left: 22px; background: var(--cyan); }
.abxy span:nth-child(2) { top: 22px; right: 0; background: var(--indigo); }
.abxy span:nth-child(3) { bottom: 0; left: 22px; background: var(--blue); }
.abxy span:nth-child(4) { top: 22px; left: 0; background: var(--yellow); }
.handheld-caption { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 8px 0; }
.handheld-caption strong { font-family: var(--font-head); font-weight: 600; font-size: .98rem; line-height: 1.35; }
.handheld-caption .arrow {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient); transition: transform .3s var(--ease);
}
.handheld:hover .arrow { transform: translateX(4px); }
.handheld-caption .arrow svg { width: 16px; height: 16px; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .handheld { max-width: 560px; transform: none; }
}
@media (max-width: 520px) {
  .handheld { grid-template-columns: 1fr; padding: 16px; border-radius: 30px; }
  .dpad, .abxy { display: none; }
}

/* 6. CARDS, FEATURED POST, FILTERS ======================================== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 28px; }
.filters[hidden] { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-head); font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
  background: var(--gradient-soft); color: var(--blue); border: 1px solid transparent;
}
[data-theme="dark"] .chip { color: var(--cyan); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip { color: var(--cyan); } }
button.chip { cursor: pointer; background: var(--surface); border-color: var(--border); color: var(--text-muted); font-size: .85rem; padding: 8px 16px; transition: all .2s; }
button.chip:hover { border-color: var(--blue); color: var(--text); }
button.chip[aria-pressed="true"] { background: var(--navy-950); color: #fff; border-color: var(--navy-950); }

.post-featured {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; margin-bottom: 32px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.post-featured:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.post-featured .card-media { aspect-ratio: auto; min-height: 100%; border-radius: 0; }
.post-featured .card-body { padding: clamp(24px, 4vw, 44px); justify-content: center; }
.post-featured .card-title { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.post-featured .card-excerpt { font-size: 1.05rem; -webkit-line-clamp: 4; }
@media (max-width: 820px) { .post-featured { grid-template-columns: 1fr; } .post-featured .card-media { aspect-ratio: 16 / 9; } }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(28, 107, 236, .35); }
.card[hidden] { display: none; }
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy-900); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img, .post-featured:hover .card-media img { transform: scale(1.04); }
.card-media .chip { position: absolute; left: 14px; top: 14px; background: rgba(6, 5, 49, .82); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.card-media.placeholder { /* used when an article has no image yet */
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 20%, rgba(63, 211, 247, .35), transparent 50%), linear-gradient(135deg, var(--navy-900), var(--indigo));
}
.card-media.placeholder img { width: 64px; height: 64px; object-fit: contain; opacity: .9; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 22px 24px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .84rem; color: var(--text-muted); margin-bottom: 10px; }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.card-title { font-size: 1.22rem; margin-bottom: 10px; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card clickable */
.card-excerpt {
  color: var(--text-muted); font-size: .97rem; margin-bottom: 20px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.read-more {
  position: relative; z-index: 2; margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: .9rem; color: var(--link); text-decoration: none;
}
.read-more svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.card:hover .read-more svg, .post-featured:hover .read-more svg { transform: translateX(4px); }
.post-featured .read-more { margin-top: 8px; }
.empty-note { text-align: center; color: var(--text-muted); padding: 32px; border: 1px dashed var(--border); border-radius: var(--radius); }

/* 7. VIDEO STRIP & CTA ==================================================== */
.section-alt { background: var(--surface-2); }
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .video-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .video-grid { grid-template-columns: 1fr; } }
.video-card { color: var(--text); text-decoration: none; }
.video-card:hover { color: var(--text); }
.video-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--navy-900); margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.video-card:hover .video-thumb img { transform: scale(1.05); }
.video-thumb::after {
  content: ""; position: absolute; inset: 0; background: rgba(6, 5, 49, .0); transition: background .3s;
}
.video-card:hover .video-thumb::after { background: rgba(6, 5, 49, .25); }
.play-badge {
  position: absolute; z-index: 1; left: 50%; top: 50%; width: 58px; height: 40px; margin: -20px 0 0 -29px;
  display: grid; place-items: center; border-radius: 12px; background: var(--red); color: #fff;
  opacity: 0; transform: scale(.8); transition: opacity .25s, transform .3s var(--ease);
}
.video-card:hover .play-badge, .video-card:focus-visible .play-badge { opacity: 1; transform: none; }
.play-badge svg { width: 20px; height: 20px; }
.duration { position: absolute; z-index: 1; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .78); color: #fff; font-size: .75rem; font-weight: 600; padding: 2px 6px; border-radius: 5px; }
.video-card h3 { font-size: 1.02rem; line-height: 1.4; margin: 0; }

.cta-band {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px;
  padding: clamp(28px, 4vw, 44px); border-radius: var(--radius-lg); color: #fff;
  background: radial-gradient(600px 240px at 100% 0%, rgba(58, 34, 238, .7), transparent 70%), var(--navy-950);
}
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px; background: var(--gradient); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.cta-band h2 { color: #fff; font-size: clamp(1.3rem, 2.4vw, 1.75rem); margin-bottom: 6px; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, .75); }
.cta-band .cta-logo { width: 88px; height: 88px; padding: 13px; background: radial-gradient(circle closest-side, #fff calc(100% - 1.5px), transparent 100%); }
.cta-band .cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; text-align: left; } .cta-band .cta-logo { width: 72px; height: 72px; padding: 10px; } }

/* 8. FOOTER =============================================================== */
.site-footer { border-top: 1px solid rgba(255, 255, 255, .06); background: var(--navy-950); color: rgba(255, 255, 255, .72); padding: 56px 0 28px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; padding-bottom: 36px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.footer-grid h2 { color: #fff; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: rgba(255, 255, 255, .72); text-decoration: none; }
.footer-grid a:hover { color: #fff; }
.footer-about p { max-width: 32em; margin-top: 14px; font-size: .95rem; }
.footer-grid .socials, .socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding: 0; list-style: none; }
.socials a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, .06); color: #fff; transition: background .2s, transform .2s var(--ease);
}
.socials a:hover { background: var(--blue); transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 22px; font-size: .86rem; }
.footer-bottom a { color: rgba(255, 255, 255, .72); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* 9. ARTICLE ============================================================== */
.progress { position: fixed; top: 0; left: 0; z-index: 200; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--gradient); }

.article-header { padding-block: clamp(32px, 5vw, 56px) 28px; }
.breadcrumbs { font-size: .86rem; color: var(--text-muted); margin-bottom: 22px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--link); }
@media (max-width: 600px) { .breadcrumbs li[aria-current] { display: none; } }
.article-header .chip { margin-bottom: 16px; }
.article-header h1 { max-width: 20em; margin-bottom: 16px; }
.article-dek { font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--text-muted); max-width: 40em; margin-bottom: 24px; }
.byline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .92rem; color: var(--text-muted); }
.byline .avatar { width: 48px; height: 48px; padding: 6px; background: radial-gradient(circle closest-side, #fff calc(100% - 2px), var(--border) calc(100% - 1.5px), var(--border) calc(100% - .5px), transparent 100%); }
.byline strong { color: var(--text); font-weight: 600; display: block; line-height: 1.3; }
.byline .meta-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.byline .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

.article-hero { margin: 0 0 clamp(32px, 5vw, 48px); }
.article-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); background: var(--navy-900); }
.article-hero figcaption { font-size: .9rem; color: var(--text-muted); margin-top: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.article-hero .yt-lite img { border-radius: 0; box-shadow: none; aspect-ratio: auto; }

.article-layout { display: grid; grid-template-columns: minmax(0, var(--prose)) 260px; justify-content: space-between; gap: 56px; }
@media (max-width: 1040px) { .article-layout { grid-template-columns: minmax(0, 1fr); max-width: var(--prose); margin-inline: auto; } .toc { display: none; } }
.toc { position: sticky; top: calc(var(--header-h) + 28px); align-self: start; font-size: .9rem; }
.toc h2 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0 0 24px; padding: 0; border-left: 2px solid var(--border); }
.toc ol a { display: block; padding: 6px 0 6px 16px; margin-left: -2px; border-left: 2px solid transparent; color: var(--text-muted); text-decoration: none; line-height: 1.4; }
.toc ol a:hover { color: var(--text); }
.toc ol a.is-active { color: var(--link); border-left-color: var(--blue); font-weight: 500; }

/* Article body typography */
.prose { font-size: 1.125rem; line-height: 1.8; }
.prose > * + * { margin-top: 0; }
.prose > :first-child { margin-top: 0; }
.prose p { margin-bottom: 1.35em; }
.prose h2 { margin: 2.2em 0 .7em; font-size: clamp(1.45rem, 2.6vw, 1.85rem); }
.prose h3 { margin: 1.8em 0 .55em; }
.prose h2 + h3 { margin-top: 1em; }
.prose a { font-weight: 500; }
.prose strong { font-weight: 650; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.4em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--blue); }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.6em 0; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: var(--radius); }
.prose figcaption { font-size: .88rem; color: var(--text-muted); margin-top: 8px; text-align: center; }
.prose .lead { font-size: clamp(1.15rem, 2vw, 1.25rem); line-height: 1.7; color: var(--text); }
.prose blockquote {
  position: relative; margin: 2em 0; padding: 22px 26px 22px 30px;
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  font-size: 1.12rem; color: var(--text); box-shadow: var(--shadow-sm);
}
.prose blockquote::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--gradient); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite { display: block; margin-top: 10px; font-size: .9rem; font-style: normal; color: var(--text-muted); }
.prose .pullquote {
  margin: 2.2em 0; padding: 0; border: 0; background: none; box-shadow: none; text-align: center;
  font-family: var(--font-head); font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 600; line-height: 1.4;
}
.prose .pullquote::before { position: static; display: block; width: 48px; height: 4px; margin: 0 auto 18px; }
.prose .pullquote p { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.callout {
  margin: 0 0 2.2em; padding: 22px 24px; border-radius: var(--radius);
  background: var(--gradient-soft); border: 1px solid rgba(28, 107, 236, .2);
}
.callout h2, .callout h3 { font-size: 1.05rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.callout ul { margin: 0; padding-left: 1.2em; font-size: 1.02rem; }
.callout li { margin-bottom: .35em; }

/* Click-to-load YouTube embed (no YouTube scripts or cookies until clicked) */
.video-embed { margin: 2.2em 0; }
.yt-lite {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; cursor: pointer;
  border-radius: var(--radius-lg); overflow: hidden; background: #000; box-shadow: var(--shadow-md);
}
.yt-lite img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), opacity .3s; }
.yt-lite:hover img { transform: scale(1.03); opacity: .9; }
.yt-lite .yt-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 76px; height: 54px; border-radius: 16px;
  background: var(--red); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: transform .25s var(--ease);
}
.yt-lite:hover .yt-play { transform: translate(-50%, -50%) scale(1.08); }
.yt-lite .yt-play svg { width: 26px; height: 26px; margin-left: 3px; }
.yt-lite iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed figcaption { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .9rem; color: var(--text-muted); margin-top: 12px; text-align: left; }

.article-footer { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; padding: 0; list-style: none; }
.share { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.share span { font-weight: 600; font-family: var(--font-head); margin-right: 4px; }
.share a, .share button {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: all .2s var(--ease);
}
.share a:hover, .share button:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); }
.share svg { width: 18px; height: 18px; }
.share .copied-msg { font-size: .85rem; color: var(--text-muted); }

.author-box {
  display: grid; grid-template-columns: 80px 1fr; gap: 20px; align-items: start;
  padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); margin-bottom: 36px;
}
.author-box img { width: 80px; height: 80px; padding: 11px; background: radial-gradient(circle closest-side, #fff calc(100% - 2px), var(--border) calc(100% - 1.5px), var(--border) calc(100% - .5px), transparent 100%); }
.author-box h2 { font-size: 1.1rem; margin-bottom: 6px; }
.author-box p { margin-bottom: 12px; color: var(--text-muted); font-size: .98rem; }
@media (max-width: 520px) { .author-box { grid-template-columns: 1fr; } }

.back-home-wrap { display: flex; justify-content: center; padding: 8px 0 0; }
.btn-back { min-height: 54px; padding: 0 30px; font-size: 1rem; }
.btn-back svg { transition: transform .25s var(--ease); }
.btn-back:hover svg { transform: translateX(-4px); }

/* 10. STATIC PAGES ======================================================== */
.page-hero { position: relative; overflow: hidden; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .06); background: radial-gradient(900px 360px at 90% -20%, rgba(58, 34, 238, .55), transparent 60%), var(--navy-950); padding: clamp(48px, 7vw, 84px) 0; }
.page-hero h1 { color: #fff; margin-bottom: 12px; }
.page-hero p { color: rgba(255, 255, 255, .78); font-size: 1.15rem; max-width: 38em; margin: 0; }
.page-hero .eyebrow { color: var(--yellow); }
.page-hero .eyebrow::before { background: var(--yellow); }

.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.side-card { position: sticky; top: calc(var(--header-h) + 24px); padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.side-card img.logo-badge { width: 96px; height: 96px; padding: 13px; background: radial-gradient(circle closest-side, #fff calc(100% - 2px), var(--border) calc(100% - 1.5px), var(--border) calc(100% - .5px), transparent 100%); margin-bottom: 16px; }
.side-card h2 { font-size: 1.2rem; margin-bottom: 8px; }
.side-card p { color: var(--text-muted); font-size: .97rem; }
.side-card .btn { width: 100%; margin-top: 8px; }
.topic-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 16px 0 20px; list-style: none; }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.contact-card {
  display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
a.contact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(28, 107, 236, .35); color: var(--text); }
.contact-card .icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--gradient); color: #fff; }
.contact-card .icon svg { width: 22px; height: 22px; }
.contact-card h2 { font-size: 1.1rem; margin: 6px 0 0; }
.contact-card p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.contact-card .handle { font-weight: 600; color: var(--link); word-break: break-word; }
.note { margin-top: 32px; padding: 20px 24px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-muted); font-size: .97rem; }

.not-found { text-align: center; padding-block: clamp(64px, 12vw, 140px); }
.not-found .code { font-family: var(--font-head); font-weight: 700; font-size: clamp(5rem, 16vw, 9rem); line-height: 1; margin-bottom: 8px; }
.not-found p { color: var(--text-muted); max-width: 30em; margin: 0 auto 28px; }

/* Layout wrapper so footer sits at bottom on short pages */
.page { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* 11. MOTION & PRINT ====================================================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .handheld { transform: none; }
}

@media print {
  .site-header, .site-footer, .share, .toc, .progress, .back-home-wrap, .cta-band, .video-embed { display: none !important; }
  body { background: #fff; color: #000; }
  .article-layout { display: block; }
  .prose a::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}

/* More articles heading + related articles on article pages */
.subhead { font-size: 1.15rem; margin: 8px 0 18px; color: var(--text-muted); font-weight: 600; letter-spacing: .01em; }
.related { margin: 8px 0 40px; }
.related > h2 { font-size: 1.3rem; margin-bottom: 18px; }
.related .post-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.related .card-title { font-size: 1.08rem; }
.prose .related .card-title a, .prose .related .read-more { font-weight: 600; }
.prose .related p { margin-bottom: 16px; }
.prose .tags { padding-left: 0; }
.prose .related .card-title { margin: 0 0 10px; font-size: 1.08rem; }
.prose .related .card-excerpt { font-size: .95rem; line-height: 1.6; }

/* Tables inside articles (e.g. scorecards, comparisons) */
.table-wrap { margin: 1.8em 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: .98rem; line-height: 1.55; }
.prose th, .prose td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.prose thead th { font-family: var(--font-head); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 600; white-space: nowrap; }
@media (max-width: 600px) { .prose th, .prose td { padding: 12px; } .prose td:first-child { white-space: normal; } }
