@import url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/font/geist-sans/style.css');
@import url('https://cdn.jsdelivr.net/npm/geist@1.3.0/dist/font/geist-mono/style.css');

@font-face {
  font-family: 'GeistPixelLine';
  src: url('/fonts/GeistPixelLine.woff2') format('woff2');
  font-display: swap;
  font-weight: 500;
}

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

:root {
  --bg: #09090b;
  --bg-elevated: #111113;
  --fg: rgba(255, 255, 255, 0.87);
  --fg-muted: rgba(255, 255, 255, 0.45);
  --fg-subtle: rgba(255, 255, 255, 0.18);
  --border: rgba(255, 255, 255, 0.07);
  --border-dashed: rgba(255, 255, 255, 0.10);
  --font-sans: 'Geist Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'Cascadia Code', monospace;
  --font-pixel: 'GeistPixelLine', 'Geist Mono', ui-monospace, monospace;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Layout ── */

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
  width: 100%;
  flex: 1;
}

/* ── Nav / Header ── */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

/* Home: more breathing room before hero */
body.home header {
  margin-bottom: 3.5rem;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--fg-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-logo:hover { color: var(--fg); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--fg); }

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border-dashed);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.lang-toggle:hover {
  color: var(--fg);
  border-color: rgba(255,255,255,0.2);
}

/* ── Now pill ── */

.now-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-dashed);
  border-radius: 999px;
  padding: 0.35rem 0.9rem 0.35rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-muted);
  text-decoration: none;
  margin-bottom: 1.75rem;
  transition: border-color 0.15s, color 0.15s;
  background: rgba(255,255,255,0.03);
}

.now-pill:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--fg);
}

.now-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(74, 222, 128, 0.6); }
  50% { opacity: 0.7; box-shadow: 0 0 10px rgba(74, 222, 128, 0.9); }
}

.now-arrow {
  color: var(--fg-subtle);
  font-size: 0.65rem;
}

/* ── Hero ── */

.hero {
  padding: 1rem 0 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-family: var(--font-pixel);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin-bottom: 1.75rem;
}

.hero-title .line-1 {
  display: block;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(2.75rem, 8vw, 5rem);
}

.hero-title .line-2 {
  display: block;
  color: rgba(255, 255, 255, 0.35);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  margin-top: 0.5rem;
  font-weight: 400;
}

.hero-sub {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  max-width: 480px;
  line-height: 1.65;
  margin-bottom: 2.25rem;
  text-align: center;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: rgba(255,255,255,0.9);
  color: #09090b;
  border: 1px solid rgba(255,255,255,0.9);
}

.btn-primary:hover {
  background: #ffffff;
}

.btn-outline {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border-dashed);
}

.btn-outline:hover {
  color: var(--fg);
  border-color: rgba(255,255,255,0.2);
}

/* ── Stats strip ── */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.stat {
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat:last-child { border-right: none; }

.stat-number {
  font-family: var(--font-pixel);
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, 0.85);
  display: block;
  margin-bottom: 0.25rem;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  line-height: 1.4;
  text-align: center;
}

/* ── Feature cards (like 21st.dev) ── */

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.feature-card {
  background: var(--bg);
  padding: 1.5rem;
}

.feature-icon {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--fg-muted);
}

.feature-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--fg);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.feature-desc {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  line-height: 1.55;
}

/* ── Lab collapsible ── */

.lab-details {
  border-top: 1px solid var(--border);
}

.lab-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: none;
  padding-top: 1rem;
  padding-bottom: 0.75rem;
  user-select: none;
}

.lab-details summary::-webkit-details-marker { display: none; }

.lab-toggle-hint {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--fg-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lab-details[open] .lab-toggle-hint {
  content: 'collapse';
}

.lab-details[open] .lab-toggle-hint::before {
  content: 'collapse';
}

.lab-details:not([open]) .lab-toggle-hint::before {
  content: 'expand';
}

.lab-toggle-hint { font-size: 0; }
.lab-toggle-hint::before { font-size: 0.65rem; }

.lab-details .post-list {
  padding-bottom: 0.5rem;
}

/* ── Section blocks ── */

.section-block {
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1rem 0 0.75rem;
  border-top: 1px solid var(--border);
}

.section-label a {
  color: inherit;
  text-decoration: none;
}

.section-label a:hover { color: var(--fg); }

/* ── Post list ── */

.post-list {
  list-style: none;
}

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list .date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-subtle);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 58px;
}

.post-list a {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.post-list a:hover { color: var(--fg); }

.dimmed {
  font-size: 0.8rem;
  color: var(--fg-subtle);
}

/* ── Footer ── */

footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-subtle);
  max-width: 780px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  align-items: center;
}

footer a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}

footer a:hover { color: var(--fg); }

footer .sep { color: var(--fg-subtle); }

/* ── Post page ── */

.post-title {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.88);
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-subtle);
  margin-bottom: 3rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.post-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--fg);
  max-width: 640px;
}

.post-body p { margin-bottom: 1.25rem; }

.post-body h2 {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  margin: 2.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.post-body h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1.5rem 0 0.5rem;
}

.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.post-body li { margin-bottom: 0.4rem; }

.post-body strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.post-body em {
  color: var(--fg-muted);
  font-style: italic;
}

.post-body a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-dashed);
}

.post-body a:hover {
  color: var(--fg);
  text-decoration-color: var(--fg);
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.7);
}

.post-body pre {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* ── Images ── */

.img-wrap {
  margin: 2rem 0;
  border: 1px solid var(--border);
}

.img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0.88);
}

/* ── About / Now ── */

.page-title {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  color: rgba(255, 255, 255, 0.88);
}

.page-body {
  max-width: 620px;
  color: var(--fg);
  font-size: 1rem;
  line-height: 1.8;
}

.page-body p { margin-bottom: 1.25rem; }

.page-body h2 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 2.5rem 0 0.75rem;
}

.page-body a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-body a:hover { color: var(--fg); }

.page-body ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1.25rem;
}

.page-body ul li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

/* ── Terminal (legacy) ── */

.prompt {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-subtle);
  text-decoration: none;
}

.prompt:hover { color: var(--fg-muted); }

.cursor {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  background: var(--fg-subtle);
  vertical-align: text-bottom;
  animation: blink 1.2s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.terminal-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-input input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  width: 100%;
  caret-color: var(--fg-muted);
}

.terminal-input input::placeholder { color: var(--fg-subtle); }

/* ── Responsive ── */

@media (max-width: 640px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .stat {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .stat:last-child { border-bottom: none; }
  .features {
    grid-template-columns: 1fr 1fr;
  }
  footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
