:root {
  --bg:          #0c0c0f;
  --surface:     #141419;
  --surface-2:   #1c1c25;
  --border:      #252535;
  --text:        #dddde8;
  --text-muted:  #64647a;
  --accent:      #7c7cf8;
  --accent-alt:  #e879a0;
  --accent-green:#4ade80;
  --r:           10px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ── Header ─────────────────────────────────────────── */
header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(12,12,15,.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -.02em;
  text-decoration: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-status {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--text-muted);
}

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .3; transform: scale(.7); }
}

.lang-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .25rem .5rem;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.lang-btn:hover { color: var(--text); border-color: var(--text-muted); }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7rem 1.5rem 5rem;
  text-align: center;
  position: relative;
}

/* subtle radial glow */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 40%, rgba(124,124,248,.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .6875rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.75rem;
}

.hero-title {
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  font-weight: 300;
  letter-spacing: -.04em;
  line-height: 1.0;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-title .dim { color: var(--text-muted); }

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 440px;
  line-height: 1.75;
  margin-bottom: 4.5rem;
}

/* ── Progress Block ──────────────────────────────────── */
.progress-block {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--text-muted);
}

.progress-row .pct {
  color: var(--text);
  font-weight: 500;
}

/* Multi-style visual switcher */
.pb-visual {
  display: none;
  justify-content: center;
  align-items: center;
  min-height: 52px;
}

.progress-block.style-bar    .pb-bar    { display: flex; flex-direction: column; }
.progress-block.style-spinner .pb-spinner { display: flex; }
.progress-block.style-dots   .pb-dots   { display: flex; }
.progress-block.style-arc    .pb-arc    { display: flex; }
.progress-block.style-wave   .pb-wave   { display: flex; }
.progress-block.style-double .pb-double { display: flex; }
.progress-block.style-ripple .pb-ripple { display: flex; }
.progress-block.style-orbit  .pb-orbit  { display: flex; }
.progress-block.style-grid   .pb-grid   { display: flex; }
.progress-block.style-flip   .pb-flip   { display: flex; }
.progress-block.style-type   .pb-type   { display: flex; }
.progress-block.style-skel   .pb-skel   { display: flex; }

.pb-bar { width: 100%; }

.bar-track {
  height: 3px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-alt));
  border-radius: 99px;
  width: 0%;
  transition: width .9s cubic-bezier(.16,1,.3,1);
}

.progress-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 1em;
  transition: opacity .3s ease;
}

/* ── Scroll Hint ─────────────────────────────────────── */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  animation: bounce-down 2s ease-in-out infinite;
  cursor: pointer;
  transition: opacity .5s;
  line-height: 0;
  background: none;
  border: none;
  padding: .5rem;
}
.scroll-hint.hidden { opacity: 0; pointer-events: none; }

@keyframes bounce-down {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}

/* ── Divider ─────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  max-width: 1120px;
  margin: 0 auto;
}

/* ── Gallery ─────────────────────────────────────────── */
.gallery {
  padding: 6rem 2rem;
  max-width: 1120px;
  margin: 0 auto;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .6875rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 300;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 3rem;
}

.specimen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.specimen {
  background: var(--surface);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  cursor: pointer;
  transition: background .2s;
}
.specimen:hover { background: var(--surface-2); }
.specimen.active { outline: 1px solid var(--accent); outline-offset: -1px; }

.specimen-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.specimen-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: .6875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  letter-spacing: .03em;
}

.specimen-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

/* ── Loading Specimens ───────────────────────────────── */

/* 1. Ring Spinner */
.a-spinner {
  width: 40px; height: 40px;
  border: 2px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 2. Dot Pulse */
.a-dots { display: flex; gap: 7px; align-items: center; }

.a-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot-pulse 1.4s ease-in-out infinite;
}
.a-dots span:nth-child(2) { animation-delay: .2s; }
.a-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes dot-pulse {
  0%,80%,100% { transform: scale(.55); opacity: .3; }
  40%          { transform: scale(1);   opacity: 1;   }
}

/* 3. Indeterminate Bar */
.a-indet {
  width: 150px; height: 3px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.a-indet::after {
  content: '';
  position: absolute; inset: 0;
  width: 50%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: sweep 1.8s ease-in-out infinite;
}
@keyframes sweep {
  0%   { transform: translateX(-200%); }
  100% { transform: translateX(400%); }
}

/* 4. Skeleton */
.a-skel { display: flex; flex-direction: column; gap: 8px; width: 130px; }

.a-skel-line {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.a-skel-line:nth-child(1) { width: 100%; }
.a-skel-line:nth-child(2) { width: 80%; }
.a-skel-line:nth-child(3) { width: 55%; }

.a-skel-line::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  animation: shimmer 1.8s linear infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* 5. Circular Arc (SVG) */
.a-arc { width: 48px; height: 48px; transform: rotate(-90deg); }
.a-arc-track { fill: none; stroke: var(--surface-2); stroke-width: 2.5; }
.a-arc-fill  {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 120;
  stroke-dashoffset: 28;
  animation: arc-dance 3s ease-in-out infinite;
}
@keyframes arc-dance {
  0%,100% { stroke-dashoffset: 28; }
  50%     { stroke-dashoffset:  6; }
}

/* 6. Wave Bars */
.a-wave { display: flex; align-items: center; gap: 4px; height: 40px; }

.a-wave span {
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  animation: bar-wave 1.2s ease-in-out infinite;
}
.a-wave span:nth-child(1) { animation-delay: 0s; }
.a-wave span:nth-child(2) { animation-delay: .15s; }
.a-wave span:nth-child(3) { animation-delay: .3s; }
.a-wave span:nth-child(4) { animation-delay: .45s; }
.a-wave span:nth-child(5) { animation-delay: .6s; }

@keyframes bar-wave {
  0%,100% { height: 8px;  opacity: .4; }
  50%     { height: 32px; opacity: 1;  }
}

/* 7. Ripple */
.a-ripple {
  position: relative;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
}
.a-ripple-ring {
  position: absolute;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  width: 100%; height: 100%;
  animation: ripple-out 2.4s ease-out infinite;
}
.a-ripple-ring:nth-child(2) { animation-delay: .8s; }
.a-ripple-ring:nth-child(3) { animation-delay: 1.6s; }
.a-ripple-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
@keyframes ripple-out {
  0%   { transform: scale(.2); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* 8. Double Ring */
.a-double { position: relative; width: 44px; height: 44px; }
.a-double-outer,
.a-double-inner {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}
.a-double-outer {
  inset: 0;
  border-top-color: var(--accent);
  animation: spin 1.4s linear infinite;
}
.a-double-inner {
  inset: 8px;
  border-top-color: var(--accent-alt);
  animation: spin .9s linear infinite reverse;
}

/* ── Footer ──────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--text-muted);
  max-width: 1120px;
  margin: 0 auto;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}
.site-footer a:hover { color: var(--text); }

/* ── New Specimens ───────────────────────────────────── */

/* 9. Flip */
.a-flip {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 5px;
  animation: flip-card 2s ease-in-out infinite;
}
@keyframes flip-card {
  0%, 20%   { transform: scaleX(1);  background: var(--accent); }
  50%        { transform: scaleX(0); background: var(--accent-alt); }
  55%, 75%  { transform: scaleX(1);  background: var(--accent-alt); }
  100%       { transform: scaleX(1);  background: var(--accent); }
}

/* 10. Orbit */
.a-orbit {
  position: relative;
  width: 44px; height: 44px;
}
.a-orbit::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed var(--border);
}
.a-orbit-dot {
  position: absolute;
  width: 9px; height: 9px;
  background: var(--accent);
  border-radius: 50%;
  top: 0; left: 50%;
  margin-left: -4.5px;
  transform-origin: 4.5px 22px;
  animation: orbit-spin 1.8s linear infinite;
}
.a-orbit-dot:nth-child(2) {
  background: var(--accent-alt);
  animation-delay: -.9s;
}
@keyframes orbit-spin { to { transform: rotate(360deg); } }

/* 11. Grid Pulse */
.a-grid {
  display: grid;
  grid-template-columns: repeat(3, 8px);
  gap: 5px;
}
.a-grid span {
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--accent);
  opacity: .2;
  animation: grid-pulse 1.5s ease-in-out infinite;
}
.a-grid span:nth-child(1) { animation-delay: 0s; }
.a-grid span:nth-child(2) { animation-delay: .1s; }
.a-grid span:nth-child(3) { animation-delay: .2s; }
.a-grid span:nth-child(4) { animation-delay: .3s; }
.a-grid span:nth-child(5) { animation-delay: .4s; }
.a-grid span:nth-child(6) { animation-delay: .5s; }
.a-grid span:nth-child(7) { animation-delay: .6s; }
.a-grid span:nth-child(8) { animation-delay: .7s; }
.a-grid span:nth-child(9) { animation-delay: .8s; }
@keyframes grid-pulse {
  0%, 100% { opacity: .2; transform: scale(.65); }
  50%       { opacity: 1;  transform: scale(1); }
}

/* 12. Typewriter */
.a-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  color: var(--accent);
  display: flex;
  align-items: center;
}
.a-type::after {
  content: '|';
  margin-left: 2px;
  animation: cursor-blink .85s step-end infinite;
}
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  header { padding: 1rem 1.25rem; }
  .specimen-grid { grid-template-columns: repeat(2, 1fr); }
}
