:root {
  color-scheme: dark;
  --ink: #f4f7fb;
  --muted: #9daaba;
  --line: rgba(255, 255, 255, 0.18);
  --panel: rgba(8, 12, 18, 0.52);
  --accent: #f2553d;
  --accent-2: #55d7ff;
  --deep: #030508;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--deep);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 72% 12%, rgba(85, 215, 255, 0.16), transparent 25rem),
    radial-gradient(circle at 18% 68%, rgba(242, 85, 61, 0.12), transparent 24rem),
    linear-gradient(135deg, #020307 0%, #070b10 46%, #11151b 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

#space-scene,
.fallback-sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#space-scene {
  z-index: -2;
  display: block;
}

.fallback-sky {
  z-index: -4;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px),
    linear-gradient(115deg, rgba(255, 255, 255, 0.08), transparent 38%);
  background-size: 74px 74px, 100% 100%;
  opacity: 0.36;
}

.scene-unavailable #space-scene {
  display: none;
}

.scene-unavailable .fallback-sky {
  z-index: -2;
  opacity: 0.72;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 72px);
  background: linear-gradient(180deg, rgba(3, 5, 8, 0.9), rgba(3, 5, 8, 0));
}

.brand,
nav,
.hero-actions,
.contact-actions,
.admin-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.88rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
}

nav {
  justify-content: center;
  gap: clamp(16px, 3vw, 36px);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

nav a,
.nav-action {
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

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

.nav-action {
  border: 1px solid var(--line);
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-action:hover {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
}

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

.panel {
  min-height: 100vh;
  padding: 120px clamp(22px, 7vw, 92px) 74px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 780px) minmax(180px, 1fr);
  align-items: end;
  gap: 38px;
}

.hero-copy {
  max-width: 780px;
  padding-bottom: min(8vh, 64px);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.74);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

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

h1 {
  margin-bottom: 24px;
  max-width: 780px;
  font-size: clamp(3.4rem, 9vw, 8.2rem);
  line-height: 0.9;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 24px;
  max-width: 760px;
  font-size: clamp(2.3rem, 5.2vw, 5.8rem);
  line-height: 0.96;
  text-transform: uppercase;
}

h3 {
  margin-bottom: 10px;
  font-size: 1rem;
  text-transform: uppercase;
}

.lead,
.copy-block p,
.contact p,
.section-heading p {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.24rem);
  line-height: 1.65;
}

.hero-actions,
.contact-actions,
.admin-actions {
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.06);
}

.button:hover {
  transform: translateY(-1px);
}

.mission-clock {
  justify-self: end;
  width: min(260px, 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
  background: rgba(3, 5, 8, 0.28);
}

.mission-clock span,
.mission-clock small {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 0.76rem;
}

.mission-clock strong {
  display: block;
  margin: 10px 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.projects,
.specs {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: clamp(28px, 7vw, 96px);
}

.project-grid,
.portfolio-grid,
.spec-grid,
.timeline {
  display: grid;
  gap: 14px;
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 36px;
}

.project-card,
.portfolio-card,
.spec-grid div,
.timeline div,
.admin-form {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.project-card {
  min-height: 238px;
  padding: 22px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(85, 215, 255, 0.54);
  background: rgba(8, 12, 18, 0.66);
}

.project-card span {
  display: block;
  margin-bottom: 44px;
  color: var(--accent);
  font-weight: 900;
}

.project-card p,
.timeline span {
  color: var(--muted);
  line-height: 1.55;
}

.project-card small {
  display: block;
  margin-top: 18px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.all-projects,
.admin {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 34px;
}

.section-heading {
  max-width: 900px;
}

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

.portfolio-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}

.portfolio-card-top,
.portfolio-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.portfolio-card-top small,
.portfolio-card-top strong,
.portfolio-card-bottom span,
.portfolio-card-bottom a {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portfolio-card-top small {
  color: var(--accent);
}

.portfolio-card-top strong,
.portfolio-card-bottom a {
  color: var(--accent-2);
}

.portfolio-card h3 {
  margin: 34px 0 14px;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.1;
}

.portfolio-card p {
  color: var(--muted);
  line-height: 1.58;
}

.portfolio-card-bottom {
  align-items: flex-end;
  margin-top: 28px;
  color: var(--muted);
}

.portfolio-card-bottom span {
  max-width: 60%;
  line-height: 1.35;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 980px;
  padding: 24px;
}

.admin-form label {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-form .wide,
.admin-actions {
  grid-column: 1 / -1;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  outline: none;
  padding: 14px;
}

.admin-form textarea {
  resize: vertical;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: rgba(85, 215, 255, 0.7);
}

.admin-form select option {
  background: #080c12;
  color: var(--ink);
}

.admin-actions {
  margin-top: 4px;
}

.admin-actions .button {
  cursor: pointer;
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 20%, rgba(85, 215, 255, 0.16), transparent 28rem),
    rgba(3, 5, 8, 0.78);
  backdrop-filter: blur(20px);
}

.locked .lock-screen {
  display: grid;
}

.locked .site-header,
.locked main,
.locked footer {
  pointer-events: none;
  user-select: none;
  filter: blur(6px);
}

.lock-panel {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.82);
  padding: clamp(24px, 5vw, 42px);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
}

.lock-panel h1 {
  margin-bottom: 18px;
  font-size: clamp(2.6rem, 10vw, 5.2rem);
}

.lock-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.lock-panel label {
  display: grid;
  gap: 10px;
  margin: 28px 0 18px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lock-panel input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  outline: none;
  padding: 15px;
}

.lock-panel input:focus {
  border-color: rgba(85, 215, 255, 0.7);
}

#lock-message {
  display: block;
  min-height: 20px;
  margin-top: 14px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
}

.mission {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.timeline {
  max-width: 880px;
  margin-top: 28px;
}

.timeline div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 22px;
}

.timeline strong {
  color: var(--accent-2);
  text-transform: uppercase;
}

.spec-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spec-grid div {
  min-height: 132px;
  padding: 24px;
}

.spec-grid small {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 800;
}

.spec-grid strong {
  display: block;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.15;
}

.contact {
  display: flex;
  min-height: 88vh;
  flex-direction: column;
  justify-content: center;
}

footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(22px, 7vw, 92px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 800;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  nav {
    display: none;
  }

  .hero,
  .projects,
  .specs {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: center;
    padding-top: 110px;
  }

  .mission-clock {
    justify-self: start;
  }

  .project-grid,
  .portfolio-grid,
  .spec-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 620px;
    font-size: clamp(3.2rem, 14vw, 6.5rem);
  }
}

@media (max-width: 620px) {
  .brand span:last-child {
    display: none;
  }

  .nav-action {
    display: none;
  }

  .panel {
    min-height: auto;
    padding-inline: 18px;
    padding-top: 92px;
    padding-bottom: 68px;
  }

  .hero {
    min-height: 100vh;
    align-content: center;
    gap: 20px;
  }

  .lead,
  .copy-block p,
  .contact p,
  .section-heading p {
    max-width: 100%;
  }

  h1 {
    font-size: clamp(3rem, 15.6vw, 4.4rem);
    line-height: 0.9;
  }

  h2 {
    font-size: clamp(2rem, 10.8vw, 3.4rem);
  }

  .eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
  }

  .button {
    flex: 1 1 148px;
    padding-inline: 14px;
  }

  .mission-clock {
    width: min(260px, 76vw);
    padding: 18px 0;
  }

  .project-card,
  .portfolio-card,
  .spec-grid div,
  .timeline div,
  .admin-form {
    padding: 18px;
  }

  .project-card {
    min-height: 210px;
  }

  .project-card span {
    margin-bottom: 30px;
  }

  .timeline div {
    grid-template-columns: 1fr;
  }

  .portfolio-card {
    min-height: 260px;
  }

  .portfolio-card-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .portfolio-card-bottom span {
    max-width: 100%;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button:hover {
    transform: none;
  }
}
