/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0d0d14;
  --bg2:      #12121c;
  --bg3:      #1a1a2e;
  --surface:  #1e1e30;
  --border:   #2a2a44;
  --accent:   #64ffda;
  --accent2:  #a78bfa;
  --text:     #e2e8f0;
  --muted:    #94a3b8;
  --dim:      #475569;
  --nav-bg:   rgba(13, 13, 20, .85);
  --font:     'Inter', system-ui, -apple-system, sans-serif;
  --mono:     'JetBrains Mono', 'Fira Code', monospace;
  color-scheme: dark;
}

/* Light theme — applied when html[data-theme="light"]. The accents are
   darkened from the dark-mode mint/violet so they stay legible on white. */
[data-theme="light"] {
  --bg:       #f7f8fa;
  --bg2:      #ffffff;
  --bg3:      #eef1f6;
  --surface:  #ffffff;
  --border:   #dfe3ea;
  --accent:   #0d9488;
  --accent2:  #7c3aed;
  --text:     #1f2937;
  --muted:    #5b6675;
  --dim:      #9aa6b6;
  --nav-bg:   rgba(255, 255, 255, .82);
  color-scheme: light;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .75; }

section { padding: 50px 0; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== SECTION LABELS ===== */
.section-label {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-line {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  margin-bottom: 48px;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}

nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-size: .95rem;
  color: var(--accent);
  font-weight: 600;
  margin-right: auto;   /* push links + theme toggle into a right-side cluster */
}
.nav-logo span { color: var(--muted); }

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: .88rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .03em;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); opacity: 1; }

.nav-cta {
  font-size: .85rem;
  color: var(--accent) !important;
  border: 1px solid var(--accent);
  padding: 8px 20px;
  border-radius: 6px;
  transition: background .2s !important;
}
.nav-cta:hover { background: rgba(100, 255, 218, .1); opacity: 1 !important; }

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
/* Icon shows the theme you'll switch TO: sun while dark, moon while light. */
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: all .3s;
}

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 68px 0 0;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(100,255,218,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,255,218,.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(100,255,218,.08) 0%, transparent 70%);
  top: 10%;
  right: -10%;
  pointer-events: none;
}

.hero-glow2 {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167,139,250,.07) 0%, transparent 70%);
  bottom: 15%;
  left: -5%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
}

.hero-text { flex: 1; }

.hero-greeting {
  font-family: var(--mono);
  font-size: .9rem;
  color: var(--accent);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp .6s .2s ease forwards;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeUp .6s .35s ease forwards;
}

.hero-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp .6s .5s ease forwards;
}

.hero-title strong {
  color: var(--accent2);
  font-weight: 600;
}

.type-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s infinite;
}

.hero-desc {
  max-width: 580px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 44px;
  opacity: 0;
  animation: fadeUp .6s .65s ease forwards;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp .6s .8s ease forwards;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: .9rem;
  padding: 14px 28px;
  border-radius: 8px;
  transition: transform .2s, box-shadow .2s;
  letter-spacing: .03em;
}
.btn-primary:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(100, 255, 218, .25);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  padding: 14px 28px;
  border-radius: 8px;
  transition: border-color .2s, transform .2s;
}
.btn-ghost:hover {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
}

.hero-photo-wrap {
  position: relative;
  flex-shrink: 0;
}

.hero-photo {
  width: 340px;
  height: 340px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--border);
  display: block;
  position: relative;
  z-index: 1;
  filter: grayscale(20%);
  transition: filter .3s;
}

.hero-photo:hover { filter: grayscale(0%); }

.hero-photo-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(100, 255, 218, .25);
  z-index: 0;
  animation: spin 18s linear infinite;
}

.hero-photo-ring::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

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

.hero-scroll {
  position: absolute;
  bottom: 36px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: .75rem;
  letter-spacing: .1em;
  opacity: 0;
  animation: fadeIn 1s 1.4s ease forwards;
}
.hero-scroll::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--dim);
}

/* ===== ABOUT ===== */
#about { background: var(--bg2); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-text p {
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.8;
}

.about-text p strong { color: var(--text); }

.about-highlights {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: .9rem;
}
.highlight-item::before {
  content: '▸';
  color: var(--accent);
  flex-shrink: 0;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: border-color .3s, transform .3s;
}
.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--mono);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  color: var(--muted);
  font-size: .9rem;
}

/* ===== SKILLS ===== */
#skills { background: var(--bg); }

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

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: border-color .3s, transform .3s;
}
.skill-group:hover {
  border-color: rgba(100, 255, 218, .3);
  transform: translateY(-4px);
}

.skill-group-title {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.skill-group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-size: .8rem;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  transition: color .2s, border-color .2s, background .2s;
}
.skill-tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(100, 255, 218, .05);
}

/* ===== EXPERIENCE ===== */
#experience { background: var(--bg2); }

.timeline {
  position: relative;
  max-width: 800px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), var(--accent2), transparent);
}

.timeline-item {
  position: relative;
  padding-left: 40px;
  margin-bottom: 56px;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity .5s, transform .5s;
}
.timeline-item.visible { opacity: 1; transform: translateX(0); }

.timeline-dot {
  position: absolute;
  left: -5px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg2);
  box-shadow: 0 0 0 3px rgba(100, 255, 218, .2);
}

.timeline-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.timeline-date {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .08em;
  white-space: nowrap;
}

.timeline-company {
  font-size: .85rem;
  color: var(--muted);
}

.timeline-role {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.timeline-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-bullets li {
  color: var(--muted);
  font-size: .92rem;
  padding-left: 18px;
  position: relative;
  line-height: 1.6;
}
.timeline-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: .75rem;
  top: 3px;
}

.timeline-tech {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-badge {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent2);
  background: rgba(167, 139, 250, .1);
  border: 1px solid rgba(167, 139, 250, .2);
  padding: 3px 10px;
  border-radius: 4px;
}

/* ===== PROJECTS ===== */
#projects { background: var(--bg); }

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color .3s, transform .3s, box-shadow .3s;
  opacity: 0;
  transform: translateY(20px);
}
.project-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .5s, transform .5s, border-color .3s, box-shadow .3s;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(100, 255, 218, .08);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-icon {
  font-size: 1.6rem;
  line-height: 1;
}

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

.project-link {
  color: var(--dim);
  font-size: .85rem;
  transition: color .2s;
}
.project-link:hover { color: var(--accent); opacity: 1; }

.project-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.project-desc {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.65;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.project-tag {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 4px;
}

.project-featured {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--accent);
  letter-spacing: .08em;
  margin-bottom: -8px;
}

/* ===== CONTACT ===== */
#contact {
  background: var(--bg2);
  text-align: center;
}

.contact-inner { max-width: 640px; margin: 0 auto; }

.contact-intro {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 40px;
}

.contact-email {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 40px;
  transition: opacity .2s;
}

.contact-links {
  display: flex;
  justify-content: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .9rem;
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 8px;
  transition: color .2s, border-color .2s;
}
.contact-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  opacity: 1;
}

/* ===== CONTACT FORM ===== */
.contact-form {
  max-width: 560px;
  margin: 0 auto 48px;
  text-align: left;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row .form-input { flex: 1; }

.form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: .95rem;
  padding: 13px 16px;
  transition: border-color .2s, box-shadow .2s;
}
.form-input::placeholder { color: var(--dim); }
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(100, 255, 218, .15);
}

textarea.form-input {
  margin-bottom: 16px;
  resize: vertical;
  min-height: 120px;
}

.cf-turnstile { margin-bottom: 20px; }

.form-submit {
  background: transparent;        /* kill the native <button> background */
  -webkit-appearance: none;
  appearance: none;               /* drop native button rendering */
  cursor: pointer;
  font-family: var(--font);
}
.form-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.form-status {
  margin-top: 16px;
  font-size: .9rem;
  min-height: 1.2em;
}
.form-status.ok    { color: var(--accent); }
.form-status.error { color: #f87171; }

/* Honeypot — hidden from humans, present for bots */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 560px) {
  .form-row { flex-direction: column; gap: 16px; }
}

/* ===== FOOTER ===== */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 32px;
  text-align: center;
}

.footer-text {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--dim);
}
.footer-text span { color: var(--accent); }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  section { padding: 72px 0; }

  .nav-links { display: none; flex-direction: column; gap: 0; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 16px 0;
  }
  .nav-links.open li a {
    display: block;
    padding: 12px 32px;
    font-size: 1rem;
  }
  .nav-toggle { display: flex; margin-left: 18px; }
  .nav-cta { display: none; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-stats { flex-direction: row; flex-wrap: wrap; }
  .stat-card { flex: 1; min-width: 140px; }

  .hero-scroll { display: none; }

  .hero-content { flex-direction: column-reverse; align-items: flex-start; gap: 36px; }
  .hero-photo { width: 160px; height: 160px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }

  .about-highlights { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 20px; }
  .hero-name { font-size: 2.8rem; }
}
