:root {
  color-scheme: dark;
  --bg: #060708;
  --ink: #f6f2ea;
  --muted: #b6b0a7;
  --line: rgba(246, 242, 234, 0.16);
  --panel: rgba(15, 18, 20, 0.78);
  --panel-strong: rgba(24, 30, 32, 0.94);
  --header-bg: rgba(6, 7, 8, 0.78);
  --soft: rgba(246, 242, 234, 0.06);
  --tag-bg: rgba(246, 242, 234, 0.05);
  --orbit-bg: rgba(6, 7, 8, 0.76);
  --shadow: rgba(0, 0, 0, 0.35);
  --hero-aura: rgba(110, 241, 200, 0.13);
  --hero-aura-2: rgba(124, 184, 255, 0.12);
  --canvas-opacity: 0.7;
  --canvas-blend: screen;
  --accent: #6ef1c8;
  --accent-2: #ffcd6b;
  --accent-3: #7cb8ff;
  --danger: #ff7d73;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f0e8;
  --ink: #111716;
  --muted: #5f6664;
  --line: rgba(17, 23, 22, 0.16);
  --panel: rgba(255, 252, 245, 0.78);
  --panel-strong: rgba(255, 252, 245, 0.96);
  --header-bg: rgba(255, 252, 245, 0.78);
  --soft: rgba(17, 23, 22, 0.06);
  --tag-bg: rgba(17, 23, 22, 0.05);
  --orbit-bg: rgba(255, 252, 245, 0.8);
  --shadow: rgba(42, 52, 49, 0.16);
  --hero-aura: rgba(0, 128, 102, 0.13);
  --hero-aura-2: rgba(41, 116, 214, 0.11);
  --canvas-opacity: 0.28;
  --canvas-blend: multiply;
  --accent: #008a70;
  --accent-2: #b66d00;
  --accent-3: #1c62c7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 18%, var(--hero-aura), transparent 34rem),
    radial-gradient(circle at 88% 8%, var(--hero-aura-2), transparent 28rem),
    linear-gradient(145deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 88%, var(--accent) 12%) 48%, var(--bg) 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  transition:
    background 220ms ease,
    color 220ms ease;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

#signal-field {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: var(--canvas-opacity);
  mix-blend-mode: var(--canvas-blend);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.brand,
.nav,
.controls {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.3rem;
  aspect-ratio: 1;
  border: 1px solid rgba(110, 241, 200, 0.45);
  color: var(--accent);
  background: rgba(110, 241, 200, 0.08);
}

.nav {
  gap: clamp(0.75rem, 2vw, 1.6rem);
  color: var(--muted);
  font-size: 0.92rem;
}

.nav a {
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.controls {
  gap: 0.6rem;
}

.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.2rem;
  border: 1px solid var(--line);
  background: var(--soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.segmented-option,
.theme-toggle {
  border: 0;
  color: var(--muted);
  cursor: pointer;
}

.segmented-option {
  min-width: 2.4rem;
  min-height: 2rem;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
}

.segmented-option.is-active {
  background: var(--ink);
  color: var(--bg);
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 4.2rem;
  height: 2.4rem;
  padding: 0.28rem;
  border: 1px solid var(--line);
  background: var(--soft);
}

.theme-toggle::after {
  content: "";
  position: absolute;
  top: 0.28rem;
  left: 0.28rem;
  width: 1.75rem;
  aspect-ratio: 1;
  background: var(--ink);
  transition: transform 180ms ease;
}

html[data-theme="light"] .theme-toggle::after {
  transform: translateX(1.8rem);
}

.theme-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.75rem;
  aspect-ratio: 1;
}

.theme-icon.sun::before {
  content: "";
  width: 0.72rem;
  aspect-ratio: 1;
  border: 2px solid var(--accent-2);
  border-radius: 50%;
  box-shadow:
    0 -0.55rem 0 -0.28rem var(--accent-2),
    0 0.55rem 0 -0.28rem var(--accent-2),
    0.55rem 0 0 -0.28rem var(--accent-2),
    -0.55rem 0 0 -0.28rem var(--accent-2);
}

.theme-icon.moon::before {
  content: "";
  width: 0.78rem;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: -0.22rem 0 0 0 var(--accent-3);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.95fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  min-height: calc(100vh - 4.5rem);
  padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 4rem) 3rem;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 16ch;
  margin-bottom: 1.2rem;
  font-size: clamp(2.8rem, 5.8vw, 5.2rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h3 {
  font-size: 1.22rem;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-text {
  max-width: 44rem;
  font-size: clamp(1.1rem, 1.9vw, 1.35rem);
}

.hero-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 760;
  cursor: pointer;
}

.primary {
  border-color: rgba(110, 241, 200, 0.6);
  background: var(--accent);
  color: #05110d;
}

.secondary {
  background: var(--soft);
  color: var(--ink);
}

.mission-panel {
  position: relative;
  min-height: 38rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel-strong), var(--panel));
  box-shadow: 0 2rem 6rem var(--shadow);
  overflow: hidden;
}

.portrait-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.42fr) minmax(0, 0.58fr);
  gap: 1rem;
  align-items: end;
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(110, 241, 200, 0.12), transparent 55%),
    var(--soft);
}

.portrait-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 22%;
  border: 1px solid rgba(110, 241, 200, 0.34);
  filter: saturate(1.02) contrast(1.02);
}

.portrait-caption {
  padding: 0.4rem 0.2rem;
}

.portrait-caption strong,
.portrait-caption span {
  display: block;
}

.portrait-caption strong {
  margin-bottom: 0.4rem;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  line-height: 1;
}

.portrait-caption span {
  color: var(--muted);
  line-height: 1.35;
}

.panel-top,
.status-grid,
.proof-strip,
.tag {
  display: flex;
  align-items: center;
}

.panel-top {
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.live-dot {
  width: 0.65rem;
  aspect-ratio: 1;
  background: var(--accent);
  box-shadow: 0 0 1.2rem var(--accent);
}

.orbit {
  position: relative;
  display: grid;
  place-items: center;
  margin-top: 2rem;
  height: 20rem;
}

.core {
  display: grid;
  place-items: center;
  width: 7rem;
  aspect-ratio: 1;
  border: 1px solid rgba(110, 241, 200, 0.55);
  background: rgba(110, 241, 200, 0.1);
  color: var(--accent);
  font-size: 2.2rem;
  font-weight: 900;
  box-shadow: inset 0 0 3rem rgba(110, 241, 200, 0.14), 0 0 5rem rgba(110, 241, 200, 0.1);
}

.orbit span {
  position: absolute;
  transform:
    rotate(calc(var(--i) * 60deg))
    translateX(clamp(7.5rem, 15vw, 9.5rem))
    rotate(calc(var(--i) * -60deg));
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  background: var(--orbit-bg);
  color: var(--ink);
  font-size: 0.82rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.status-grid div,
.work-grid article,
.service-list article,
.tool-card {
  border: 1px solid var(--line);
  background: var(--panel);
}

.status-grid div {
  min-height: 8rem;
  padding: 1rem;
}

.status-grid strong {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--ink);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.status-grid span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.proof-strip {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0 clamp(1rem, 4vw, 4rem) 4rem;
}

.proof-strip span,
.tag {
  min-height: 2rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  background: var(--tag-bg);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.section {
  padding: clamp(4rem, 9vw, 8rem) clamp(1rem, 4vw, 4rem);
  border-top: 1px solid var(--line);
}

.split {
  display: grid;
  grid-template-columns: minmax(16rem, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(2rem, 5vw, 5rem);
}

.work-grid,
.tools-grid,
.service-list {
  display: grid;
  gap: 1rem;
}

.work-grid {
  grid-template-columns: repeat(3, 1fr);
}

.work-grid article,
.service-list article,
.tool-card {
  padding: 1.2rem;
}

.work-grid p,
.service-list p,
.tool-card p {
  margin-bottom: 0;
}

.section-heading {
  max-width: 52rem;
  margin-bottom: 2rem;
}

.tools-section {
  background: var(--tag-bg);
}

.tools-grid {
  grid-template-columns: repeat(4, 1fr);
}

.tool-card {
  min-height: 18rem;
  color: inherit;
  text-align: left;
  font: inherit;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.tool-card:hover {
  transform: translateY(-0.35rem);
  border-color: rgba(110, 241, 200, 0.55);
  background: var(--panel-strong);
}

.tag.private {
  color: var(--accent-2);
}

.tag.planned {
  color: var(--accent-3);
}

.service-list {
  grid-template-columns: repeat(3, 1fr);
}

.service-list span {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--accent);
  font-weight: 900;
}

.about {
  max-width: 70rem;
}

.about p {
  font-size: 1.18rem;
}

.page-hero {
  padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 4rem) clamp(2rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  max-width: 15ch;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.detail-panel,
.app-row {
  border: 1px solid var(--line);
  background: var(--panel);
}

.detail-panel {
  padding: clamp(1.1rem, 3vw, 2rem);
}

.detail-panel h2 {
  margin-top: 1rem;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
}

.plain-list {
  margin: 1.2rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
}

.timeline-section {
  max-width: 74rem;
}

.timeline-section p {
  font-size: 1.18rem;
}

.app-directory {
  display: grid;
  gap: 1rem;
}

.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem;
}

.app-row p {
  margin-bottom: 0;
}

.contact-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: clamp(1rem, 4vw, 4rem);
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid rgba(110, 241, 200, 0.42);
  background: linear-gradient(135deg, rgba(110, 241, 200, 0.12), rgba(255, 205, 107, 0.08));
}

.contact-band h2 {
  max-width: 14ch;
  margin-bottom: 0;
}

dialog {
  width: min(92vw, 34rem);
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  padding: 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

dialog form {
  position: relative;
  padding: 1.5rem;
}

.close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 2rem;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 980px) {
  .hero,
  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .work-grid,
  .tools-grid,
  .service-list,
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .site-header {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    width: 100%;
    justify-content: space-between;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  h1 {
    font-size: clamp(2.7rem, 11vw, 4.1rem);
  }

  .mission-panel {
    min-height: 34rem;
  }

  .portrait-card {
    grid-template-columns: 1fr;
  }

  .portrait-card img {
    max-height: 22rem;
  }

  .status-grid,
  .work-grid,
  .tools-grid,
  .service-list,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .app-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .contact-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
