:root {
  --bg: #050607;
  --bg-deep: #000000;
  --ink: #f2f5f4;
  --ink-soft: #8b9693;
  --line: rgba(255, 255, 255, 0.08);
  --surface: rgba(16, 18, 19, 0.82);
  --surface-strong: #101214;
  --accent: #3ddc84;
  --accent-dim: #1f8f55;
  --accent-soft: rgba(61, 220, 132, 0.12);
  --accent-ink: #9dffc4;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "Space Grotesk", system-ui, sans-serif;
  --display: "Syne", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-deep);
  line-height: 1.55;
  overflow-x: hidden;
}

body.admin-body {
  background: #040505;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 82% 18%, rgba(61, 220, 132, 0.1), transparent 58%),
    radial-gradient(700px 480px at 8% 0%, rgba(255, 255, 255, 0.04), transparent 55%),
    radial-gradient(600px 420px at 40% 100%, rgba(61, 220, 132, 0.05), transparent 60%),
    linear-gradient(180deg, #0a0c0d 0%, #050607 45%, #000 100%);
  animation: atmosphere-drift 20s ease-in-out infinite alternate;
}

.atmosphere-admin {
  background:
    radial-gradient(700px 420px at 85% -5%, rgba(61, 220, 132, 0.08), transparent 60%),
    radial-gradient(500px 360px at 10% 90%, rgba(255, 255, 255, 0.03), transparent 55%),
    linear-gradient(180deg, #080a0b, #030404);
}

@keyframes atmosphere-drift {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0.92;
    transform: scale(1.04);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  backdrop-filter: blur(16px);
  background: rgba(5, 6, 7, 0.72);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 28px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(61, 220, 132, 0.35));
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.nav-admin {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.nav-admin:hover {
  background: rgba(61, 220, 132, 0.2);
}

main {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.panel {
  display: none;
  animation: rise 0.55s var(--ease) both;
}

.panel.is-visible {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-stage {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  min-height: calc(100vh - 8rem);
}

.hero {
  max-width: 34rem;
  padding: clamp(1.5rem, 5vh, 3rem) 0;
}

.hero-mark {
  width: 64px;
  margin-bottom: 1.1rem;
  filter: drop-shadow(0 0 18px rgba(61, 220, 132, 0.4));
  animation: pulse-glow 4.5s ease-in-out infinite;
}

.hero-brand {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.92;
  color: var(--ink);
}

.hero-title {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
}

.hero-copy {
  margin: 0 0 1.75rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 30rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: #04140c;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(61, 220, 132, 0.2), 0 12px 32px rgba(61, 220, 132, 0.22);
}

.btn-primary:hover {
  background: #56e796;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: rgba(61, 220, 132, 0.35);
  background: rgba(255, 255, 255, 0.03);
}

.btn-danger {
  background: transparent;
  color: #f0a0a0;
  border: 1px solid rgba(240, 160, 160, 0.25);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn-danger:hover {
  background: rgba(240, 160, 160, 0.08);
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
}

.glow {
  position: absolute;
  width: 70%;
  height: 55%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 220, 132, 0.22), transparent 68%);
  filter: blur(18px);
  animation: float-glow 8s ease-in-out infinite;
}

.hero-robot {
  position: relative;
  width: min(480px, 100%);
  filter: drop-shadow(0 28px 50px rgba(0, 0, 0, 0.65));
  animation: float-robot 7s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 12px rgba(61, 220, 132, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(61, 220, 132, 0.55));
  }
}

@keyframes float-glow {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.85;
  }
  50% {
    transform: translateY(-10px) scale(1.05);
    opacity: 1;
  }
}

@keyframes float-robot {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.section-head {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.section-head h1,
.section-head h2 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.section-head p,
.muted {
  margin: 0;
  color: var(--ink-soft);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.35rem 1.4rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  animation: rise 0.5s var(--ease) both;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(61, 220, 132, 0.28);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(61, 220, 132, 0.08);
}

.project-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.project-card p {
  margin: 0;
  color: var(--ink-soft);
  flex: 1;
}

.project-card .project-link {
  align-self: flex-start;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}

.project-card .project-link:hover {
  border-color: var(--accent);
}

.empty-state {
  color: var(--ink-soft);
  padding: 1rem 0;
}

.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.about-note {
  max-width: 40rem;
  margin-top: 1.5rem;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--line);
}

.about-note h3 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 700;
}

.about-note p {
  margin: 0;
  color: var(--ink-soft);
}

.about-robot {
  width: min(340px, 100%);
  margin-inline: auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.55));
  animation: float-robot 8s ease-in-out infinite;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.site-footer img {
  width: 16px;
  opacity: 0.9;
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-soft);
  opacity: 0.5;
}

.admin-main {
  width: min(980px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.admin-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.admin-mark {
  margin-bottom: 0.85rem;
  filter: drop-shadow(0 0 14px rgba(61, 220, 132, 0.35));
}

.admin-card h1,
.admin-card h2 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-card h1 {
  font-size: 1.8rem;
}

.admin-card h2 {
  font-size: 1.25rem;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.stack-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.stack-form input,
.stack-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: #0a0c0d;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  resize: vertical;
}

.stack-form input:focus,
.stack-form textarea:focus {
  border-color: rgba(61, 220, 132, 0.45);
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.12);
}

.form-error {
  margin: 0;
  color: #f0a0a0;
  font-size: 0.9rem;
}

.form-message {
  margin: 0;
  color: var(--accent);
  font-size: 0.9rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  align-items: start;
}

.admin-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.download-card .btn {
  margin-top: 1rem;
}

.admin-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.admin-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.admin-list strong {
  display: block;
  margin-bottom: 0.2rem;
}

.admin-list span {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .hero-stage,
  .about-layout {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: auto;
  }

  .hero-visual {
    order: -1;
    min-height: 260px;
  }

  .hero-robot {
    width: min(360px, 88vw);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }
}
