*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #07070a;
  --card: #0c0c10;
  --card-alt: #111116;
  --card-hover: #14141b;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text: #e8e8ed;
  --text-muted: #9b9ba8;
  --text-dim: #6b6b78;
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.15);
  --violet: #a78bfa;
  --cyan: #22d3ee;
  --radius: 26px;
  --radius-sm: 14px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (scripting: none) {
  .card {
    opacity: 1;
    transform: none;
  }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 10px 16px;
  color: var(--bg);
  background: var(--text);
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

/* ========== NAV ========== */
.nav-wrap {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 20px;
  pointer-events: none;
}

.nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 18px;
  background: rgba(12, 12, 16, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  padding-right: 10px;
  margin-right: 4px;
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.55), 0 0 22px rgba(52, 211, 153, 0.25);
  animation: pulse-dot 2.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.92); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--text);
  border-radius: 999px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.nav-cta:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.12);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
}

/* ========== HERO ========== */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 48px 64px;
  align-items: center;
  padding: 140px 24px 48px;
  max-width: 1180px;
  margin: 0 auto;
}

.hero::before {
  content: "";
  position: absolute;
  top: 72px;
  left: -40px;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.14) 0%, rgba(34, 211, 238, 0.06) 38%, transparent 68%);
  pointer-events: none;
  z-index: -1;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 22px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.hero-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.2rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.hero h1 .grad {
  background: linear-gradient(120deg, var(--violet) 0%, var(--cyan) 45%, var(--green) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  max-width: 520px;
  margin-top: 20px;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-path {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.hero-path li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 16px 16px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
}

.hero-path li:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.hero-path-num {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--green);
  background: var(--green-dim);
  padding: 5px 8px;
  border-radius: 8px;
  letter-spacing: 0.04em;
}

.hero-path strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.hero-path span {
  display: block;
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 999px;
  transition: transform 0.22s var(--ease), background 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255, 255, 255, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-2px);
}

/* ========== BENTO ========== */
.bento-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
  opacity: 0;
  transform: translateY(28px);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--card-hover);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin-bottom: 12px;
}

.card p {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Grid placements */
.c-profile { grid-column: span 7; grid-row: span 2; }
.c-terminal { grid-column: span 5; grid-row: span 2; }
.c-stack { grid-column: span 6; }
.c-infra { grid-column: span 6; }
.c-cloud { grid-column: span 4; }
.c-projects { grid-column: span 5; }
.c-philo { grid-column: span 3; }
.c-outside { grid-column: span 12; }
.c-cta { grid-column: span 12; }

/* Card 1 — Profile */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.chip {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
}

/* Card 2 — Terminal */
.terminal {
  margin-top: 16px;
  background: #08080c;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }

.terminal-body {
  padding: 16px 18px 20px;
  color: var(--text-dim);
}

.terminal-body .cmd {
  color: var(--text-muted);
}

.terminal-body .prompt {
  color: var(--green);
  margin-right: 6px;
}

.terminal-body .ok {
  color: var(--green);
}

.terminal-body .line {
  margin-bottom: 10px;
}

.terminal-body .line:last-child {
  margin-bottom: 0;
}

.terminal-body .line-spaced {
  margin-top: 14px;
}

/* Card 3 — Stack */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.stack-item {
  padding: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, background 0.2s;
}

.stack-item:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.stack-item strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.stack-item span {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Card 4 — Infra */
.nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  align-items: center;
  justify-content: flex-start;
}

.node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.node:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.node-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
}

.node:nth-child(2) .node-dot { background: var(--violet); box-shadow: 0 0 8px rgba(167, 139, 250, 0.4); }
.node:nth-child(3) .node-dot { background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, 0.4); }
.node:nth-child(4) .node-dot { background: #f472b6; box-shadow: 0 0 8px rgba(244, 114, 182, 0.35); }

/* Card 5 — Cloud */
.orbit-wrap {
  position: relative;
  width: 100%;
  height: 120px;
  margin: 20px 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.orbit-1 {
  width: 70px;
  height: 70px;
  animation: spin 18s linear infinite;
}

.orbit-2 {
  width: 110px;
  height: 110px;
  animation: spin 28s linear infinite reverse;
}

.orbit-core {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.45);
  z-index: 2;
}

.orbit-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

.orbit-2 .orbit-dot {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}

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

.criterion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  list-style: none;
  margin-top: 8px;
}

.criterion {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.criterion-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--green);
  background: var(--green-dim);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Card 6 — Projects */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
  list-style: none;
}

.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  transition: background 0.2s var(--ease);
}

.project-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.project-item:hover .project-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.project-info strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 550;
  margin-bottom: 2px;
}

.project-info span {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.project-arrow {
  font-size: 0.95rem;
  color: var(--text-dim);
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s var(--ease);
}

/* Card 7 — Philosophy */
.quote {
  font-size: 1.25rem;
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1.35;
  margin-bottom: 18px;
}

.quote em {
  font-style: normal;
  background: linear-gradient(120deg, var(--violet), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.55);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

/* Card 8 — Outside */
.c-outside {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.c-outside > div:first-child {
  flex: 1 1 280px;
}

/* CTA Final */
.c-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 40px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.06) 0%, rgba(34, 211, 238, 0.04) 50%, rgba(52, 211, 153, 0.05) 100%);
}

.c-cta h2 {
  font-size: 1.45rem;
  margin-bottom: 8px;
}

.c-cta p {
  max-width: 480px;
}

.cta-circle {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--text);
  color: var(--bg);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s;
}

.cta-circle:hover {
  transform: scale(1.08) rotate(8deg);
  background: #fff;
  box-shadow: 0 12px 36px rgba(255, 255, 255, 0.15);
}

/* ========== FOOTER ========== */
footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

footer p,
footer .credit {
  font-size: 0.85rem;
  color: #b8b8c4;
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s var(--ease), visibility 0.28s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.3s var(--ease);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 1.2rem;
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.modal h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.modal > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(255, 255, 255, 0.045);
}

.form-group textarea {
  min-height: 110px;
  resize: vertical;
}

.form-status {
  min-height: 1.5em;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--green);
}

.form-status[data-state="error"] {
  color: #fda4af;
}

.form-actions .btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.form-actions .btn {
  flex: 1;
  justify-content: center;
}

.btn-cancel {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-cancel:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .c-profile { grid-column: span 12; grid-row: auto; }
  .c-terminal { grid-column: span 12; grid-row: auto; }
  .c-stack { grid-column: span 12; }
  .c-infra { grid-column: span 12; }
  .c-cloud { grid-column: span 6; }
  .c-projects { grid-column: span 6; }
  .c-philo { grid-column: span 12; }
  .c-outside { grid-column: span 12; }
  .c-cta { grid-column: span 12; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav { padding: 8px 12px 8px 16px; }

  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 120px 20px 36px;
  }

  .hero::before {
    width: 280px;
    height: 280px;
    top: 80px;
    left: -60px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 9vw, 3.2rem);
  }

  .hero-path {
    padding: 12px;
  }

  .bento {
    gap: 12px;
  }

  .card {
    padding: 22px;
    border-radius: 22px;
  }

  .c-cloud,
  .c-projects {
    grid-column: span 12;
  }

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

  .c-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px;
  }

  .cta-circle {
    align-self: flex-end;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .nodes {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .modal {
    padding: 24px 20px;
  }
}
