@property --glow-x {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 50%;
}
@property --glow-y {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 20%;
}

:root {
  --bg: #0a0a0b;
  --bg-raised: #111113;
  --bg-hover: #141417;
  --fg: #ededed;
  --fg-dim: #8a8a8f;
  --fg-dimmer: #55555a;
  --accent: #3ddc84;
  --accent-glow: rgba(61, 220, 132, 0.18);
  --accent-ring: rgba(61, 220, 132, 0.4);
  --border: #1d1d21;
  --border-strong: #26262c;
  --grid: rgba(255, 255, 255, 0.022);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html,
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  overflow-x: hidden;
}

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 0%, transparent 75%);
}

.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 60% 40% at var(--glow-x) var(--glow-y),
    var(--accent-glow) 0%,
    transparent 60%
  );
  transition: --glow-x 0.6s ease, --glow-y 0.6s ease;
  opacity: 0.6;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 88px 32px 56px;
  position: relative;
  z-index: 1;
}

/* --- Hero --- */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 96px;
}

.brand {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.brand-slash {
  color: var(--accent);
  margin: 0 1px;
  text-shadow: 0 0 12px var(--accent-glow);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-raised);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.status:hover {
  border-color: var(--border-strong);
  color: var(--fg);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
}

.dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--accent-ring);
  animation: pulse 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes pulse {
  0%   { transform: scale(0.8); opacity: 0.8; }
  70%  { transform: scale(2.2); opacity: 0;   }
  100% { transform: scale(2.2); opacity: 0;   }
}

/* --- Intro --- */
.intro h1 {
  font-size: 32px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 96px;
  color: var(--fg);
}

/* --- Section labels --- */
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-dimmer);
  margin-bottom: 20px;
}

/* --- Services --- */
.services {
  margin-bottom: 64px;
}

.service-list {
  list-style: none;
  font-family: var(--font-mono);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

.service-list li {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease, padding 0.2s ease;
}

.service-list li:hover {
  background: var(--bg-raised);
  padding-left: 12px;
}

.tree       { color: var(--fg-dimmer); }
.svc-name   { color: var(--fg); }
.svc-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-dim);
  font-size: 12px;
}

.dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* --- Applications --- */
.apps {
  margin-bottom: 96px;
}

.apps p {
  color: var(--fg-dim);
  font-size: 14px;
  margin-bottom: 12px;
}

.apps .pattern {
  margin-bottom: 0;
}

.apps code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--fg);
}

/* --- Footer --- */
footer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-dimmer);
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  letter-spacing: 0.02em;
}

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

/* --- Reveal animation --- */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.loaded .reveal {
  opacity: 1;
  transform: translateY(0);
}

body.loaded .hero     { transition-delay: 0.05s; }
body.loaded .intro    { transition-delay: 0.15s; }
body.loaded .services { transition-delay: 0.25s; }
body.loaded .apps     { transition-delay: 0.35s; }
body.loaded footer    { transition-delay: 0.45s; }

/* --- Responsive --- */
@media (max-width: 640px) {
  main { padding: 56px 20px 32px; }
  .hero { margin-bottom: 64px; }
  .intro h1 { font-size: 22px; margin-bottom: 64px; }
  .services, .apps { margin-bottom: 64px; }
  .service-list { font-size: 13px; }
  .service-list li { grid-template-columns: 28px 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .dot::before { animation: none; }
  .glow { transition: none; }
}
