:root {
  color-scheme: dark;
  --bg-0: #000000;
  --bg-1: #050505;
  --fg: #e8e8e8;
  --muted: #808080;
  --accent: #888888;
  --accent-dim: rgba(136, 136, 136, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Menlo, monospace;
  background: var(--bg-0);
  color: var(--fg);
  cursor: url("./cursor.png") 6 6, auto;
}

body {
  overflow: hidden;
}

a,
button,
input,
textarea {
  cursor: url("./cursor.png") 6 6, auto;
}

#viewport {
  position: relative;
  height: 100%;
  width: 100%;
  perspective: 1000px;
  background:
    radial-gradient(circle at 20% 16%, rgba(136, 136, 136, 0.05), transparent 45%),
    radial-gradient(circle at 78% 10%, rgba(136, 136, 136, 0.03), transparent 46%),
    linear-gradient(160deg, #000000 0%, #020202 55%, #000000 100%);
}

#viewport::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.04), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(136, 136, 136, 0.04), transparent 60%);
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.35;
}

.layer {
  position: fixed;
  inset: 0;
  transform-style: preserve-3d;
}

.layer-1 {
  z-index: 1;
  transform: translateZ(-280px) scale(1.35);
  pointer-events: none;
}

.layer-2 {
  z-index: 2;
  transform: translateZ(-140px) scale(1.2);
  pointer-events: none;
}

.layer-3 {
  position: relative;
  inset: auto;
  z-index: 3;
  transform: translateZ(0);
}

#network {
  display: block;
  width: 100%;
  height: 100%;
}

#parallax {
  overflow: hidden;
}

#scroll {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

#scroll::-webkit-scrollbar {
  width: 6px;
}

#scroll::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 999px;
}

#scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(2, 2, 2, 0.7);
  border: 1px solid rgba(136, 136, 136, 0.12);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  z-index: 5;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
  animation: fade-in 1.2s ease-out both;
}

.nav a {
  color: var(--fg);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.nav a:hover {
  opacity: 1;
  color: var(--accent);
}

.panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 6vw, 90px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.panel-inner {
  width: 100%;
  max-width: 68ch;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel.center .panel-inner {
  align-items: center;
  text-align: center;
}

.about .panel-inner {
  min-height: 70vh;
}

.title {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.subtitle {
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  color: var(--muted);
}

h2 {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 2.1rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

p {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.6;
}

.about-links {
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--muted);
}

.type-line,
.loop-line {
  position: relative;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.panel.is-active .type-line.typing,
.panel.is-active .type-line.typed,
.panel.is-active .loop-line {
  opacity: 1;
}

.type-line.typing::after,
.loop-line.typing::after {
  content: "|";
  margin-left: 4px;
  color: #888888;
  animation: blink 0.9s steps(1) infinite;
}

.loop-line {
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(136, 136, 136, 0.3);
}

a:hover {
  color: #888888;
  border-bottom-color: rgba(136, 136, 136, 0.45);
}

.orb {
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(96, 96, 96, 0.32), rgba(0, 0, 0, 0) 62%),
    radial-gradient(circle at 70% 80%, rgba(96, 96, 96, 0.12), rgba(0, 0, 0, 0) 68%);
  mix-blend-mode: screen;
  transform: translate3d(-50%, -50%, 0) translateX(var(--offset-x, 0px)) translateY(var(--offset, 0px));
  transition: opacity 0.3s ease;
  filter: blur(0.2px);
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 720px) {
  .nav {
    gap: 12px;
    padding: 6px 12px;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .panel-inner {
    max-width: 54ch;
  }
}

.apply-form {
  max-width: 600px;
  margin: 1rem auto 0;
  opacity: 0;
  animation: fade-in-form 0.6s ease-out 0.3s forwards;
}

@keyframes fade-in-form {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group {
  margin-bottom: 0.9rem;
}

.form-group.compact {
  margin-bottom: 0.7rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: rgba(136, 136, 136, 0.05);
  border: 1px solid rgba(136, 136, 136, 0.2);
  border-radius: 4px;
  color: var(--fg);
  font-family: Menlo, monospace;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(136, 136, 136, 0.08);
  box-shadow: 0 0 0 3px rgba(136, 136, 136, 0.1);
}

textarea {
  resize: vertical;
  min-height: 50px;
}

.submit-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, #666666 100%);
  border: none;
  border-radius: 4px;
  color: #000;
  font-family: Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(136, 136, 136, 0.3);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-loader {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #000;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-message {
  margin-top: 0.7rem;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  text-align: center;
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(136, 136, 136, 0.1);
  border: 1px solid rgba(136, 136, 136, 0.3);
  color: var(--accent);
}

.form-message.error {
  display: block;
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.3);
  color: #ff8080;
}

@media (max-width: 520px) {
  .nav {
    left: 50%;
    transform: translateX(-50%);
  }

  .title {
    letter-spacing: 0.04em;
  }
  
  .apply-form {
    max-width: 100%;
  }
  
  input,
  textarea {
    font-size: 16px;
  }
}
