/* kazli — one sleek card on a soft blue field */
:root {
  color-scheme: light;
  --field: #E6EFF9;
  --card: #FFFFFF;
  --card-2: #F1F6FC;
  --ink: #0F1E36;
  --muted: #5B6B82;
  --line: rgba(15, 30, 54, .08);
  --electric: #2F6BFF;
  --cyan: #22D3EE;
  --violet: #7C5CFF;
  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(255, 255, 255, .9);

  --display: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.22, .61, .2, 1);
}
:root[data-theme="dusk"] {
  color-scheme: dark;
  --field: #0F1C33;
  --card: #16263F;
  --card-2: #1B2E4C;
  --ink: #F2F6FB;
  --muted: #A9B8CF;
  --line: rgba(255, 255, 255, .1);
  --glass: rgba(22, 38, 63, .72);
  --glass-line: rgba(255, 255, 255, .14);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background .8s ease, color .8s ease;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, p, ul, pre { margin: 0; }
ul { padding: 0; list-style: none; }
::selection { background: #C2DAF0; color: #0F1E36; }
:focus-visible { outline: 2px solid var(--electric); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 20;
  background: var(--ink); color: var(--card);
  padding: 10px 16px; border-radius: 8px; text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* Soft field behind the card */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 50vw at 80% 20%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 60%),
    radial-gradient(50vw 40vw at 10% 100%, rgba(47, 107, 255, .12), rgba(47, 107, 255, 0) 70%);
  transition: opacity .8s ease;
}
:root[data-theme="dusk"] body::before { opacity: .35; }

.page {
  max-width: 1360px;
  margin-inline: auto;
  padding: env(safe-area-inset-top, 0px) var(--gutter) env(safe-area-inset-bottom, 0px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
}

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: clamp(16px, 3vh, 28px);
}
.wordmark { font-family: var(--display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.03em; }
.wordmark span { color: var(--electric); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle, .nav-cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  font: inherit; font-size: .9rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: border-color .2s ease, background .8s ease, color .8s ease;
}
.theme-toggle { width: 42px; padding: 0; position: relative; }
.nav-cta { padding-inline: 18px; }
.theme-toggle:hover, .nav-cta:hover { border-color: var(--electric); }
.theme-toggle svg { position: absolute; width: 18px; height: 18px; transition: opacity .5s ease, transform .7s var(--ease); }
.i-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
:root[data-theme="dusk"] .i-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
:root[data-theme="dusk"] .i-moon { opacity: 1; transform: none; }

/* ---------- The card ---------- */
.card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  min-height: 0;
  padding: clamp(28px, 5vw, 72px);
  border-radius: 32px;
  background: linear-gradient(135deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .6) inset,
    0 40px 80px -40px rgba(15, 30, 54, .35),
    0 12px 30px -16px rgba(15, 30, 54, .18);
  overflow: hidden;
  transition: background .8s ease, border-color .8s ease;
}
:root[data-theme="dusk"] .card { box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 40px 90px -40px rgba(0, 0, 0, .7); }

/* faint grid, like graph paper, fading toward the text */
.card::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(70% 90% at 78% 50%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 90% at 78% 50%, #000 20%, transparent 75%);
  pointer-events: none;
}

.card-text { position: relative; }
h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, min(4.6vw, 7.4vh), 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.lede {
  font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
  color: var(--muted);
  max-width: 30em;
  margin-top: clamp(16px, 3vh, 28px);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(22px, 4vh, 36px); }

.button {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 50px; padding: 0 24px;
  border-radius: 999px;
  font: inherit; font-weight: 500; font-size: .95rem;
  text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .3s ease, color .2s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: none; }
.primary {
  color: #fff; border: 0;
  background: linear-gradient(100deg, var(--electric), var(--violet));
  box-shadow: 0 10px 24px -10px rgba(47, 107, 255, .7);
}
.primary:hover { box-shadow: 0 14px 30px -10px rgba(47, 107, 255, .8); }
/* gradient hairline border, like the console buttons */
.ghost {
  color: var(--ink); background: var(--card); border: 1px solid transparent;
  background-clip: padding-box;
}
.ghost::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: linear-gradient(100deg, var(--cyan), var(--electric), var(--violet));
}
.ghost svg { width: 18px; height: 18px; }
.ghost.is-copied { color: var(--electric); }

.build {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  margin-top: clamp(24px, 4.5vh, 44px);
  padding-top: clamp(16px, 2.5vh, 22px);
  border-top: 1px solid var(--line);
  font-size: .95rem; color: var(--muted);
}
.build li { display: inline-flex; align-items: center; gap: 8px; }
.icon { width: 20px; height: 20px; color: var(--electric); }

/* ---------- Visual: the orb ---------- */
.visual {
  --px: 0; --py: 0;
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}
.orb {
  position: relative;
  width: min(100%, 60vh, 520px);
  aspect-ratio: 1;
  transform: translate(calc(var(--px) * -10px), calc(var(--py) * -8px));
  transition: transform .9s var(--ease);
}
.orb::before {
  /* the glow behind */
  content: ""; position: absolute; inset: -14%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(34, 211, 238, .45), rgba(47, 107, 255, .35) 40%, rgba(124, 92, 255, 0) 70%);
  filter: blur(30px);
}
.ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 210deg, var(--cyan), var(--electric), var(--violet), var(--cyan));
  padding: 3px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 18s linear infinite;
}
.photo {
  position: absolute; inset: 10px;
  width: calc(100% - 20px); height: calc(100% - 20px);
  border-radius: 50%; object-fit: cover; object-position: 50% 48%;
  box-shadow: 0 30px 60px -30px rgba(15, 30, 54, .6);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* floating glass cards */
.float {
  position: absolute;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px -20px rgba(15, 30, 54, .35);
  font-size: .85rem; color: var(--ink);
  transition: transform .9s var(--ease), background .8s ease;
}
.code {
  left: 0; bottom: 12%;
  flex-direction: column; align-items: flex-start; gap: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  transform: translate(calc(var(--px) * 22px), calc(var(--py) * 14px));
}
.code pre { font: inherit; font-size: .82rem; line-height: 1.55; }
.code .k { color: var(--violet); } .code .f { color: var(--electric); } .code .v { color: #0E9F8E; }
:root[data-theme="dusk"] .code .v { color: var(--cyan); }
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i:first-child { background: #FF7A6B; } .dots i:nth-child(2) { background: #FFC75F; } .dots i:last-child { background: #45D483; }

.stat {
  right: 0; top: 10%;
  line-height: 1.3;
  transform: translate(calc(var(--px) * 16px), calc(var(--py) * -12px));
}
.stat strong { font-weight: 600; font-family: var(--display); font-size: 1rem; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.pulse {
  width: 10px; height: 10px; border-radius: 50%; background: #2ECC71;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, .5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); } }

/* page-load: one sequence */
@media (prefers-reduced-motion: no-preference) {
  .card { animation: card-in 1s var(--ease) both; }
  .card-text > * { animation: rise .9s var(--ease) backwards; }
  .card-text > :nth-child(1) { animation-delay: .25s; }
  .card-text > :nth-child(2) { animation-delay: .35s; }
  .card-text > :nth-child(3) { animation-delay: .45s; }
  .card-text > :nth-child(4) { animation-delay: .55s; }
  .orb { animation: orb-in 1.2s var(--ease) .3s backwards; }
  .float { animation: rise 1s var(--ease) backwards; }
  .code { animation-delay: .9s; } .stat { animation-delay: 1.05s; }
}
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes orb-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px 24px; flex-wrap: wrap;
  padding-block: clamp(14px, 2.4vh, 22px) clamp(8px, 1.6vh, 16px);
  font-size: .875rem; color: var(--muted);
}
.motto { font-family: var(--display); font-weight: 500; color: var(--ink); }
.meta { font-variant-numeric: tabular-nums; }

/* ---------- Desktop: one screen ---------- */
@media (min-width: 900px) and (min-height: 600px) {
  html, body { height: 100%; overflow: hidden; }
  .page { height: 100svh; min-height: 0; }
}

/* ---------- Tablet & mobile ---------- */
@media (max-width: 899px) {
  .card { grid-template-columns: 1fr; gap: 36px; padding: 28px 24px 32px; border-radius: 26px; }
  .card::before { mask-image: radial-gradient(90% 60% at 50% 20%, #000 10%, transparent 75%); -webkit-mask-image: radial-gradient(90% 60% at 50% 20%, #000 10%, transparent 75%); }
  .visual { order: -1; height: auto; padding: 16px 0 8px; }
  .orb { width: min(78vw, 360px); transform: none !important; }
  .float { transform: none !important; }
  .code { left: -8px; bottom: -6px; padding: 12px 14px; }
  .code pre { font-size: .72rem; }
  .stat { right: -8px; top: -6px; padding: 12px 14px; font-size: .8rem; }
  h1 { font-size: clamp(2.1rem, 9vw, 3.2rem); }
  .build { gap: 10px 18px; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 4px; padding-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
