/* ---------- Design Tokens ---------- */
:root {
  --bg: #0a0e14;
  --bg-alt: #0d131c;
  --surface: #121926;
  --surface-border: #1e2836;
  --text: #e7ecf3;
  --text-muted: #8b98ab;
  --accent: #00d4ff;
  --accent-dim: #00d4ff33;
  --accent-glow: #00d4ff55;
  --radius: 14px;
  --max-width: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

/* ---------- Background canvas ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.85;
}

/* ---------- Layout helpers ---------- */
.section {
  position: relative;
  z-index: 1;
  padding: 7rem 1.5rem;
}

.section-alt { background: var(--bg-alt); }

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin: 0 0 3rem 0;
  font-weight: 700;
}

.accent { color: var(--accent); }

/* ---------- Navbar ---------- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 20, 0.7);
  border-bottom: 1px solid var(--surface-border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--text); }

#nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

#nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 5rem;
}

.hero-content { max-width: 720px; }

.hero-eyebrow {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}

.hero-prompt {
  color: var(--accent);
}

.hero-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: -0.15em;
  animation: cursorBlink 1s step-end infinite;
}

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

.hero-name {
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 800;
  margin: 0 0 1rem;
  line-height: 1.1;
}

.hero-role {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--text);
  font-weight: 500;
  margin: 0 0 1.25rem;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #04141a;
  box-shadow: 0 0 0 0 var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

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

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.hero-scroll-hint span {
  width: 1px;
  height: 32px;
  background: linear-gradient(var(--accent), transparent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3.5rem;
  align-items: center;
}

.about-text p { color: var(--text-muted); margin: 0 0 1.2rem; }
.about-text p:last-child { margin-bottom: 0; }

.about-photo-frame {
  border-radius: var(--radius);
  padding: 4px;
  background: linear-gradient(135deg, var(--accent), transparent 60%);
}

.about-photo-placeholder {
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border: 1px dashed var(--surface-border);
}

.about-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 4px);
  object-fit: cover;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
}

.skill-card h3 {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}

.badge-row.small .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 2.5rem;
  border-left: 2px solid var(--surface-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 3rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -2.94rem;
  top: 0.2rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.timeline-date {
  display: inline-block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.timeline-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.timeline-content p {
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
}

.project-tag {
  display: inline-block;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.9rem;
}

.project-card h3 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
}

.project-block {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 0.9rem;
}

.project-block strong { color: var(--text); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 2rem;
}

.contact-form label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.9rem;
}

.contact-form input,
.contact-form textarea {
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form input.has-error,
.contact-form textarea.has-error {
  border-color: #ff5c7a;
}

.field-error {
  display: none;
  color: #ff5c7a;
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

.field-error.is-visible {
  display: block;
}

.contact-form button {
  margin-top: 1.5rem;
  border: none;
  cursor: pointer;
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 0.6rem 0 0;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: center;
}

.contact-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.contact-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.contact-info-item a {
  font-size: 1.05rem;
  transition: color 0.2s ease;
}

.contact-info-item a:hover { color: var(--accent); }

.placeholder-link { color: var(--text-muted); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--surface-border);
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a:hover { color: var(--accent); }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Legal pages ---------- */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 9rem 1.5rem 6rem;
  position: relative;
  z-index: 1;
}

.legal-page h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.2rem;
  margin: 2.2rem 0 0.8rem;
  color: var(--accent);
}

.legal-page p, .legal-page li {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.legal-page a { color: var(--accent); }

.legal-back {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--accent);
  font-size: 0.9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .about-grid, .contact-grid {
    grid-template-columns: 1fr;
  }
  .about-visual { order: -1; max-width: 260px; margin: 0 auto; }
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--surface-border);
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0;
    gap: 1.2rem;
    transform: translateY(-140%);
    transition: transform 0.3s ease;
  }
  .nav-links.is-open { transform: translateY(0); }
  #nav-toggle { display: flex; }
}

/* ---------- Access Gate ---------- */
html:has(body.gate-locked),
body.gate-locked {
  overflow: hidden;
  height: 100%;
}

body.gate-locked #navbar,
body.gate-locked .section {
  visibility: hidden;
}

body.gate-locked .footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(6px);
}

#gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

body.gate-locked #gate {
  display: flex;
}

.gate-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  text-align: center;
}

.gate-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  margin: 0 0 1.5rem;
}

#gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

#gate-form label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: left;
}

#gate-form input {
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

#gate-form input:focus {
  outline: none;
  border-color: var(--accent);
}

#gate-form input.has-error {
  border-color: #ff5c7a;
}

#gate-form .btn {
  margin-top: 0.75rem;
  border: none;
  cursor: pointer;
  width: 100%;
}

.gate-error {
  display: none;
  color: #ff5c7a;
  font-size: 0.8rem;
  margin: 0.6rem 0 0;
}

.gate-error.is-visible {
  display: block;
}
