/* ============================================================
   Vibe Blog — styles
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #0c0b13;
  --bg-soft: #121020;
  --card: rgba(255, 255, 255, 0.035);
  --card-solid: #16142a;
  --text: #efedff;
  --text-soft: #b7b2d4;
  --muted: #8f89ad;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --header-bg: rgba(12, 11, 19, 0.72);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --glow: 0 12px 40px rgba(124, 58, 237, 0.35);
  --radius: 22px;
  --grad: linear-gradient(135deg, #8b5cf6, #6366f1 45%, #22d3ee);
  --font-display: "Fraunces", "Georgia", "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #faf8f5;
  --bg-soft: #f1ede8;
  --card: #ffffff;
  --card-solid: #ffffff;
  --text: #221c33;
  --text-soft: #4a4263;
  --muted: #6f678c;
  --border: rgba(34, 28, 51, 0.1);
  --border-strong: rgba(34, 28, 51, 0.2);
  --header-bg: rgba(250, 248, 245, 0.78);
  --shadow: 0 18px 50px rgba(60, 40, 120, 0.12);
  --glow: 0 12px 40px rgba(124, 58, 237, 0.2);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container {
  width: min(1140px, 92vw);
  margin-inline: auto;
}

.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; position: relative; }

/* ---------- Typography ---------- */
h1, h2, h3, blockquote {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  font-weight: 560;
}

h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }

h3 {
  font-size: 1.28rem;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 1rem;
}

.lead {
  font-size: clamp(1.08rem, 1.7vw, 1.28rem);
  color: var(--text-soft);
  max-width: 38rem;
}

.muted { color: var(--muted); font-size: 0.92rem; }
.muted strong { color: var(--text-soft); font-weight: 600; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.92rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 55px rgba(124, 58, 237, 0.5);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--card);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.btn-small { padding: 0.62rem 1.25rem; font-size: 0.9rem; }

.link-arrow {
  font-weight: 600;
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: gap 0.25s ease;
}

.link-arrow:hover { gap: 0.8rem; }

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---------- Progress bar ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--grad);
  z-index: 300;
  border-radius: 0 3px 3px 0;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 76px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.logo-dot { color: var(--accent-2); }

.nav {
  display: flex;
  gap: 1.9rem;
  margin-left: auto;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.25s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--grad);
  border-radius: 2px;
  transition: width 0.25s ease;
}

.nav a:hover { color: var(--text); }
.nav a:hover::after { width: 100%; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px; height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.burger span {
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(9rem, 16vw, 12.5rem) 0 clamp(4.5rem, 8vw, 7rem);
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero h1 { max-width: 15ch; }

.hero .lead { margin-top: 1.5rem; }

.hero-actions {
  display: flex;
  gap: 0.95rem;
  margin-top: 2.35rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-stats {
  display: flex;
  gap: clamp(1.6rem, 5vw, 3.6rem);
  margin-top: 3.6rem;
  padding-top: 2.1rem;
  border-top: 1px solid var(--border);
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hero-stats strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
}

.hero-stats span {
  font-size: 0.88rem;
  color: var(--muted);
}

/* Orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  pointer-events: none;
  animation: float 11s ease-in-out infinite;
}

[data-theme="light"] .orb { opacity: 0.32; }

.orb-1 { width: 440px; height: 440px; background: #7c3aed; top: -140px; left: -110px; }
.orb-2 { width: 400px; height: 400px; background: #06b6d4; top: -40px; right: -120px; animation-delay: -3.5s; }
.orb-3 { width: 320px; height: 320px; background: #ec4899; bottom: -170px; left: 32%; animation-delay: -7s; }
.orb-4 { width: 380px; height: 380px; background: #8b5cf6; top: 10%; right: -140px; opacity: 0.28; }

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -22px, 0) scale(1.05); }
}

/* ---------- Section head ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

/* ---------- Cards grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  backdrop-filter: blur(10px);
}

[data-theme="light"] .card { background: var(--card-solid); }

.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  display: block;
  overflow: hidden;
  transition: filter 0.35s ease;
}

.card:hover .thumb { filter: saturate(1.15); }

.thumb::before {
  content: "";
  position: absolute;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 32% 68% 62% 38% / 42% 38% 62% 58%;
  background: rgba(255, 255, 255, 0.16);
  top: -18%;
  right: -12%;
  transition: transform 0.5s ease;
}

.card:hover .thumb::before { transform: rotate(18deg) scale(1.08); }

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.28), transparent 52%);
}

.thumb-glyph {
  position: absolute;
  left: 1.15rem;
  bottom: 0.85rem;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 2.65rem;
  font-weight: 600;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.03em;
  text-shadow: 0 6px 26px rgba(0, 0, 0, 0.28);
}

.thumb-a { background: linear-gradient(135deg, #7c3aed, #312e81); }
.thumb-b { background: linear-gradient(135deg, #f59e0b, #b45309 55%, #7c2d12); }
.thumb-c { background: linear-gradient(135deg, #06b6d4, #1e3a8a); }
.thumb-d { background: linear-gradient(135deg, #ec4899, #7c3aed); }
.thumb-e { background: linear-gradient(135deg, #10b981, #065f46 60%, #022c22); }
.thumb-f { background: linear-gradient(135deg, #6366f1, #22d3ee); }

.card-body {
  padding: 1.35rem 1.45rem 1.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.card h3 a { transition: color 0.25s ease; }
.card h3 a:hover { color: var(--accent-2); }

.card p {
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.author {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.av-1 { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.av-2 { background: linear-gradient(135deg, #f59e0b, #f43f5e); }
.av-3 { background: linear-gradient(135deg, #06b6d4, #6366f1); }

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.78rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: var(--card);
}

.chip-design  { color: #a78bfa; border-color: rgba(167, 139, 250, 0.4); }
.chip-mind    { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.chip-tech    { color: #22d3ee; border-color: rgba(34, 211, 238, 0.4); }
.chip-create  { color: #f472b6; border-color: rgba(244, 114, 182, 0.4); }
.chip-travel  { color: #34d399; border-color: rgba(52, 211, 153, 0.4); }
.chip-process { color: #818cf8; border-color: rgba(129, 140, 248, 0.4); }

[data-theme="light"] .chip-design  { color: #6d28d9; border-color: rgba(109, 40, 217, 0.35); }
[data-theme="light"] .chip-mind    { color: #b45309; border-color: rgba(180, 83, 9, 0.35); }
[data-theme="light"] .chip-tech    { color: #0e7490; border-color: rgba(14, 116, 144, 0.35); }
[data-theme="light"] .chip-create  { color: #be185d; border-color: rgba(190, 24, 93, 0.35); }
[data-theme="light"] .chip-travel  { color: #047857; border-color: rgba(4, 120, 87, 0.35); }
[data-theme="light"] .chip-process { color: #4338ca; border-color: rgba(67, 56, 202, 0.35); }

/* ---------- Topics ---------- */
.topics { padding-top: 0; }

.topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.topic {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.82rem 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.topic:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--glow);
}

.topic-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.d-1 { background: #a78bfa; }
.d-2 { background: #fbbf24; }
.d-3 { background: #22d3ee; }
.d-4 { background: #f472b6; }
.d-5 { background: #34d399; }
.d-6 { background: #818cf8; }

/* ---------- Manifesto ---------- */
.manifesto {
  overflow: hidden;
}

.manifesto-inner {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  text-align: center;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.manifesto blockquote {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.25;
  margin: 0.4rem 0 1.75rem;
}

.manifesto blockquote em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.manifesto-text {
  color: var(--text-soft);
  font-size: 1.08rem;
  max-width: 36rem;
}

.manifesto-sign {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 2.1rem;
  text-align: left;
  font-size: 0.95rem;
}

/* ---------- Newsletter ---------- */
.news-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.8rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(2.1rem, 5vw, 3.5rem);
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(139, 92, 246, 0.16), transparent 55%),
    radial-gradient(120% 160% at 100% 100%, rgba(34, 211, 238, 0.14), transparent 55%),
    var(--card-solid);
  box-shadow: var(--shadow);
}

.news-copy h2 { margin-bottom: 0.85rem; }
.news-copy p:last-child { color: var(--muted); }

.news-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.85rem;
}

.news-form input {
  font: inherit;
  padding: 0.95rem 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  min-width: 0;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.news-form input::placeholder { color: var(--muted); }

.news-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.22);
}

.form-note {
  grid-column: 1 / -1;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: clamp(3.2rem, 6vw, 5rem) 0 2.2rem;
  background: var(--bg-soft);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}

.footer-brand p { margin: 1rem 0 1.4rem; max-width: 26rem; }

.socials { display: flex; gap: 0.75rem; }

.socials a {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-soft);
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.socials a:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.footer-col a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.25s ease;
  width: fit-content;
}

.footer-col a:hover { color: var(--accent-2); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.footer-legal { display: flex; gap: 1.4rem; }

.footer-legal a {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.25s ease;
}

.footer-legal a:hover { color: var(--text); }

/* ---------- To top & toast ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 150;
}

.to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 130%);
  background: var(--card-solid);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 0.95rem 1.6rem;
  border-radius: 16px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 250;
  max-width: min(92vw, 26rem);
  text-align: center;
}

.toast.show { transform: translate(-50%, 0); }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 404 page bits ---------- */
.notfound {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}

.notfound .big {
  font-family: var(--font-display);
  font-size: clamp(5rem, 16vw, 9rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .news-card { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav {
    position: fixed;
    top: 76px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 4vw 1.1rem;
    display: none;
  }

  .nav.open { display: flex; }

  .nav a {
    padding: 0.95rem 0.4rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
  }

  .nav a:last-child { border-bottom: 0; }
  .nav a::after { display: none; }

  .burger { display: inline-flex; }
  .header-cta { display: none; }
  .header-actions { margin-left: auto; }
}

@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.9rem; }
  .news-form { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .section-head { flex-direction: column; align-items: flex-start; }
}

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