/* ==========================================================================
   LAKKEV.COM — Architectural Monolith & Optical Glass Design System
   Zero neon slop. Pure proportion, hairline precision, real spatial depth.
   ========================================================================== */

:root {
  --bg: #050506;
  --fg: #f5f5f7;
  --fg-muted: #7c7c86;
  --fg-subtle: #4c4c54;

  --glass-bg: rgba(12, 12, 15, 0.46);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-edge-top: rgba(255, 255, 255, 0.18);
  --glass-row-hover: rgba(255, 255, 255, 0.045);
  --hairline: rgba(255, 255, 255, 0.08);
  --shadow-ambient: 0 36px 90px -30px rgba(0, 0, 0, 0.85);

  --font-display: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme='light'] {
  --bg: #f8f8fa;
  --fg: #09090b;
  --fg-muted: #63636e;
  --fg-subtle: #9a9aa6;

  --glass-bg: rgba(255, 255, 255, 0.56);
  --glass-border: rgba(9, 9, 11, 0.09);
  --glass-edge-top: rgba(255, 255, 255, 0.92);
  --glass-row-hover: rgba(9, 9, 11, 0.038);
  --hairline: rgba(9, 9, 11, 0.085);
  --shadow-ambient: 0 30px 80px -28px rgba(15, 23, 42, 0.14);
}

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

html {
  background-color: var(--bg);
  color: var(--fg);
  scroll-behavior: smooth;
  transition: background-color 0.45s var(--ease-expo), color 0.45s var(--ease-expo);
}

body {
  min-height: 100vh;
  font-family: var(--font-display);
  background-color: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.45s var(--ease-expo), color 0.45s var(--ease-expo);
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

/* ==========================================================================
   Full-Viewport 3D WebGL Spatial Particle Canvas
   ========================================================================== */

#spatial-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Subtle vignette so typography stays razor-sharp against dense particle zones */
.optical-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 80% 70% at 50% 42%,
    transparent 32%,
    color-mix(in srgb, var(--bg) 72%, transparent) 100%
  );
}

/* ==========================================================================
   Main Architectural Frame
   ========================================================================== */

.frame {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 28px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Top Hairline Navigation */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}

.wordmark {
  text-decoration: none;
  color: var(--fg);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-action {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s ease;
}

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

.nav-divider {
  width: 1px;
  height: 12px;
  background: var(--hairline);
}

/* ==========================================================================
   Monumental Hero — Pure Authority, Zero Fluff
   ========================================================================== */

.hero {
  padding: clamp(56px, 11vh, 118px) 0 clamp(44px, 7vh, 84px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  user-select: none;
}

.hero-title {
  font-size: clamp(4.2rem, 13.5vw, 11.8rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.06em;
  color: var(--fg);
  margin-left: -0.04em;
  text-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.hero-row {
  width: 100%;
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-statement {
  font-size: clamp(0.98rem, 1.5vw, 1.12rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--fg-muted);
}

.hero-coord {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--fg-subtle);
}

/* ==========================================================================
   Optical Glass Directory Slab
   ========================================================================== */

.glass-slab {
  position: relative;
  border-radius: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 0 var(--glass-edge-top),
    var(--shadow-ambient);
  overflow: hidden;
  transition: background 0.45s var(--ease-expo), border-color 0.45s var(--ease-expo);
}

/* Subtle cursor specular reflection along top glass edge */
.glass-slab::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    540px circle at var(--slab-x, 50%) var(--slab-y, 0%),
    rgba(255, 255, 255, 0.06),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}

[data-theme='light'] .glass-slab::before {
  background: radial-gradient(
    540px circle at var(--slab-x, 50%) var(--slab-y, 0%),
    rgba(255, 255, 255, 0.55),
    transparent 60%
  );
}

.glass-slab:hover::before {
  opacity: 1;
}

.slab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 26px;
  border-bottom: 1px solid var(--hairline);
}

.tier-tabs {
  display: flex;
  align-items: center;
  gap: 22px;
}

.tier-tab {
  position: relative;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.tier-tab:hover,
.tier-tab.is-active {
  color: var(--fg);
}

.tier-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -16px;
  height: 1.5px;
  background: var(--fg);
}

.slab-search-trigger {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.slab-search-trigger:hover {
  color: var(--fg);
}

/* Directory Rows + Gliding Optical Hover Track */
.index-list {
  position: relative;
}

.glide-highlight {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  background: var(--glass-row-hover);
  pointer-events: none;
  opacity: 0;
  transition:
    transform 0.28s var(--ease-expo),
    height 0.28s var(--ease-expo),
    opacity 0.22s ease;
}

.index-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 52px minmax(180px, 1.15fr) minmax(160px, 1.35fr) minmax(180px, auto) 24px;
  align-items: center;
  gap: 16px;
  padding: 20px 26px;
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--hairline);
  transition: color 0.2s ease;
}

.index-row:last-child {
  border-bottom: none;
}

.row-idx {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--fg-subtle);
  transition: color 0.25s ease;
}

.row-name {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: transform 0.3s var(--ease-expo);
}

.row-brief {
  font-size: 0.9rem;
  color: var(--fg-muted);
  transition: color 0.25s ease;
}

.row-domain {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-subtle);
  transition: color 0.25s ease;
}

.row-arrow {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--fg-subtle);
  transition: transform 0.3s var(--ease-expo), color 0.25s ease;
}

.index-row:hover .row-idx,
.index-row:hover .row-brief,
.index-row:hover .row-domain,
.index-row:hover .row-arrow {
  color: var(--fg);
}

.index-row:hover .row-name {
  transform: translateX(5px);
}

.index-row:hover .row-arrow {
  transform: translate(3px, -3px);
}

/* ==========================================================================
   Minimal Architectural Footer
   ========================================================================== */

.bottombar {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--fg-subtle);
}

.bottombar-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.bottombar a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ==========================================================================
   Monochrome Optical Glass Command Palette (⌘K)
   ========================================================================== */

.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: start center;
  padding: 14vh 16px 24px;
  background: color-mix(in srgb, var(--bg) 68%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cmd-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cmd-box {
  width: 100%;
  max-width: 560px;
  border-radius: 18px;
  background: var(--glass-bg);
  backdrop-filter: blur(32px) saturate(150%);
  -webkit-backdrop-filter: blur(32px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-edge-top), var(--shadow-ambient);
  overflow: hidden;
  transform: translateY(-8px) scale(0.985);
  transition: transform 0.26s var(--ease-expo);
}

.cmd-overlay.is-open .cmd-box {
  transform: translateY(0) scale(1);
}

.cmd-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
}

.cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 0.96rem;
}

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

.cmd-esc {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--fg-subtle);
  letter-spacing: 0.08em;
}

.cmd-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 11px;
  text-decoration: none;
  color: var(--fg);
  transition: background 0.14s ease;
}

.cmd-item:hover,
.cmd-item.is-selected {
  background: var(--glass-row-hover);
}

.cmd-item-title {
  font-size: 0.94rem;
  font-weight: 500;
}

.cmd-item-host {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--fg-muted);
}

.cmd-empty {
  padding: 28px 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-subtle);
}

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

@media (max-width: 820px) {
  .index-row {
    grid-template-columns: 36px 1fr auto;
    row-gap: 4px;
    padding: 18px 20px;
  }

  .row-brief {
    grid-column: 2 / 4;
    font-size: 0.84rem;
  }

  .row-domain {
    grid-column: 2 / 3;
    justify-self: start;
    font-size: 0.72rem;
  }

  .row-arrow {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
  }
}

@media (max-width: 540px) {
  .frame {
    padding: 20px 18px 34px;
  }

  .slab-header {
    padding: 14px 18px;
  }

  .topbar-right {
    gap: 14px;
  }
}
