/* Visual Direction 5 — ASCII feature panels with hover grain */

body[data-page="visualdirection5"] {
  --white: #fcfcfc;
  --black: #181818;
  --highlight: #4f70c5;
  --highlight-soft: #b8c4eb;
  --panel-bg: #f4f3ef;
  --vd5-ascii-size: 3.25px;
  --vd5-grain-fine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.05' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --vd5-grain-coarse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  margin: 0;
  min-height: 100vh;
  background: var(--white);
  color: var(--black);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.vd5-nav {
  display: flex;
  gap: 16px;
  padding: 20px 24px 0;
  font-family: ui-monospace, "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vd5-nav a {
  color: rgba(24, 24, 24, 0.55);
  text-decoration: none;
}

.vd5-nav a:hover {
  color: var(--black);
}

.vd5-header {
  padding: 32px 24px 28px;
  max-width: 72ch;
}

.vd5-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.vd5-header p {
  margin: 0;
  color: rgba(24, 24, 24, 0.58);
  font-size: 0.95rem;
}

.vd5-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1328px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.vd5-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  min-width: 0;
  padding: 28px 24px 24px;
  border-radius: 20px;
  border: 1px solid rgba(24, 24, 24, 0.08);
  background: var(--panel-bg);
  color: var(--black);
  overflow: hidden;
  isolation: isolate;
  cursor: crosshair;
  transition:
    color 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.vd5-panel::before {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: 0;
  opacity: 0;
  filter: blur(42px);
  transform: scale(1.08);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.vd5-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  background-image: var(--vd5-grain-fine), var(--vd5-grain-coarse);
  background-size: 72px 72px, 128px 128px;
  background-blend-mode: multiply;
  mix-blend-mode: overlay;
  filter: contrast(210%) brightness(0.82) saturate(0.9);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

/* Phase 1 — reasoning network, dark greens + slight red accent */
.vd5-panel[data-vd5-panel="phase1"]::before {
  background:
    radial-gradient(ellipse 52% 42% at 78% 12%, rgba(200, 232, 106, 0.72) 0%, transparent 62%),
    radial-gradient(ellipse 58% 48% at 18% 82%, rgba(166, 72, 45, 0.55) 0%, transparent 68%),
    radial-gradient(ellipse 64% 54% at 58% 52%, rgba(63, 90, 36, 0.94) 0%, transparent 66%),
    radial-gradient(ellipse 72% 58% at 34% 32%, rgba(91, 125, 49, 0.9) 0%, transparent 62%),
    radial-gradient(ellipse 90% 75% at 50% 105%, rgba(24, 24, 24, 0.92) 0%, transparent 58%),
    linear-gradient(155deg, #142010 0%, #181818 55%, #0e1808 100%);
}

/* Phase 2 — continuous learning spiral, warm amber */
.vd5-panel[data-vd5-panel="phase2"]::before {
  background:
    radial-gradient(ellipse 50% 40% at 82% 16%, rgba(252, 252, 252, 0.82) 0%, transparent 60%),
    radial-gradient(ellipse 56% 46% at 14% 78%, rgba(120, 72, 32, 0.9) 0%, transparent 68%),
    radial-gradient(ellipse 62% 52% at 55% 48%, rgba(240, 168, 72, 0.92) 0%, transparent 65%),
    radial-gradient(ellipse 68% 56% at 30% 28%, rgba(248, 212, 144, 0.85) 0%, transparent 62%),
    radial-gradient(ellipse 88% 72% at 50% 108%, rgba(24, 24, 24, 0.88) 0%, transparent 55%),
    linear-gradient(165deg, #281808 0%, #181818 50%, #1a1408 100%);
}

/* Phase 3 — world models, teal simulation */
.vd5-panel[data-vd5-panel="phase3"]::before {
  background:
    radial-gradient(ellipse 50% 42% at 80% 10%, rgba(252, 252, 252, 0.85) 0%, transparent 60%),
    radial-gradient(ellipse 56% 48% at 16% 84%, rgba(32, 88, 96, 0.9) 0%, transparent 68%),
    radial-gradient(ellipse 62% 52% at 52% 50%, rgba(72, 176, 192, 0.94) 0%, transparent 64%),
    radial-gradient(ellipse 68% 56% at 36% 30%, rgba(144, 216, 224, 0.88) 0%, transparent 62%),
    radial-gradient(ellipse 88% 72% at 50% 108%, rgba(24, 24, 24, 0.88) 0%, transparent 55%),
    linear-gradient(158deg, #081820 0%, #181818 50%, #081418 100%);
}

.vd5-panel:hover {
  border-color: rgba(252, 252, 252, 0.14);
  box-shadow: 0 28px 56px rgba(24, 24, 24, 0.22);
}

.vd5-panel:hover::before {
  opacity: 1;
}

.vd5-panel:hover::after {
  opacity: 0.92;
}

.vd5-panel__title,
.vd5-panel__desc,
.vd5-panel__ascii-wrap {
  position: relative;
  z-index: 2;
}

.vd5-panel__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.25;
  transition: color 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.vd5-panel:hover .vd5-panel__title {
  color: var(--white);
}

.vd5-panel__desc {
  margin: auto 0 0;
  padding-top: 20px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(24, 24, 24, 0.62);
  transition: color 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.vd5-panel:hover .vd5-panel__desc {
  color: rgba(252, 252, 252, 0.72);
}

.vd5-panel__ascii-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 300px;
  padding: 16px 0;
  overflow: visible;
}

.vd5-ascii {
  margin: 0;
  font-family: ui-monospace, "IBM Plex Mono", "Courier New", monospace;
  font-size: var(--vd5-ascii-size);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  white-space: pre;
  user-select: none;
  color: var(--black);
  transition: color 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center center;
  will-change: transform;
}

.vd5-panel:hover .vd5-ascii {
  color: var(--white);
}

@media (max-width: 960px) {
  .vd5-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
}

@media (max-width: 720px) {
  .vd5-grid {
    padding-bottom: 32px;
  }

  .vd5-panel {
    min-height: 440px;
  }
}
