/* ============================================
   cli.city — Design Tokens
   ============================================ */

:root {
  /* Accent */
  --volt: #FFD60A;
  --volt-hover: #FFC800;
  --volt-soft: rgba(255, 214, 10, 0.12);
  --volt-text: #1a1a00;

  /* Canvas */
  --canvas: #F5F5F0;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;

  /* Glass */
  --glass-bg: rgba(245, 245, 240, 0.65);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: 20px;

  /* Ink — text hierarchy */
  --ink-primary: #0A0A0A;
  --ink-secondary: #3D3D3D;
  --ink-tertiary: #6B6B6B;
  --ink-muted: #9B9B9B;

  /* Borders */
  --edge: rgba(10, 10, 10, 0.08);
  --edge-strong: rgba(10, 10, 10, 0.15);
  --edge-accent: var(--volt);

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(10, 10, 10, 0.04), 0 4px 12px rgba(10, 10, 10, 0.03);
  --shadow-card-hover: 0 2px 8px rgba(10, 10, 10, 0.06), 0 8px 24px rgba(10, 10, 10, 0.06);

  /* Spacing — 8px base */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 100px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;

  color-scheme: light dark;
}

/* ============================================
   Dark Mode
   ============================================ */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0A0A0A;
    --surface: #151515;
    --surface-raised: #1C1C1C;

    --glass-bg: rgba(10, 10, 10, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);

    --ink-primary: #F0F0F0;
    --ink-secondary: #B0B0B0;
    --ink-tertiary: #787878;
    --ink-muted: #505050;

    --edge: rgba(255, 255, 255, 0.08);
    --edge-strong: rgba(255, 255, 255, 0.15);

    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.2);

    --volt-soft: rgba(255, 214, 10, 0.08);
  }
}

[data-theme="dark"] {
  --canvas: #0A0A0A;
  --surface: #151515;
  --surface-raised: #1C1C1C;

  --glass-bg: rgba(10, 10, 10, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);

  --ink-primary: #F0F0F0;
  --ink-secondary: #B0B0B0;
  --ink-tertiary: #787878;
  --ink-muted: #505050;

  --edge: rgba(255, 255, 255, 0.08);
  --edge-strong: rgba(255, 255, 255, 0.15);

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.2);

  --volt-soft: rgba(255, 214, 10, 0.08);
}

/* ============================================
   Reset & Base
   ============================================ */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--canvas);
  color: var(--ink-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--duration-normal) var(--ease-out),
              color var(--duration-normal) var(--ease-out);
  overflow-x: hidden;
}

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

/* ============================================
   Page Container
   ============================================ */

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--sp-6);
  min-height: 100vh;
}

/* ============================================
   Top Bar
   ============================================ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) 0;
  margin-bottom: var(--sp-8);
  position: relative;
  z-index: 10;
}

.topbar-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink-primary);
}

.cursor-prompt {
  color: var(--volt);
  font-weight: 400;
}

.cursor {
  animation: blink 1s step-end infinite;
  color: var(--volt);
  font-weight: 400;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.topbar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-secondary);
  transition: color var(--duration-fast) var(--ease-out);
}

.topbar-icon:hover {
  color: var(--ink-primary);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--edge-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.theme-toggle:hover {
  color: var(--ink-primary);
  border-color: var(--volt);
  background: var(--volt-soft);
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

/* ============================================
   Layout — Character Left, Content Right
   ============================================ */

.layout {
  position: relative;
}

/* ============================================
   Character
   ============================================ */

.character {
  position: fixed;
  top: 100px;
  left: -80px;
  z-index: 1;
  pointer-events: none;
}

.character-img {
  width: 900px;
  height: auto;
  object-fit: contain;
  object-position: top left;
  filter: drop-shadow(0 8px 40px rgba(0, 0, 0, 0.1));
}

[data-theme="dark"] .character-img {
  filter: drop-shadow(0 8px 40px rgba(0, 0, 0, 0.4));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .character-img {
    filter: drop-shadow(0 8px 40px rgba(0, 0, 0, 0.4));
  }
}

/* ============================================
   Content — Right Side
   ============================================ */

.content {
  position: relative;
  z-index: 2;
  margin-left: auto;
  width: 55%;
}

.hero {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: calc(var(--r-lg) + var(--sp-4));
  padding: var(--sp-8);
  margin-bottom: var(--sp-10);
}

/* ============================================
   Hero
   ============================================ */

.hero-prompt {
  display: inline-block;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--volt);
  background: var(--volt-soft);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-5);
}

.hero-title {
  font-size: clamp(36px, 4.5vw, 64px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.0;
  margin-bottom: var(--sp-5);
}

.hero-accent {
  color: var(--volt);
  text-shadow: 0 0 40px var(--volt-soft);
}

[data-theme="dark"] .hero-accent {
  text-shadow: 0 0 60px rgba(255, 214, 10, 0.15);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-accent {
    text-shadow: 0 0 60px rgba(255, 214, 10, 0.15);
  }
}

.hero-sub {
  font-size: 17px;
  font-weight: 400;
  color: var(--ink-secondary);
  max-width: 480px;
  line-height: 1.6;
  margin-bottom: var(--sp-8);
}

.hero-stats {
  display: flex;
  gap: var(--sp-8);
}

.stat-block {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.stat-number {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--ink-primary);
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   Glass Panel
   ============================================ */

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: calc(var(--r-lg) + var(--sp-4));
  padding: var(--sp-5);
}

/* ============================================
   Install Box
   ============================================ */

.install-box {
  margin-bottom: var(--sp-10);
}

.install-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--sp-3);
}

.install-command {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--edge-strong);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
}

.install-command code {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
  user-select: all;
}

.install-copy {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: var(--sp-2) var(--sp-4);
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  background: var(--volt);
  color: var(--volt-text);
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-out);
}

.install-copy:hover {
  background: var(--volt-hover);
}

/* ============================================
   Bento Grid
   ============================================ */

.bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(180px, auto);
  gap: var(--sp-3);
}

.bento-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

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

.bento-card:hover .card-title {
  color: var(--volt-hover);
}

[data-theme="dark"] .bento-card:hover .card-title {
  color: var(--volt);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bento-card:hover .card-title {
    color: var(--volt);
  }
}

/* Card sizes */
.bento-featured {
  grid-column: span 2;
  grid-row: span 1;
  background: #EDEDEA;
  border-color: var(--edge);
  padding: var(--sp-8);
}

[data-theme="dark"] .bento-featured {
  background: #1C1C1C;
  border-color: var(--edge-strong);
}
[data-theme="dark"] .bento-featured .card-tags .tag {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}
[data-theme="dark"] .bento-featured .card-title {
  color: #FFFFFF;
}
[data-theme="dark"] .bento-featured .card-desc {
  color: rgba(255, 255, 255, 0.6);
}
[data-theme="dark"] .bento-featured .card-meta {
  color: rgba(255, 255, 255, 0.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bento-featured {
    background: #1C1C1C;
    border-color: var(--edge-strong);
  }
  :root:not([data-theme="light"]) .bento-featured .card-tags .tag {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
  }
  :root:not([data-theme="light"]) .bento-featured .card-title {
    color: #FFFFFF;
  }
  :root:not([data-theme="light"]) .bento-featured .card-desc {
    color: rgba(255, 255, 255, 0.6);
  }
  :root:not([data-theme="light"]) .bento-featured .card-meta {
    color: rgba(255, 255, 255, 0.4);
  }
}

.bento-featured .card-tags .tag {
  background: var(--volt-soft);
  color: var(--ink-secondary);
}

.bento-featured .tag-accent {
  background: var(--volt) !important;
  color: var(--volt-text) !important;
}

.bento-featured .card-title {
  font-size: clamp(24px, 2.5vw, 36px);
  color: var(--ink-primary);
}

.bento-featured .card-desc {
  color: var(--ink-tertiary);
  font-size: 15px;
  max-width: 400px;
}

.bento-featured .card-meta {
  color: var(--ink-muted);
}

.bento-featured:hover {
  border-color: var(--volt);
}

.bento-featured:hover .card-title {
  color: var(--volt) !important;
}

.bento-tall {
  grid-row: span 2;
}

.bento-wide {
  grid-column: span 2;
}

/* Card internals */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--volt-soft);
  color: var(--ink-secondary);
  letter-spacing: 0.2px;
}

.tag-accent {
  background: var(--volt);
  color: var(--volt-text);
}

.card-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: var(--sp-2);
  transition: color var(--duration-fast) var(--ease-out);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.card-desc {
  font-size: 13px;
  color: var(--ink-tertiary);
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: var(--sp-4);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-muted);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-10);
  padding: var(--sp-5);
  font-size: 14px;
  color: var(--ink-muted);
}

.footer-prompt {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--volt);
  font-weight: 600;
}

.footer-link {
  color: var(--volt);
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-link:hover {
  color: var(--volt-hover);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1100px) {
  .content {
    width: 65%;
  }
}

@media (max-width: 900px) {
  .content {
    width: 100%;
    padding-top: 30vh;
  }

  .character {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .character-img {
    width: 100vw;
    max-width: 100vw;
  }

  .bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-featured {
    grid-column: span 2;
    grid-row: span 1;
  }

  .bento-wide {
    grid-column: span 2;
  }

  .bento-tall {
    grid-row: span 1;
  }
}

@media (max-width: 600px) {
  .page {
    padding: var(--sp-4);
  }

  .bento {
    grid-template-columns: 1fr;
  }

  .bento-featured,
  .bento-wide {
    grid-column: span 1;
  }

  .glass-panel {
    padding: var(--sp-3);
  }

  .hero-title {
    letter-spacing: -1px;
  }

  .hero-stats {
    gap: var(--sp-6);
  }

  .topbar-nav {
    gap: var(--sp-4);
  }
}

/* ============================================
   Selection
   ============================================ */

.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;
}

::selection {
  background: var(--volt);
  color: var(--volt-text);
}
