:root {
  --bg: #050508;
  --ink: #f4f3f8;
  --ink-2: rgba(244, 243, 248, 0.66);
  --ink-3: rgba(244, 243, 248, 0.38);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --glass: rgba(22, 22, 30, 0.42);
  --glass-2: rgba(255, 255, 255, 0.04);
  --ai-1: #ff6ea9;
  --ai-2: #ff9f5a;
  --ai-3: #b57cff;
  --ai-4: #4fa9ff;
  --ai-5: #46e3d0;
  --ai: conic-gradient(from var(--spin, 0deg), var(--ai-4), var(--ai-3), var(--ai-1), var(--ai-2), var(--ai-5), var(--ai-4));
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --serif: "Instrument Serif", "New York", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 4vw, 48px);
}

@property --spin { syntax: "<angle>"; inherits: true; initial-value: 0deg; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: rgba(181, 124, 255, 0.45); color: #fff; }

/* ---------- atmosphere ---------- */
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-3%)} 60%{transform:translate(-2%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)} }

/* Siri-style screen-edge glow */
.edge-glow {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; border-radius: 0;
  padding: 2px; background: var(--ai);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.0; filter: blur(0.5px);
  animation: spin 6s linear infinite; transition: opacity 0.8s var(--ease);
}
.edge-glow::after {
  content: ""; position: absolute; inset: 0; background: inherit; filter: blur(22px); opacity: 0.9;
}
body.is-intro .edge-glow, body.is-asking .edge-glow { opacity: 1; }
body.is-asking .edge-glow { animation-duration: 2.4s; }
@keyframes spin { to { --spin: 360deg; } }

.cursor-halo {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; z-index: 1;
  pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 124, 255, 0.10), rgba(79, 169, 255, 0.05) 40%, transparent 70%);
  transform: translate3d(var(--mx, 50vw), var(--my, 30vh), 0); transition: opacity 0.4s; mix-blend-mode: screen;
}
@media (hover: none) { .cursor-halo { display: none; } }

/* ---------- chrome ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
}
.mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: 0.02em; }
.mark-orb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--ai); animation: spin 8s linear infinite;
  box-shadow: 0 0 18px rgba(181, 124, 255, 0.6), inset 0 0 6px rgba(255, 255, 255, 0.6);
}
.mark-text { font-size: 13px; color: var(--ink-2); }
.sys {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border-radius: 999px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.sys i { width: 6px; height: 6px; border-radius: 50%; background: #888; }
.sys.ok i { background: #3ef0a5; box-shadow: 0 0 10px #3ef0a5; animation: beat 2s ease-in-out infinite; }
@keyframes beat { 50% { opacity: 0.35; } }

main { position: relative; z-index: 2; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 120px var(--gutter) 64px;
}
.focus {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin: 0 0 28px; padding: 8px 16px; border-radius: 999px; font-size: 13px; color: var(--ink-2);
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.focus i { color: var(--ink-3); font-style: normal; }
.focus-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ai); animation: spin 3s linear infinite; box-shadow: 0 0 12px var(--ai-3); }

.name {
  margin: 0; font-weight: 600; letter-spacing: -0.055em; line-height: 0.86;
  font-size: clamp(64px, 15.5vw, 236px); white-space: nowrap;
}
.name .l {
  display: inline-block; opacity: 0; filter: blur(18px); transform: translateY(0.25em) scale(1.08);
  background: linear-gradient(180deg, #fff 30%, rgba(255, 255, 255, 0.52));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: letter 1.4s var(--ease) forwards; animation-delay: calc(0.25s + var(--i) * 0.055s);
}
.name .sp { display: inline-block; width: 0.22em; }
@keyframes letter { to { opacity: 1; filter: blur(0); transform: none; } }
.name.is-shimmer .l {
  background: linear-gradient(100deg, #fff 0%, #fff 38%, #ffd0ea 44%, #c9b2ff 50%, #9fd4ff 56%, #fff 62%, #fff 100%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text;
  animation: letter 1.4s var(--ease) forwards, shimmer 7s linear infinite;
  animation-delay: 0s, calc(var(--i) * 0.05s);
}
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -150% 0; } }

.tagline {
  max-width: 34ch; margin: 30px auto 0; font-family: var(--serif); font-style: italic;
  font-size: clamp(22px, 3vw, 34px); line-height: 1.2; color: var(--ink-2); letter-spacing: -0.01em;
}

/* ask bar */
.ask { position: relative; width: min(560px, 100%); margin-top: 48px; }
.ask-glow {
  position: absolute; top: -1px; left: -1px; right: -1px; height: 64px; border-radius: 22px; background: var(--ai); animation: spin 5s linear infinite;
  opacity: 0.55; transition: opacity 0.5s, filter 0.5s;
}
.ask-glow::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; filter: blur(26px); opacity: 0.45; transition: opacity 0.5s; }
.ask:focus-within .ask-glow { opacity: 1; animation-duration: 2s; }
.ask:focus-within .ask-glow::after { opacity: 0.9; }
.ask-inner {
  position: relative; display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 14px 0 18px;
  border-radius: 21px; background: rgba(12, 12, 18, 0.82);
  backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.ask-spark { width: 22px; height: 22px; flex: none; fill: #d9c6ff; filter: drop-shadow(0 0 8px rgba(181, 124, 255, 0.8)); animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(0.86) rotate(12deg); opacity: 0.7; } }
.ask input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: 400 17px var(--sans); letter-spacing: -0.01em;
}
.ask input::placeholder { color: var(--ink-3); transition: opacity 0.3s; }
.ask kbd {
  flex: none; font: 500 11px var(--mono); color: var(--ink-3); padding: 5px 8px; border-radius: 8px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04);
}
.ask-reply { min-height: 1.5em; margin: 16px 0 0; font: 400 13px var(--mono); color: var(--ink-3); letter-spacing: 0.01em; }
.ask-reply b { color: var(--ink); font-weight: 500; }

/* ---------- ribbon ---------- */
.ribbon {
  display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1200px; margin: 0 auto 120px;
  padding: 0 var(--gutter); gap: 0;
}
.stat { padding: 26px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat b {
  display: block; font-weight: 500; font-size: clamp(30px, 4.4vw, 54px); letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.55)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { display: block; margin-top: 10px; font: 400 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- directories ---------- */
.dirs { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter) 140px; }
.dirs-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: end; margin-bottom: 56px; }
.dirs-head h2 { margin: 0; font-weight: 600; font-size: clamp(40px, 6vw, 84px); line-height: 0.95; letter-spacing: -0.045em; }
.dirs-head .serif { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -0.02em; color: var(--ink-2); }
.dirs-head p { margin: 0; max-width: 46ch; color: var(--ink-2); font-size: 16px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; perspective: 1400px; }
.grid .card:nth-child(7n + 1) { grid-column: span 2; }
.grid .card:nth-child(7n + 1) .card-window { aspect-ratio: 16 / 8.2; }

.card {
  --h: 260; --rx: 0deg; --ry: 0deg; --px: 50%; --py: 50%;
  position: relative; display: flex; flex-direction: column; gap: 18px; padding: 18px; border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015) 40%),
    radial-gradient(120% 80% at 0% 0%, hsla(var(--h), 90%, 60%, 0.10), transparent 60%),
    var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  transition: transform 0.6s var(--ease), border-color 0.4s, box-shadow 0.5s var(--ease), opacity 0.5s var(--ease), filter 0.5s var(--ease);
  opacity: 0; translate: 0 40px; will-change: transform;
}
.card.in { opacity: 1; translate: 0 0; transition: transform 0.6s var(--ease), border-color 0.4s, box-shadow 0.5s var(--ease), opacity 0.9s var(--ease), translate 1s var(--ease), filter 0.5s var(--ease); }
.card::before {
  /* cursor-tracked rim light */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--px) var(--py), hsla(var(--h), 100%, 75%, 0.9), hsla(calc(var(--h) + 60), 100%, 70%, 0.35) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s;
}
.card-shine {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; overflow: hidden;
  background: radial-gradient(500px circle at var(--px) var(--py), hsla(var(--h), 100%, 70%, 0.10), transparent 50%);
  opacity: 0; transition: opacity 0.4s;
}
.card:hover { border-color: var(--line-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 50px 90px -40px hsla(var(--h), 90%, 50%, 0.45); }
.card:hover::before, .card:hover .card-shine { opacity: 1; }
.card.is-hidden { opacity: 0.12; filter: blur(3px) saturate(0); pointer-events: none; }
.card.is-match { border-color: hsla(var(--h), 90%, 70%, 0.5); }

.card-top { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 0; transform: translateZ(30px); }
.card-index { font: 500 12px var(--mono); color: var(--ink-3); letter-spacing: 0.1em; }
.card-status {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 8px; border-radius: 999px;
  font: 500 10.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line);
}
.card-status i { width: 6px; height: 6px; border-radius: 50%; background: #8a8a99; }
.card-status[data-status="up"] i { background: #3ef0a5; box-shadow: 0 0 0 0 rgba(62, 240, 165, 0.6); animation: ping 2.2s ease-out infinite; }
.card-status[data-status="down"] i { background: #ff5d6c; }
.card-status[data-status="checking"] i { animation: beat 0.9s infinite; }
.card-status[data-status="building"] i { background: var(--ai); animation: spin 2s linear infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(62, 240, 165, 0.55); } 80%, 100% { box-shadow: 0 0 0 9px rgba(62, 240, 165, 0); } }

.card-window {
  position: relative; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden;
  background: #0c0c12; border: 1px solid rgba(255, 255, 255, 0.07);
  transform: translateZ(20px); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.9);
}
.card-chrome {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2; height: 28px; display: flex; align-items: center; gap: 6px; padding: 0 12px;
  background: rgba(10, 10, 14, 0.66); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.card-chrome span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.card-chrome em { margin-left: 8px; font: 400 10.5px var(--mono); font-style: normal; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-window img {
  position: absolute; inset: 28px 0 0; width: 100%; height: calc(100% - 28px); object-fit: cover; object-position: top;
  filter: saturate(0.9) brightness(0.92); transition: transform 1.6s var(--ease), filter 0.6s;
}
.card:hover .card-window img { transform: scale(1.04) translateY(-2%); filter: saturate(1.05) brightness(1); }
.card-window::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.10), transparent 30%, transparent 70%, hsla(var(--h), 100%, 70%, 0.10));
}
.card-placeholder { position: absolute; inset: 28px 0 0; display: grid; place-items: center; overflow: hidden; }
.card-placeholder span { position: relative; font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.ph-orb {
  position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%; background: var(--ai); filter: blur(38px); opacity: 0.55;
  animation: spin 7s linear infinite, breathe 5s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(0.8); opacity: 0.35; } }

.card-body { display: flex; gap: 14px; align-items: flex-start; padding: 0 4px; transform: translateZ(26px); }
.card-icon {
  flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, hsla(var(--h), 90%, 66%, 0.95), hsla(calc(var(--h) + 40), 90%, 50%, 0.85));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), inset 0 -6px 12px rgba(0, 0, 0, 0.18), 0 10px 24px -8px hsla(var(--h), 90%, 55%, 0.7);
}
.card-icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card-icon .glyph { font-weight: 700; color: #fff; }
.card-text h3 { margin: 1px 0 6px; font-size: 20px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.card-text p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }

.card-foot {
  display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 4px 2px; border-top: 1px solid var(--line);
  transform: translateZ(18px);
}
.chip { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 9px; border-radius: 8px; color: hsla(var(--h), 100%, 82%, 0.95); background: hsla(var(--h), 90%, 60%, 0.12); }
.metric { font-size: 12.5px; color: var(--ink-3); }
.metric b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.go { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: color 0.3s, gap 0.4s var(--ease); }
.go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.4s var(--ease); }
.card:hover .go { color: #fff; gap: 7px; }
.card:hover .go svg { transform: translate(2px, -2px); }
.card.is-building { cursor: default; }
.card.is-building .card-window { border-style: dashed; border-color: rgba(255, 255, 255, 0.12); }

.empty { text-align: center; color: var(--ink-3); font-family: var(--serif); font-style: italic; font-size: 22px; margin-top: 40px; }

/* ---------- footer ---------- */
.foot { position: relative; z-index: 2; padding: 48px var(--gutter) 64px; text-align: center; border-top: 1px solid var(--line); }
.socials { display: flex; justify-content: center; gap: 10px; margin-bottom: 22px; }
.social {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: transform 0.4s var(--ease), background 0.3s, border-color 0.3s, box-shadow 0.4s;
}
.social svg { width: 19px; height: 19px; fill: none; stroke: var(--ink-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.3s; }
.social:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 0.08); border-color: var(--line-2); box-shadow: 0 14px 30px -12px rgba(181, 124, 255, 0.6); }
.social:hover svg { stroke: #fff; }
.foot p { margin: 0; font: 400 11.5px var(--mono); letter-spacing: 0.04em; color: var(--ink-3); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); filter: blur(8px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease), filter 1.2s var(--ease); }
.reveal.in { opacity: 1; transform: none; filter: none; }
.hero .reveal.in:nth-of-type(1) { transition-delay: 0.1s; }
.tagline.in { transition-delay: 1.1s; }
.ask.in { transition-delay: 1.35s; }

/* a lone card on the last row fills it */
@media (min-width: 1021px) { .grid .card:last-child:nth-child(3n + 1) { grid-column: span 2; } .grid .card:last-child:nth-child(3n + 1) .card-window { aspect-ratio: 16 / 8.2; } }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid .card:nth-child(7n + 1) { grid-column: span 2; }
  .dirs-head { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 680px) {
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .grid .card:nth-child(7n + 1) { grid-column: auto; }
  .grid .card:nth-child(7n + 1) .card-window { aspect-ratio: 16 / 10; }
  .ribbon { grid-template-columns: repeat(2, 1fr); margin-bottom: 80px; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .ask kbd { display: none; }
  .card { border-radius: 24px; padding: 14px; }
  .focus { font-size: 12px; }
  .name { font-size: clamp(44px, 14.5vw, 120px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .name .l { opacity: 1; filter: none; transform: none; }
  .card, .reveal { opacity: 1; translate: none; transform: none; filter: none; }
}
