/* ============================================================
   VIBEMAP ONLINE — SHARED DESIGN SYSTEM
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */

:root {
  --color-charcoal: #121212;
  --color-ecru: #F9F7F2;
  --color-indigo: #5D5FEF;
  --color-clay: #E27D60;
  --color-dark: #0B0E14;
  --color-indigo-bright: #7B7DFF;

  /* Semantic — light mode */
  --bg: var(--color-ecru);
  --bg-surface: #EDE9E0;
  --bg-subtle: #F4F1EA;
  --text: var(--color-charcoal);
  --text-2: rgba(18, 18, 18, 0.58);
  --text-3: rgba(18, 18, 18, 0.36);
  --accent: var(--color-indigo);
  --accent-warm: var(--color-clay);
  --border: rgba(18, 18, 18, 0.09);
  --border-2: rgba(18, 18, 18, 0.16);
  --topo: rgba(18, 18, 18, 0.07);
  --nav-bg: rgba(249, 247, 242, 0.88);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.07);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.10);

  /* Fonts */
  --f-display: 'Fraunces', Georgia, serif;
  --f-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Easing */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: var(--color-dark);
  --bg-surface: #111720;
  --bg-subtle: #0e1219;
  --text: var(--color-ecru);
  --text-2: rgba(249, 247, 242, 0.58);
  --text-3: rgba(249, 247, 242, 0.30);
  --accent: var(--color-indigo-bright);
  --accent-warm: var(--color-clay);
  --border: rgba(249, 247, 242, 0.08);
  --border-2: rgba(249, 247, 242, 0.14);
  --topo: rgba(249, 247, 242, 0.055);
  --nav-bg: rgba(11, 14, 20, 0.90);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.35);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.50);
}

/* ============================================================
   RESET
   ============================================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--f-body);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  transition: background-color 0.45s var(--ease-in-out), color 0.45s var(--ease-in-out);
  overflow-x: hidden;
  animation: pageReveal 0.5s var(--ease-out) both;
}

@keyframes pageReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul, ol { list-style: none; }

/* ============================================================
   NAVIGATION
   ============================================================ */

.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 9000;
  background: var(--nav-bg);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background 0.45s var(--ease-in-out), border-color 0.45s var(--ease-in-out);
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}
.nav-logo:hover { opacity: 0.75; }

.nav-logo__mark {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.04em;
  color: var(--text);
  font-optical-sizing: auto;
}

.nav-logo__signal {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-left: 3px;
  margin-bottom: 8px;
  animation: signalPulse 3s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes signalPulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(93,95,239,0.4); }
  50% { opacity: 0.6; transform: scale(0.75); box-shadow: 0 0 0 4px rgba(93,95,239,0); }
}

[data-theme="dark"] .nav-logo__signal {
  animation: signalPulseDark 3s ease-in-out infinite;
}

@keyframes signalPulseDark {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px 2px rgba(123,125,255,0.35); }
  50% { opacity: 0.5; transform: scale(0.75); box-shadow: 0 0 0 0 rgba(123,125,255,0); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  margin-left: auto;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-2);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.22s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: 2rem;
}

.theme-toggle {
  width: 44px;
  height: 23px;
  background: var(--border-2);
  border: 1.5px solid var(--border-2);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: background 0.3s ease, border-color 0.3s ease;
  flex-shrink: 0;
  -webkit-appearance: none;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.32s var(--ease-out), background 0.3s ease;
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(21px);
  background: var(--accent);
}
[data-theme="dark"] .theme-toggle {
  background: rgba(123,125,255,0.18);
  border-color: rgba(123,125,255,0.28);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
  margin-left: 1rem;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 0;
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.nav-mobile.is-open { display: flex; }

.nav-mobile a {
  padding: 1rem 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-mobile a:hover { color: var(--text); background: var(--bg-surface); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--reading {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */

.t-display {
  font-family: var(--f-display);
  font-optical-sizing: auto;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.t-xl { font-size: clamp(3.2rem, 8vw, 7.5rem); font-weight: 700; }
.t-lg { font-size: clamp(2.4rem, 5vw, 5rem); font-weight: 700; }
.t-md { font-size: clamp(1.9rem, 3.5vw, 3.2rem); font-weight: 700; }
.t-sm { font-size: clamp(1.4rem, 2.5vw, 2.1rem); font-weight: 600; }

.t-label {
  font-family: var(--f-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}

.t-body {
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.75;
  color: var(--text-2);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.8rem 1.6rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  border: none;
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: #4a4cd8;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(93,95,239,0.38);
}
[data-theme="dark"] .btn--primary:hover {
  background: #6a6cff;
  box-shadow: 0 8px 28px rgba(123,125,255,0.4);
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-2);
}
.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-2);
  padding: 0.5rem 0;
  font-size: 0.8rem;
}
.btn--ghost:hover { color: var(--accent); }

.btn--arrow::after {
  content: '→';
  display: inline-block;
  transition: transform 0.25s var(--ease-out);
}
.btn--arrow:hover::after { transform: translateX(4px); }

/* ============================================================
   TAGS
   ============================================================ */

.tag {
  display: inline-block;
  font-family: var(--f-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border-radius: 1px;
  border: 1px solid var(--border);
  color: var(--text-3);
}
.tag--indigo {
  border-color: rgba(93,95,239,0.3);
  color: var(--accent);
  background: rgba(93,95,239,0.05);
}
.tag--clay {
  border-color: rgba(226,125,96,0.35);
  color: var(--accent-warm);
  background: rgba(226,125,96,0.06);
}

/* ============================================================
   TOPOGRAPHIC DECORATIVE ELEMENTS
   ============================================================ */

.topo-field {
  position: absolute;
  pointer-events: none;
  user-select: none;
  color: var(--topo);
  overflow: visible;
}

/* ============================================================
   ZONE SYSTEM
   ============================================================ */

.zone {
  position: relative;
  overflow: hidden;
  transition: background 0.5s ease;
}

.zone--indigo {
  background:
    radial-gradient(ellipse at 85% 15%, rgba(93,95,239,0.09) 0%, transparent 60%),
    radial-gradient(ellipse at 15% 85%, rgba(93,95,239,0.055) 0%, transparent 55%);
}

.zone--clay {
  background:
    radial-gradient(ellipse at 15% 20%, rgba(226,125,96,0.11) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(226,125,96,0.07) 0%, transparent 50%);
}

.zone--mixed {
  background:
    radial-gradient(ellipse at 10% 50%, rgba(93,95,239,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 50%, rgba(226,125,96,0.08) 0%, transparent 55%);
}

.zone--dark {
  background: var(--bg-surface);
}

/* ============================================================
   DIVIDER
   ============================================================ */

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 5rem 0 2.5rem;
  margin-top: 4rem;
  transition: background 0.45s ease, border-color 0.45s ease;
}

.footer-grid {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 4rem;
}

.footer-brand__name {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 0.75rem;
  font-optical-sizing: auto;
}

.footer-brand__desc {
  font-size: 0.85rem;
  color: var(--text-3);
  line-height: 1.65;
  max-width: 260px;
}

.footer-col__title {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.2rem;
}

.footer-col__links {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.footer-col__links a {
  font-size: 0.88rem;
  color: var(--text-2);
  transition: color 0.2s ease;
  letter-spacing: 0.01em;
}
.footer-col__links a:hover { color: var(--accent); }

.footer-bottom {
  max-width: 1440px;
  margin: 3rem auto 0;
  padding: 1.75rem 2rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-bottom__copy {
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.footer-bottom__signal {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.footer-bottom__signal::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: signalPulse 3s ease-in-out infinite;
}

/* ============================================================
   ARTICLE READING STYLES
   ============================================================ */

.article-content {
  font-family: var(--f-body);
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  line-height: 1.82;
  color: var(--text-2);
}

.article-content h2 {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  font-optical-sizing: auto;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 4.5rem 0 1.5rem;
  line-height: 1.15;
}

.article-content h3 {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 2.2vw, 1.75rem);
  font-weight: 600;
  font-optical-sizing: auto;
  font-style: italic;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 3.5rem 0 1rem;
  line-height: 1.25;
}

.article-content h4 {
  font-family: var(--f-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.8rem 0 0.8rem;
}

.article-content h5 {
  font-family: var(--f-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-3);
  margin: 2.2rem 0 0.6rem;
  letter-spacing: 0.02em;
}

.article-content p {
  margin-bottom: 1.6rem;
}

.article-content p:first-of-type::first-letter {
  font-family: var(--f-display);
  font-size: 4.8em;
  font-weight: 800;
  float: left;
  line-height: 0.72;
  margin-right: 0.1em;
  margin-top: 0.08em;
  color: var(--accent);
  font-optical-sizing: auto;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.anim-up { animation: fadeUp 0.7s var(--ease-out) both; }
.anim-in { animation: fadeIn 0.6s var(--ease-out) both; }
.d1 { animation-delay: 0.08s; }
.d2 { animation-delay: 0.18s; }
.d3 { animation-delay: 0.28s; }
.d4 { animation-delay: 0.38s; }
.d5 { animation-delay: 0.48s; }
.d6 { animation-delay: 0.58s; }

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(93,95,239,0.5);
}
[data-theme="dark"] .progress-bar {
  box-shadow: 0 0 10px rgba(123,125,255,0.6);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .footer-grid .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .container,
  .container--narrow,
  .container--reading { padding: 0 1.25rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .nav-inner { padding: 0 1.25rem; }
}
