/* ==========================================================================
   The Zero — thezero.dev
   ========================================================================== */

:root {
  --bg: #000;
  --text: #f3f6fa;
  --text-soft: #e3e9f1;
  --text-mute: #c9d3df;
  --text-dim: #a7b4c4;
  --sky: #8ccfff;
  --sky-rgb: 140, 207, 255;
  --gold: #e6c98f;
  --ease: cubic-bezier(.6, 0, .2, 1);
  --font-display: 'Jura', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Manrope', ui-sans-serif, system-ui, sans-serif;

  /* Sky phase (set by data-phase on <html>) */
  --grid-op: .22;
  --star-op: 1;
  --glow: none;
  --glow-op: 0;

  /* Cursor light */
  --mx: -999px;
  --my: -999px;
  --lamp-op: 0;
}

html[data-phase="dawn"] {
  --grid-op: .26;
  --star-op: .5;
  --glow-op: 1;
  --glow: radial-gradient(ellipse 80% 85% at 100% 100%, rgba(var(--sky-rgb), .30), rgba(var(--sky-rgb), .06) 45%, transparent 72%);
}
html[data-phase="day"] {
  --grid-op: .30;
  --star-op: .12;
  --glow-op: 1;
  --glow: radial-gradient(ellipse 95% 100% at 100% 100%, rgba(var(--sky-rgb), .22), rgba(var(--sky-rgb), .07) 50%, transparent 80%);
}
html[data-phase="dusk"] {
  --grid-op: .24;
  --star-op: .65;
  --glow-op: 1;
  --glow: radial-gradient(ellipse 80% 85% at 100% 100%, rgba(106, 143, 224, .28), rgba(106, 143, 224, .06) 45%, transparent 72%);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--text); }
a:hover { color: var(--sky); }
:focus-visible { outline: 1px dashed var(--sky); outline-offset: 4px; }

/* Secondary type ---------------------------------------------------------- */

.m {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Layout ------------------------------------------------------------------ */

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top {
  position: relative;
  z-index: 2;
  padding: 20px clamp(16px, 2vw, 24px);
}

.main {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  padding: clamp(24px, 6vh, 64px) clamp(20px, 5vw, 64px) clamp(32px, 6vh, 64px) clamp(20px, 13vw, 200px);
}

.col { width: 100%; max-width: 560px; }

/* Phones: even side gutters, content lined up with the logo's ring */
@media (max-width: 640px) {
  .top  { padding: 20px 24px; }
  .logo { margin-left: -11px; } /* 44px tap area, ring's visible edge sits on the 24px gutter */
  .main { padding-left: 24px; padding-right: 24px; }
}

/* Sky: glow, grid, stars -------------------------------------------------- */

.glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--glow);
  opacity: var(--glow-op);
  transition: opacity 2s ease;
}

.sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 100% 100%, #000 0%, rgba(0,0,0,.35) 55%, transparent 100%);
          mask-image: radial-gradient(ellipse 70% 75% at 100% 100%, #000 0%, rgba(0,0,0,.35) 55%, transparent 100%);
}
.sky .grid-line { stroke-opacity: var(--grid-op); transition: stroke-opacity 2s ease; }
.sky .stars { fill: var(--sky); opacity: var(--star-op); transition: opacity 2s ease; }
.tw { animation: tw 4s ease-in-out infinite; }
.tw.near { animation: none; opacity: 1; }

/* Cursor light: field of 0 and 1 ----------------------------------------- */

.lamp {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
  overflow: hidden;
  white-space: pre;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: .42em;
  color: rgba(var(--sky-rgb), .32);
  opacity: var(--lamp-op);
  transition: opacity .5s ease;
  -webkit-mask-image: radial-gradient(200px circle at var(--mx) var(--my), #000 0%, rgba(0,0,0,.4) 40%, transparent 75%);
          mask-image: radial-gradient(200px circle at var(--mx) var(--my), #000 0%, rgba(0,0,0,.4) 40%, transparent 75%);
}

/* Shooting star */
.shoot {
  position: absolute;
  z-index: 1;
  width: 150px;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(to right, transparent, #eaf6ff);
  transform-origin: 100% 50%;
  pointer-events: none;
  opacity: 0;
  animation: shoot 1.4s ease-out forwards;
}

/* Logo -------------------------------------------------------------------- */

.logo {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}
.logo .spin  { transform-origin: 16px 16px; animation: spin 14s linear infinite; }
.logo .boost { transform-origin: 16px 16px; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.logo:hover .boost, .logo:focus-visible .boost { transform: rotate(360deg); }
.logo:hover .ring0, .logo:focus-visible .ring0 { animation: redraw .9s ease; }

/* Content ----------------------------------------------------------------- */

.greet { margin: 0 0 32px; color: var(--text-dim); text-wrap: balance; }
.intro { margin: 0 0 6px; color: var(--text-dim); }

.name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 6.5vw, 78px);
  font-weight: 300;
  line-height: .95;
  letter-spacing: -.03em;
}

.tagline { margin: 24px 0 0; line-height: 1.5; color: var(--gold); }

.bio {
  margin: 28px 0 0;
  text-wrap: pretty;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-soft);
}

.label { margin: 0 0 14px; color: var(--text-dim); }

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  margin-top: 20px;
  color: var(--text-mute);
}
.social > * { padding: 10px 0; }
@media (max-width: 480px) {
  .social { gap: 0 10px; font-size: 12px; }
}

.work { margin-top: 52px; }
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list li { display: flex; align-items: center; gap: 12px; min-height: 30px; }
.list svg path { fill: none; stroke: var(--sky); stroke-width: 1.2; stroke-linejoin: round; }
.list svg { transition: transform .25s ease; }
.list li:hover svg { transform: translateX(3px); }

.cta {
  display: inline-block;
  padding: 12px 0;
  margin: 2px 0 0 24px;
  color: var(--text-mute);
}

.why { margin-top: 36px; }
.why .label { margin-bottom: 10px; }
.why p { margin: 0; line-height: 1.6; color: var(--text-soft); text-wrap: balance; }

.status {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-soft);
}
.status .row { display: flex; align-items: center; gap: 10px; }
.dot { animation: blink 2.4s ease-in-out infinite; }

html[data-phase="night"] .ico-sun,
html:not([data-phase="night"]) .ico-moon { display: none; }

.qb {
  display: inline-grid;
  background: none;
  border: 0;
  padding: 12px 0;
  margin: -12px 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: left;
  cursor: pointer;
  transition: color .2s;
}
.qb:hover { color: var(--sky); }
.q { grid-area: 1 / 1; opacity: 0; transition: opacity .7s ease; }
.q.is-on { opacity: 1; }

.foot {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 11px;
  color: var(--text-dim);
}
.foot abbr { text-decoration: none; cursor: help; }

/* Promo card (desktop only) ----------------------------------------------- */

.promo { display: none; }

@media (min-width: 1025px) {
  .promo {
    position: fixed;
    z-index: 3;
    right: 32px;
    bottom: 32px;
    width: 300px;
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(var(--sky-rgb), .16);
    border-radius: 10px;
    background: rgba(8, 14, 26, .72);
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
    text-decoration: none;
    color: var(--text-soft);
    transition: border-color .3s ease, background .3s ease;
  }
  .promo:hover, .promo:focus-visible {
    color: var(--text-soft);
    border-color: rgba(var(--sky-rgb), .45);
    background: rgba(10, 18, 34, .85);
  }
  .promo-img { flex: 0 0 auto; line-height: 0; }
  .promo-img svg { display: block; border-radius: 6px; }
  .promo-body { display: flex; flex-direction: column; gap: 8px; }
  .promo-text { font-size: 13px; line-height: 1.45; }
  .promo-via { font-size: 10px; color: var(--text-dim); transition: color .3s ease; }
  .promo:hover .promo-via, .promo:focus-visible .promo-via { color: var(--sky); }
}

/* Smaller desktops: slimmer card, text-only, so it never touches the content */
@media (min-width: 1025px) and (max-width: 1279px) {
  .promo { right: 24px; bottom: 24px; width: 220px; }
  .promo-img { display: none; }
}

/* Links ------------------------------------------------------------------- */

/* Nav links + CTA: line draws in from the left, star rides the tip */
.nl { position: relative; text-decoration: none; transition: color .25s ease; }
.nl::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 7px;
  height: 1px;
  background: var(--sky);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--ease);
}
.nl::after,
.u::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  background: var(--sky);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0;
}
.nl::after { left: 0; bottom: 4px; transition: left .45s var(--ease), opacity .25s ease; }
.nl:hover, .nl:focus-visible { color: var(--sky); }
.nl:hover::before, .nl:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.nl:hover::after, .nl:focus-visible::after { left: 100%; opacity: 1; }

/* Text links: resting line leaves to the right, new line + star come in from the left */
.u {
  position: relative;
  text-decoration: none;
  color: var(--text);
  background-image: linear-gradient(var(--sky), var(--sky));
  background-repeat: no-repeat;
  background-position: 100% 100%;
  background-size: 0% 1px;
  padding-bottom: 3px;
  transition: color .3s ease, background-size .3s var(--ease);
}
.u::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--sky);
  transform-origin: left;
  transition: transform .45s var(--ease) .08s;
}
.u::after { left: 0; bottom: -3px; transition: opacity .2s ease, left 0s linear .25s; }
.u:hover, .u:focus-visible {
  color: var(--sky);
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: color .3s ease, background-size .45s var(--ease) .08s;
}
.u:hover::before, .u:focus-visible::before {
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s var(--ease);
}
.u:hover::after, .u:focus-visible::after {
  left: 100%;
  opacity: 1;
  transition: left .45s var(--ease) .08s, opacity .25s ease .08s;
}

/* Entrance ---------------------------------------------------------------- */

.rv {
  opacity: 0;
  transform: translateY(10px);
  animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards;
}

/* Keyframes --------------------------------------------------------------- */

@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes redraw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes tw     { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
@keyframes rise   { to { opacity: 1; transform: none; } }
@keyframes blink  { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes shoot {
  0%   { opacity: 0; transform: rotate(150deg) translateX(0); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(150deg) translateX(420px); }
}

/* Touch devices: no cursor light ----------------------------------------- */

@media (hover: none) {
  .lamp { display: none; }
}

/* Reduced motion ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .logo .spin, .tw, .dot, .shoot { animation: none; }
  .logo .boost, .q, .glow, .lamp,
  .nl, .nl::before, .nl::after,
  .u, .u::before, .u::after,
  .u:hover, .u:hover::before, .u:hover::after { transition: none; }
  .logo:hover .ring0 { animation: none; }
  .rv { animation: none; opacity: 1; transform: none; }
}
