:root {
  --bg-1: #f4f7fb;
  --bg-2: #e9eff7;
  --bg-3: #dde7f4;
  --text-1: #0f172a;
  --text-2: #475569;
  --accent-1: #2563eb;
  --accent-2: #06b6d4;
  --accent-3: #22c55e;
  --card: rgba(255, 255, 255, 0.78);
  --card-border: rgba(15, 23, 42, 0.12);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", "SF Pro Text", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1000px 600px at 12% 8%, rgba(6, 182, 212, 0.18), transparent 60%),
    radial-gradient(900px 700px at 85% 18%, rgba(37, 99, 235, 0.18), transparent 55%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2)),
    repeating-linear-gradient(0deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.04) 1px, transparent 1px, transparent 28px),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.04) 1px, transparent 1px, transparent 28px);
  color: var(--text-1);
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  padding: 24px;
}

a {
  color: darkblue;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

img {
  max-width: 100%;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  position: sticky;
  top: 16px;
  z-index: 10;
}

.nav-brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(1.05rem, 1vw + 0.9rem, 1.5rem);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-1);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-2);
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-1);
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.08);
}

.nav-secret {
  display: none;
}

.nav-open .nav-links .nav-secret {
  display: inline-flex;
}

.nav-unlocked .nav-toggle {
  display: inline-flex;
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  align-items: center;
  margin: 40px 0 32px;
}

.hero-content {
  display: grid;
  gap: 24px;
}

.hero-media {
  display: grid;
  place-items: center;
}

.hero-image {
  width: min(320px, 100%);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.9);
}

.hero h1 {
  font-size: clamp(2.4rem, 2.5vw + 1.6rem, 3.6rem);
  margin: 0;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 1.2vw + 0.9rem, 1.7rem);
  margin: 0;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 680px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.16);
}

.badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(6, 182, 212, 0.12);
  color: var(--text-1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.section-title {
  font-size: 1.6rem;
  margin: 32px 0 16px;
}

.split {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.blog-block {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6));
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.blog-block h3 {
  margin: 0;
}

.blog-meta {
  color: var(--text-2);
  font-size: 0.85rem;
}

.title-button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text-1);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.title-button:hover {
  color: var(--accent-3);
}

.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: stretch;
  justify-content: center;
  z-index: 50;
}

.overlay.open {
  display: flex;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: blur(6px);
}

.overlay-panel {
  position: relative;
  margin: 32px;
  padding: 28px;
  border-radius: calc(var(--radius) + 4px);
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  width: calc(100% - 64px);
  max-width: 100%;
  height: calc(100% - 64px);
  overflow-y: auto;
  z-index: 1;
}

.overlay-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-1);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}

.overlay-body {
  margin-top: 16px;
  color: var(--text-2);
  line-height: 1.7;
}

.footer {
  margin-top: 48px;
  padding: 20px;
  text-align: center;
  color: var(--text-2);
  font-size: 0.9rem;
}

.section-latex {
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed rgba(15, 23, 42, 0.2);
}

.form-stack {
  display: grid;
  gap: 12px;
}

.form-stack label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.form-stack input,
.form-stack textarea {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 10px 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-1);
}

.primary-btn {
  border-radius: 999px;
  border: none;
  padding: 10px 16px;
  font-weight: 600;
  background: var(--accent-1);
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.25);
}

.ghost-btn {
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  padding: 6px 12px;
  background: transparent;
  color: var(--text-1);
  cursor: pointer;
}

.list-stack {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.7);
}

.list-row .meta {
  font-size: 0.85rem;
  color: var(--text-2);
}

.helper {
  color: var(--text-2);
  font-size: 0.9rem;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.fade-up {
  opacity: 0;
  transform: translateY(20px);
}

.fade-up.in-view {
  animation: fadeUp 0.7s ease forwards;
}

.fade-up.delay-1.in-view {
  animation-delay: 0.15s;
}

.fade-up.delay-2.in-view {
  animation-delay: 0.3s;
}

.fade-up.delay-3.in-view {
  animation-delay: 0.45s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 720px) {
  body {
    padding: 16px;
  }

  .nav {
    flex-wrap: wrap;
    align-items: center;
    border-radius: var(--radius);
  }

  .nav-brand {
    font-size: 1.3rem;
    letter-spacing: 0.12em;
  }

  .nav-toggle {
    margin-left: auto;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
  }

  .nav-links a {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
  }

  .nav-open .nav-links {
    display: flex;
  }


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

  .hero-media {
    order: -1;
  }
}
