/* Etherloops Hub — Ghost theme */
:root {
  --bg: #07060d;
  --bg-2: #0e0c18;
  --surface: #14111f;
  --surface-2: #1b1729;
  --line: rgba(255,255,255,.08);
  --text: #ece9f5;
  --muted: #9a94ad;
  --violet: #a259ff;
  --pink: #ff3d9a;
  --teal: #34d6c8;
  --grad: linear-gradient(120deg, var(--violet), var(--pink));
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1180px;
  --narrow: 740px;
  --font: var(--gh-font-body, 'Inter'), system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: var(--gh-font-heading, 'Space Grotesk'), 'Inter', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
code { font-size: .9em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: calc(var(--narrow) + 48px); }
.container.wide { max-width: calc(1100px + 48px); }
.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .8em 1.4em; border-radius: 999px; border: 0; background: var(--grad); color: #fff; font: 600 15px/1 var(--font); cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s; box-shadow: 0 6px 24px -8px rgba(255,61,154,.55); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -8px rgba(162,89,255,.7); }
.btn-ghost { background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.btn-ghost:hover { background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.24); }
.btn-sm { padding: .6em 1.1em; font-size: 14px; }
.icon-btn { background: none; border: 0; color: var(--text); padding: 8px; cursor: pointer; border-radius: 8px; display: inline-flex; }
.icon-btn:hover { background: rgba(255,255,255,.06); }
.link-quiet { font-size: 14px; color: var(--muted); }
.link-quiet:hover { color: var(--text); }
.link-more { color: var(--muted); font-size: 15px; white-space: nowrap; }
.link-more:hover { color: var(--text); }
.eyebrow { display: inline-block; font: 600 12px/1.4 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: .9em; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(7,6,13,.6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s, background .2s; }
.site-header.scrolled { border-bottom-color: var(--line); background: rgba(7,6,13,.85); }
.header-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 20px/1 var(--display); }
.brand-logo { max-height: 34px; width: auto; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(from 200deg, var(--violet), var(--pink), var(--teal), var(--violet)); box-shadow: 0 0 18px rgba(162,89,255,.6); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--bg); }
.brand-text b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.main-nav { flex: 1; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav .nav a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 15px; color: var(--muted); transition: color .15s, background .15s; }
.main-nav .nav a:hover, .main-nav .nav-current a { color: var(--text); background: rgba(255,255,255,.05); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; width: 38px; height: 38px; flex-direction: column; justify-content: center; gap: 6px; }
.menu-toggle span { display: block; height: 2px; width: 20px; background: currentColor; border-radius: 2px; transition: transform .2s; margin: 0 auto; }
.menu-open .menu-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-open .menu-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Aurora background */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; mix-blend-mode: screen; animation: drift 22s ease-in-out infinite alternate; }
.aurora .a1 { width: 52vw; height: 52vw; max-width: 720px; max-height: 720px; left: -10%; top: -30%; background: radial-gradient(circle, #6d28d9 0%, transparent 65%); }
.aurora .a2 { width: 46vw; height: 46vw; max-width: 640px; max-height: 640px; right: -8%; top: -10%; background: radial-gradient(circle, #db2777 0%, transparent 65%); animation-duration: 28s; animation-delay: -6s; }
.aurora .a3 { width: 40vw; height: 40vw; max-width: 560px; max-height: 560px; left: 30%; bottom: -45%; background: radial-gradient(circle, #0e7490 0%, transparent 65%); animation-duration: 34s; animation-delay: -12s; }
@keyframes drift { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(6%, 8%) scale(1.12); } 100% { transform: translate(-6%, 2%) scale(.94); } }
@media (prefers-reduced-motion: reduce) { .aurora span { animation: none; } html { scroll-behavior: auto; } }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 120px 0 110px; border-bottom: 1px solid var(--line); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 60%, var(--bg)); z-index: 0; }
.hero-inner { position: relative; z-index: 1; max-width: 860px; text-align: center; }
.hero-title { font-size: clamp(38px, 6vw, 68px); font-weight: 700; margin-bottom: .35em; }
.hero-sub { font-size: clamp(17px, 2vw, 20px); color: #cfc9e0; max-width: 640px; margin: 0 auto 2em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero-sm { padding: 90px 0 70px; }
.hero-form { max-width: 480px; margin: 0 auto; }

/* Sections */
.section { padding: 72px 0 0; }
.section:last-child { padding-bottom: 96px; }
.section-tight { padding-top: 24px; padding-bottom: 96px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head.spaced { margin-top: 64px; }
.section-title { font-size: clamp(26px, 3vw, 34px); margin: 0; }
.lead { font-size: 19px; }
.empty { color: var(--muted); border: 1px dashed var(--line); padding: 24px; border-radius: var(--radius); }
.page-head { padding: 80px 0 24px; }
.page-title { font-size: clamp(36px, 5vw, 56px); }

/* Grids */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Post card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); border-color: rgba(162,89,255,.45); }
.card-link { display: flex; flex-direction: column; height: 100%; }
.card-media { aspect-ratio: 16/9; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-placeholder { width: 100%; height: 100%; min-height: 100%; aspect-ratio: inherit; background: radial-gradient(circle at 20% 30%, rgba(109,40,217,.7), transparent 55%), radial-gradient(circle at 80% 70%, rgba(219,39,119,.55), transparent 55%), var(--surface-2); }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card-body .eyebrow { margin-bottom: .6em; font-size: 11px; }
.card-title { font-size: 19px; margin-bottom: .5em; }
.card-excerpt { color: var(--muted); font-size: 15px; line-height: 1.55; flex: 1; }
.card-meta { font-size: 13px; }

/* Product card */
.product { position: relative; border-radius: var(--radius); background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(140deg, rgba(162,89,255,.5), rgba(255,255,255,.04) 40%, rgba(255,61,154,.4)) border-box; border: 1px solid transparent; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.product:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -20px rgba(162,89,255,.55); }
.product-link { display: flex; flex-direction: column; height: 100%; }
.product-media { position: relative; aspect-ratio: 1/1; overflow: hidden; background: var(--surface-2); }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 12px; left: 12px; font: 600 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; background: rgba(7,6,13,.75); backdrop-filter: blur(6px); }
.badge-free { background: var(--teal); color: #04201d; }
.product-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.product-title { font-size: 18px; margin-bottom: .4em; }
.product-excerpt { color: var(--muted); font-size: 14.5px; line-height: 1.5; flex: 1; }
.product-cta { font-weight: 600; font-size: 14px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Free band */
.band { position: relative; overflow: hidden; margin-top: 88px; padding: 80px 0; background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.band .section-title { margin-bottom: .4em; }
.free-list { list-style: none; padding: 0; margin: 0 0 1.6em; display: grid; gap: 8px; }
.free-list a { display: flex; align-items: center; gap: 10px; }
.free-list a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); flex: none; }
.free-list a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.band-form, .cta-box { background: rgba(20,17,31,.8); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 20px; padding: 32px; }
.band-form h3, .cta-box h3 { font-size: 24px; }
.cta-box { text-align: center; }
.cta-box .subscribe-form { max-width: 460px; margin: 0 auto; }

/* Subscribe form */
.subscribe-form { display: flex; flex-wrap: wrap; gap: 8px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); padding: 6px; border-radius: 999px; }
.subscribe-input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: 400 16px var(--font); padding: 0 14px; outline: none; }
.subscribe-input::placeholder { color: var(--muted); }
.subscribe-form .btn-loading, .subscribe-form .form-msg { display: none; }
.subscribe-form.loading .btn-label { display: none; }
.subscribe-form.loading .btn-loading { display: inline; }
.form-msg { flex-basis: 100%; margin: 6px 14px 4px; font-size: 14px; }
.subscribe-form.success .form-success { display: block; color: var(--teal); }
.subscribe-form.error .form-error { display: block; color: #ff7a9c; }

/* Article */
.article-head { padding-top: 72px; padding-bottom: 8px; }
.article-head .eyebrow:hover { color: #fff; }
.article-title { font-size: clamp(32px, 4.6vw, 50px); }
.article-meta { font-size: 14px; }
.article-image { margin: 32px auto 8px; }
.article-image img { width: 100%; border-radius: var(--radius); }
.article-image figcaption { text-align: center; font-size: 14px; color: var(--muted); margin-top: 10px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip { display: inline-flex; gap: 6px; padding: 6px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.chip:hover { border-color: rgba(162,89,255,.6); }
.comments { padding-top: 48px; }

/* Ghost content */
.gh-content { padding-top: 32px; font-size: 18px; line-height: 1.75; }
.gh-content > * + * { margin-top: 1.25em; }
.gh-content p, .gh-content ul, .gh-content ol { margin-bottom: 0; color: #dcd8e8; }
.gh-content h2 { font-size: 30px; margin-top: 1.8em; }
.gh-content h3 { font-size: 23px; margin-top: 1.6em; }
.gh-content a { color: #fff; text-decoration: underline; text-decoration-color: var(--pink); text-underline-offset: 3px; }
.gh-content a:hover { text-decoration-color: var(--violet); }
.gh-content blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--violet); font-style: italic; color: #cfc9e0; }
.gh-content img, .gh-content video { border-radius: var(--radius-sm); }
.gh-content figcaption { text-align: center; font-size: 14px; color: var(--muted); margin-top: 10px; }
.gh-content hr { border: 0; height: 1px; background: var(--line); margin: 2.5em 0; }
.gh-content pre { background: var(--surface); border: 1px solid var(--line); padding: 18px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 14px; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.gh-content th, .gh-content td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; }
.gh-content .kg-width-wide { position: relative; width: min(1100px, 92vw); left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full img { border-radius: 0; }
.gh-content .kg-button-card a.kg-btn, .gh-content .kg-btn-accent { background: var(--grad) !important; color: #fff !important; text-decoration: none; border-radius: 999px; font-weight: 600; }
.gh-content .kg-callout-card { border-radius: var(--radius-sm); }
.gh-content .kg-bookmark-card a.kg-bookmark-container { text-decoration: none; background: var(--surface); color: var(--text); border-color: var(--line); }
.gh-content .kg-product-card-container { background: var(--surface); border-color: var(--line); color: var(--text); }
.gh-content .kg-toggle-card, .gh-content .kg-header-card { border-radius: var(--radius-sm); }
.gh-content iframe { max-width: 100%; border-radius: var(--radius-sm); }

/* Product page */
.product-hero { position: relative; overflow: hidden; padding: 72px 0; border-bottom: 1px solid var(--line); }
.product-hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: center; }
.product-hero-media { border-radius: 20px; overflow: hidden; aspect-ratio: 1/1; box-shadow: 0 30px 80px -30px rgba(162,89,255,.6); border: 1px solid var(--line); }
.product-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.product-hero-copy .hero-actions { justify-content: flex-start; margin-top: 1.5em; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 48px; font-size: 14px; }

/* Footer */
.site-footer { margin-top: 96px; border-top: 1px solid var(--line); padding: 56px 0 32px; background: var(--bg-2); }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand p { max-width: 360px; margin-top: 14px; font-size: 15px; }
.footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-links .nav { flex-direction: column; gap: 8px; font-size: 15px; color: var(--muted); }
.footer-links .nav a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }

/* Error */
.error-page { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.error-page > *:not(.aurora) { position: relative; z-index: 1; }

/* Responsive */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .band-inner, .product-hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .product-hero-media { max-width: 420px; }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .main-nav { position: fixed; inset: 68px 0 auto 0; background: rgba(7,6,13,.97); border-bottom: 1px solid var(--line); padding: 12px 16px 20px; transform: translateY(-120%); transition: transform .25s; z-index: -1; }
  .menu-open .main-nav { transform: translateY(0); }
  .main-nav .nav { flex-direction: column; }
  .main-nav .nav a { font-size: 17px; padding: 12px; }
  .header-inner { justify-content: space-between; }
  .hide-sm { display: none; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 80px 0 72px; }
  .section { padding-top: 56px; }
  .section-head { flex-direction: column; gap: 6px; }
  .band { padding: 56px 0; }
  .band-form, .cta-box { padding: 22px; }
  .subscribe-form { border-radius: 16px; }
  .subscribe-form .btn { width: 100%; }
  .subscribe-input { padding: 12px 14px; flex-basis: 100%; }
  .gh-content { font-size: 17px; }
}
