/* Noctis blog — mirrors noctis.id (src/styles/global.css + Navbar/Footer/Hero/ClosingCTA) */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }

:root {
  --font-sans: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --gh-font-heading: var(--font-sans);
  --gh-font-body: var(--font-sans);

  --color-base: #000216;
  --color-base-soft: #070b1d;
  --color-ink: #f5f7ff;
  --color-body: #aeb4c7;
  --color-muted: #868ca0;
  --color-accent: #888d9e;
  --color-indigo: #6e8bff;
  --color-indigo-deep: #4d6bf0;

  --line: rgba(255, 255, 255, 0.09);
  --panel: rgba(7, 11, 29, 0.6);
  --container-max: 1200px;
  --container-padding: 24px;
  --radius-card: 16px;
  --content-width: 72ch;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-base);
  color: var(--color-body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { color: var(--color-ink); font-family: var(--font-sans); }

.container-x { max-width: var(--container-max); margin-inline: auto; padding-inline: var(--container-padding); }
.narrow { max-width: calc(var(--content-width) + 2 * var(--container-padding)); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-muted); text-decoration: none;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-indigo); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 139, 255, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(110, 139, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 139, 255, 0); }
}

.btn-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 100px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.01em;
  padding: 11px 22px; transition: all 0.2s ease; cursor: pointer; text-decoration: none;
}
.btn-sm { padding: 8px 16px; }
.btn-light { background: #fff; color: #000216; border: 1px solid #fff; }
.btn-light:hover { background: #e9ecf6; border-color: #e9ecf6; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.22); }
.btn-ghost:hover { background: rgba(110, 139, 255, 0.12); border-color: rgba(110, 139, 255, 0.55); }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100; transform: translateY(-150%);
  background: #fff; color: #000216; font-size: 0.85rem; font-weight: 600;
  padding: 10px 16px; border-radius: 100px; text-decoration: none; transition: transform 0.18s ease;
}
.skip-link:focus { transform: translateY(0); }

a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--color-indigo-deep); outline-offset: 3px; border-radius: 4px;
}

/* ── Navbar ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, backdrop-filter 0.25s ease, border-color 0.25s ease;
}
.navbar.scrolled, .navbar.menu-open {
  background: rgba(0, 2, 22, 0.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.navbar.menu-open { background: rgba(0, 2, 22, 0.95); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo-mark { width: 34px; height: 34px; object-fit: contain; }
.logo-text { color: #fff; font-weight: 600; font-size: 1.1rem; }
.logo-sub { color: var(--color-muted); font-weight: 500; }
.center { flex: 1; display: flex; justify-content: center; }
.center .nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.center .nav a {
  display: block; color: var(--color-body); font-size: 0.8125rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; text-decoration: none; white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
.center .nav a:hover { color: #fff; }
.center .nav-current a { color: #fff; background: rgba(110, 139, 255, 0.12); }
.right { display: flex; align-items: center; gap: 10px; flex: none; }
.menu-toggle { display: none; width: 40px; height: 40px; background: none; border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; cursor: pointer; position: relative; }
.menu-toggle span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: #fff; transition: transform 0.2s ease, top 0.2s ease; }
.menu-toggle span:first-child { top: 15px; }
.menu-toggle span:last-child { top: 23px; }
.menu-open .menu-toggle span:first-child { top: 19px; transform: rotate(45deg); }
.menu-open .menu-toggle span:last-child { top: 19px; transform: rotate(-45deg); }

/* ── Hero ── */
.hero { position: relative; padding: 156px 0 72px; overflow: hidden; }
.hero-sm { padding: 148px 0 40px; }
.glow {
  position: absolute; top: -240px; left: 62%; transform: translateX(-50%);
  width: 820px; height: 620px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(110, 139, 255, 0.2), transparent 70%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 48px; }
.hero .container-x { position: relative; z-index: 1; }
.title {
  font-size: clamp(2.4rem, 5.6vw, 4rem); font-weight: 500; line-height: 1.06; letter-spacing: -0.03em;
  margin: 18px 0 20px;
}
.hero-sm .title { font-size: clamp(2rem, 4.6vw, 3.2rem); }
.accent { display: block; color: var(--color-accent); }
.desc { font-size: 1.05rem; line-height: 1.65; color: var(--color-body); max-width: 520px; margin: 0; }
.author-head { display: flex; align-items: center; gap: 24px; }
.avatar-lg { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }

.hero-figure { width: 100%; max-width: 420px; justify-self: end; overflow: visible; }
.hero-figure .stars circle { fill: #cdd3e6; animation: twinkle 3.6s ease-in-out infinite; }
.hero-figure .stars circle:nth-child(3n) { animation-delay: 1.2s; }
.hero-figure .stars circle:nth-child(3n+1) { animation-delay: 2.4s; }
.orbit { fill: none; stroke: rgba(110, 139, 255, 0.22); stroke-width: 1; transform-origin: 230px 210px; }
.orbit-outer { stroke-dasharray: 2 7; animation: spin 90s linear infinite; }
.orbit-inner { stroke: rgba(110, 139, 255, 0.12); stroke-dasharray: 1 5; animation: spin 60s linear infinite reverse; }
.sats { transform-origin: 230px 210px; animation: spin 120s linear infinite; }
.sats circle { fill: var(--color-base); stroke: rgba(110, 139, 255, 0.7); stroke-width: 1.5; }
.core-ring { fill: none; stroke: rgba(110, 139, 255, 0.55); stroke-width: 1.5; transform-origin: 230px 210px; animation: ring 3.4s ease-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.85; } }
@keyframes ring { 0% { transform: scale(0.85); opacity: 0.7; } 70%, 100% { transform: scale(1.25); opacity: 0; } }

/* ── Feed / cards ── */
.feed { padding: 24px 0 96px; }
.feed.more { padding-top: 0; }
.feed.more .eyebrow { margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--panel);
  overflow: hidden; transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: rgba(110, 139, 255, 0.45); background: rgba(110, 139, 255, 0.06); transform: translateY(-2px); }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--color-base-soft); border-bottom: 1px solid var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-media-empty { display: grid; place-items: center; background: radial-gradient(closest-side, rgba(110, 139, 255, 0.18), transparent 80%), var(--color-base-soft); }
.card-media-empty img { width: 56px; height: 56px; opacity: 0.85; }
.card:hover .card-media-empty img { transform: none; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 1.15rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; margin: 0; }
.card-excerpt { font-size: 0.9rem; line-height: 1.6; margin: 0; color: var(--color-body); }
.card-meta { margin: auto 0 0; padding-top: 8px; display: flex; gap: 8px; font-size: 0.75rem; color: var(--color-muted); letter-spacing: 0.02em; }

/* First post on page 1 of the home feed is the lead story */
.home-template:not(.paged) .grid > .card:first-child { grid-column: 1 / -1; }
.home-template:not(.paged) .grid > .card:first-child .card-link { flex-direction: row; }
.home-template:not(.paged) .grid > .card:first-child .card-media { flex: 0 0 56%; aspect-ratio: 16 / 10; border-bottom: 0; border-right: 1px solid var(--line); }
.home-template:not(.paged) .grid > .card:first-child .card-body { padding: 36px 36px; justify-content: center; }
.home-template:not(.paged) .grid > .card:first-child .card-title { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 500; letter-spacing: -0.02em; }
.home-template:not(.paged) .grid > .card:first-child .card-excerpt { font-size: 1rem; }
.home-template:not(.paged) .grid > .card:first-child .card-meta { margin-top: 12px; }

.empty { color: var(--color-muted); text-align: center; padding: 48px 0; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 48px; font-size: 0.8125rem; color: var(--color-muted); }
.pagination a {
  display: inline-flex; padding: 9px 18px; border-radius: 100px; text-decoration: none; color: #fff; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.22); transition: all 0.2s ease;
}
.pagination a:hover { background: rgba(110, 139, 255, 0.12); border-color: rgba(110, 139, 255, 0.55); }

/* ── Article ── */
.article-head { position: relative; padding: 140px 0 36px; overflow: hidden; }
.article-head .container-x { position: relative; z-index: 1; }
.back { display: inline-block; font-size: 0.8rem; color: var(--color-muted); text-decoration: none; margin-bottom: 28px; transition: color 0.2s ease; }
.back:hover { color: var(--color-indigo); }
.tag-link { display: flex; }
.tag-link:hover { color: var(--color-indigo); }
.article-title { font-size: clamp(2rem, 4.8vw, 3.2rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.025em; margin: 14px 0 16px; }
.article-excerpt { font-size: 1.1rem; line-height: 1.65; color: var(--color-body); margin: 0 0 24px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--color-muted); }
.byline { display: inline-flex; align-items: center; gap: 8px; color: var(--color-ink); text-decoration: none; font-weight: 500; }
.byline:hover { color: var(--color-indigo); }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.article-image { max-width: 1100px; margin: 8px auto 48px; }
.article-image img { width: 100%; border-radius: var(--radius-card); border: 1px solid var(--line); }
.article-image figcaption, .gh-content figcaption { margin-top: 10px; text-align: center; font-size: 0.8rem; color: var(--color-muted); }

/* Content: centered column, Koenig wide/full cards break out */
.gh-content {
  display: grid;
  grid-template-columns: [full-start] minmax(var(--container-padding), 1fr) [wide-start] minmax(0, 160px) [main-start] min(var(--content-width), calc(100% - 2 * var(--container-padding))) [main-end] minmax(0, 160px) [wide-end] minmax(var(--container-padding), 1fr) [full-end];
  padding-bottom: 40px;
  color: var(--color-body); font-size: 1.05rem; line-height: 1.8;
}
.gh-content > * { grid-column: main-start / main-end; margin: 0 0 1.4em; }
.gh-content > .kg-width-wide { grid-column: wide-start / wide-end; }
.gh-content > .kg-width-full { grid-column: full-start / full-end; }
.gh-content > .kg-width-full img { border-radius: 0; border: 0; }
.gh-content h2 { font-size: 1.6rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; margin: 1.8em 0 0.6em; }
.gh-content h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; margin: 1.6em 0 0.5em; }
.gh-content h4 { font-size: 1.05rem; font-weight: 600; margin: 1.4em 0 0.4em; }
.gh-content a { color: var(--color-indigo); text-underline-offset: 3px; }
.gh-content strong { color: var(--color-ink); font-weight: 600; }
.gh-content ul, .gh-content ol { padding-left: 1.3em; }
.gh-content li { margin-bottom: 0.5em; }
.gh-content li::marker { color: var(--color-indigo); }
.gh-content img { border-radius: 12px; }
.gh-content figure img { margin-inline: auto; }
.gh-content hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.gh-content blockquote:not([class]) {
  margin-left: 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--color-indigo);
  color: var(--color-ink); font-size: 1.15rem; font-style: normal;
}
.gh-content blockquote.kg-blockquote-alt { text-align: center; font-size: 1.4rem; color: var(--color-ink); font-style: normal; padding: 0 2em; }
.gh-content code { font-size: 0.88em; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; color: var(--color-ink); }
.gh-content pre { background: var(--color-base-soft); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; overflow-x: auto; font-size: 0.88rem; line-height: 1.65; }
.gh-content pre code { background: none; border: 0; padding: 0; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.gh-content th, .gh-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.gh-content th { color: var(--color-ink); font-weight: 600; }
.gh-content .kg-callout-card { border-radius: 12px; }
.gh-content .kg-bookmark-card a.kg-bookmark-container { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--color-ink); }
.gh-content .kg-bookmark-description, .gh-content .kg-bookmark-metadata { color: var(--color-body); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 72px; }
.tag-pill {
  font-size: 0.78rem; font-weight: 500; color: var(--color-body); text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 100px; padding: 6px 14px; transition: all 0.2s ease;
}
.tag-pill:hover { color: #fff; border-color: rgba(110, 139, 255, 0.55); background: rgba(110, 139, 255, 0.12); }

/* ── Closing CTA ("start here") ── */
.cta-end { padding: 0 0 112px; }
.cta-box {
  position: relative; overflow: hidden; text-align: center;
  border: 1px solid var(--line); border-radius: 24px; background: var(--color-base-soft);
  padding: 72px 24px;
}
.cta-glow {
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 420px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(110, 139, 255, 0.22), transparent 70%);
}
.cta-box > *:not(.cta-glow) { position: relative; }
.cta-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; margin: 16px auto 14px; max-width: 640px; }
.cta-body { max-width: 520px; margin: 0 auto 28px; line-height: 1.65; }
.actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── Footer ── */
.footer { background: var(--color-base); border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 40px; }
.brand { max-width: 320px; }
.flogo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 16px; }
.mark { width: 32px; height: 32px; object-fit: contain; }
.name { color: var(--color-ink); font-weight: 600; font-size: 1.1rem; }
.tagline { color: #e5e7eb; font-size: 0.9rem; font-weight: 500; margin: 0 0 10px; }
.footer .desc { font-size: 0.85rem; line-height: 1.6; margin: 0 0 20px; }
.group h3 { font-size: 0.875rem; font-weight: 600; margin: 0 0 16px; }
.group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.group a { color: var(--color-body); font-size: 0.8125rem; text-decoration: none; transition: color 0.2s ease; }
.group a:hover { color: var(--color-ink); }
.bottom { margin-top: 56px; padding-top: 24px; padding-bottom: 32px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bottom p { color: var(--color-muted); font-size: 0.8125rem; margin: 0; }
.asn { letter-spacing: 0.04em; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-figure { display: none; }
  .glow { left: 50%; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .home-template:not(.paged) .grid > .card:first-child .card-link { flex-direction: column; }
  .home-template:not(.paged) .grid > .card:first-child .card-media { flex: none; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--line); }
  .home-template:not(.paged) .grid > .card:first-child .card-body { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .brand { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 760px) {
  .menu-toggle { display: inline-block; }
  .right .btn-pill { display: none; }
  .center {
    position: absolute; top: 72px; left: 0; right: 0; display: block;
    background: rgba(0, 2, 22, 0.97); backdrop-filter: blur(12px);
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
  }
  .menu-open .center { max-height: 80vh; visibility: visible; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .center .nav { flex-direction: column; padding: 12px var(--container-padding) 20px; }
  .center .nav a { font-size: 0.95rem; padding: 12px; }
}
@media (max-width: 600px) {
  :root { --container-padding: 16px; }
  .hero { padding: 120px 0 48px; }
  .grid { grid-template-columns: 1fr; }
  .article-head { padding-top: 112px; }
  .gh-content { font-size: 1rem; }
  .cta-box { padding: 56px 20px; }
  .actions, .actions .btn-pill { width: 100%; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-figure .stars circle { opacity: 0.5; }
  html { scroll-behavior: auto; }
}
