:root {
  --bg: #0c0c0c;
  --fg: #ececec;
  --dim: #8a8a8a;
  --line: rgba(255, 255, 255, 0.12);
  --mark: rgba(255, 255, 255, 0.12);
  --overlay: rgba(8, 8, 8, 0.72);
  --menu-idle: rgba(255, 255, 255, 0.38);
  --card: rgba(255, 255, 255, 0.04);
  --badge-live: rgba(255, 255, 255, 0.12);
  --soon: #111;
  --soon-fg: #fff;
  --pill: rgba(36, 36, 36, 0.88);
  --knob: #f3f3f1;
  --knob-ink: #111;
  --chrome: linear-gradient(185deg, #fff 0%, #cfcfcf 38%, #7a7a7a 52%, #efefef 78%, #9a9a9a 100%);
  --sans: "Space Grotesk", system-ui, sans-serif;
  --display: "Syne", "Space Grotesk", sans-serif;
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

html[data-theme="light"] {
  --bg: #f3f3f1;
  --fg: #111111;
  --dim: #6a6a6a;
  --line: rgba(10, 10, 10, 0.12);
  --mark: rgba(10, 10, 10, 0.08);
  --overlay: rgba(243, 243, 241, 0.78);
  --menu-idle: rgba(17, 17, 17, 0.38);
  --card: rgba(10, 10, 10, 0.04);
  --badge-live: rgba(10, 10, 10, 0.08);
  --soon: #111;
  --soon-fg: #fff;
  --pill: rgba(255, 255, 255, 0.78);
  --knob: #111;
  --knob-ink: #fff;
  --chrome: linear-gradient(185deg, #111 0%, #555 40%, #999 52%, #222 78%, #666 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }
h1, h2 { margin: 0; font-weight: 600; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--fg); color: var(--bg); }

.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: calc(16px + var(--safe-t)) calc(20px + var(--safe-r)) 12px calc(20px + var(--safe-l));
  pointer-events: none;
}
.top > * { pointer-events: auto; }

.mode {
  position: relative;
  width: 68px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.mode__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--knob);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition: transform 0.4s var(--ease);
  pointer-events: none;
}
html[data-theme="light"] .mode__knob { transform: translateX(32px); }
.mode svg {
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
  transition: color 0.3s;
}
.icon-sun { left: 10px; color: var(--knob-ink); }
.icon-moon { right: 10px; color: var(--dim); }
html[data-theme="light"] .icon-sun { color: var(--dim); }
html[data-theme="light"] .icon-moon { color: var(--knob-ink); }
.mode:hover { border-color: var(--dim); }

.mark {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  min-width: 0;
}
.mark strong { font-family: var(--display); font-weight: 600; }
.mark span { color: var(--dim); font-size: 12px; }

.fab {
  position: fixed;
  right: calc(18px + var(--safe-r));
  bottom: calc(18px + var(--safe-b));
  z-index: 60;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--pill);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s;
}
.fab:hover { transform: translateY(-2px); }
.fab[aria-expanded="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.view {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}
.view.is-on {
  opacity: 1;
  pointer-events: auto;
}

.stage {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(88px + var(--safe-t)) 24px calc(88px + var(--safe-b));
  gap: 4px;
}
.copy { max-width: 32em; position: relative; z-index: 2; padding: 0 8px; }
.copy h1 {
  font-family: var(--display);
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.copy p { margin-top: 14px; color: var(--dim); font-size: 16px; }
.copy a {
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}
.copy a:hover { border-bottom-color: var(--fg); }

.planet-wrap {
  position: relative;
  width: min(92vw, 720px);
  height: min(58vh, 560px);
  flex: 0 0 auto;
}
.planet-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(58%, 340px);
  height: min(72%, 340px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--fg) 0%, transparent 68%);
  opacity: 0.09;
  filter: blur(36px);
  pointer-events: none;
}
html[data-theme="light"] .planet-wrap::before { opacity: 0.05; }
.planet-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#about, #products, #contact {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: calc(18vh + var(--safe-t)) 0 calc(96px + var(--safe-b));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.page {
  width: min(720px, calc(100% - 40px - var(--safe-l) - var(--safe-r)));
  margin-left: max(calc(20px + var(--safe-l)), 8vw);
  padding-bottom: 32px;
}
.chrome {
  font-family: var(--display);
  font-size: clamp(48px, 9vw, 96px);
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin-bottom: 32px;
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.prose { font-size: clamp(17px, 1.7vw, 21px); color: var(--dim); line-height: 1.65; }
.prose a { color: var(--fg); border-bottom: 1px solid var(--line); }
.prose em {
  font-style: normal;
  font-weight: 500;
  color: var(--fg);
  box-shadow: inset 0 -0.42em 0 var(--mark);
}
.prose em.glow {
  box-shadow: none;
  background: linear-gradient(100deg, var(--fg) 0%, var(--dim) 45%, var(--fg) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 7s linear infinite;
}
@keyframes sheen {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.where { margin-top: 1.6em; }

.plist { display: grid; gap: 22px; }
.card {
  padding: 22px 0 8px;
  border-top: 1px solid var(--line);
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card h2 {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.035em;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.card h2 small {
  font-size: 0.32em;
  letter-spacing: 0.06em;
  border: 1px solid currentColor;
  padding: 3px 7px;
  border-radius: 5px;
  margin-top: 0.55em;
}
.card p { color: var(--dim); font-size: 17px; max-width: 38em; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge--live {
  border: 1px solid var(--line);
  color: var(--dim);
}
.badge--live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg);
}
.badge--soon {
  background: var(--soon);
  color: var(--soon-fg);
}
.badge--soon::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}
.text-link {
  display: inline-block;
  margin-top: 6px;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.places {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin: 28px 0 36px;
}
.place-k {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
}
.place-k em { font-style: normal; font-variant-numeric: tabular-nums; box-shadow: none; color: var(--dim); font-weight: 400; }
.mail {
  font-family: var(--display);
  font-size: clamp(20px, 3vw, 32px);
  letter-spacing: -0.02em;
  color: var(--fg);
  border-bottom: 1px solid transparent;
  overflow-wrap: anywhere;
}
.mail:hover { border-bottom-color: var(--fg); }

.index {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: var(--overlay);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: calc(88px + var(--safe-t)) calc(8vw + var(--safe-r)) calc(96px + var(--safe-b)) calc(24px + var(--safe-l));
}
.index[hidden] { display: none; }
.index__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--display);
  font-size: clamp(36px, 6vw, 72px);
  letter-spacing: -0.04em;
  line-height: 1.12;
  text-align: right;
}
.index__nav a { color: var(--menu-idle); transition: color 0.2s; }
.index__nav a:hover,
.index__nav a.is-here { color: var(--fg); }
.index__nav em {
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.28em;
  letter-spacing: 0.12em;
  vertical-align: super;
  margin-right: 10px;
  color: var(--dim);
}

@media (prefers-reduced-motion: reduce) {
  .view, body { transition: none; }
  .prose em.glow { animation: none; color: var(--fg); background: none; }
  .badge--soon::before { animation: none; }
}

@media (max-width: 860px) {
  .mark { font-size: 12px; }
  .stage { padding-top: calc(76px + var(--safe-t)); }
  .planet-wrap { width: min(100vw, 520px); height: min(46vh, 380px); }
  .places { grid-template-columns: 1fr; gap: 22px; }
  .index { justify-content: flex-start; }
  .index__nav { text-align: left; }
}

@media (max-width: 430px) {
  .fab { height: 42px; font-size: 12px; }
  .copy h1 { font-size: 22px; }
  .copy p { font-size: 15px; }
  .page { width: calc(100% - 32px - var(--safe-l) - var(--safe-r)); margin-left: calc(16px + var(--safe-l)); }
  .chrome { font-size: 48px; }
  .prose { font-size: 17px; }
  .card h2 { font-size: 34px; }
}

@media (max-height: 700px) {
  .planet-wrap { height: min(48vh, 360px); }
  .stage { gap: 0; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .stage { flex-direction: row; text-align: left; padding: calc(56px + var(--safe-t)) 24px 20px; gap: 20px; }
  .planet-wrap { width: min(46vw, 360px); height: min(78vh, 320px); }
  .copy { text-align: left; }
}
