/*
  Premium Dark Glass Portfolio — Teal + Gold Accent
  - Dark default, light mode support
  - Glassmorphism with subtle teal→gold gradient accents
  - Professional, refined, accessible
*/

/* ===== 1) CSS VARIABLES & THEMING ===== */
:root {
  /* Spacing scale (8px base) */
  --s1: 0.5rem;
  --s2: 0.75rem;
  --s3: 1rem;
  --s4: 1.5rem;
  --s5: 2rem;
  --s6: 3rem;
  --s7: 4rem;

  /* Dark theme (default) */
  --bg: #0b0f14;
  --bg-2: #0f1720;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.10);
  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.70);
  
  /* Accent: teal + warm gold */
  --a1: #2dd4bf;
  --a2: #f59e0b;
  --accent: var(--a1);
  
  /* Shadows & effects (subtle) */
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.3);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.6);
  --glow: 0 0 24px rgba(45, 212, 191, 0.2);
  --radius: 16px;
  --radius-sm: 10px;
}

:root[data-theme="light"] {
  --bg: #fafaf9;
  --bg-2: #ffffff;
  --surface: rgba(15, 23, 32, 0.04);
  --surface-2: rgba(15, 23, 32, 0.07);
  --border: rgba(15, 23, 32, 0.12);
  --text: rgba(15, 23, 32, 0.92);
  --text-muted: rgba(15, 23, 32, 0.66);
  --a1: #14b8a6;
  --a2: #d97706;
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.08);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.15);
  --glow: 0 0 24px rgba(20, 184, 166, 0.15);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--a1);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #2ec5b0;
}

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

.container {
  width: min(1200px, calc(100% - var(--s4)));
  margin-inline: auto;
  position: relative;
}

/* ===== 3) SCROLL PROGRESS ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--a1), var(--a2));
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease;
}

/* ===== 4) GRADIENT BLOBS BACKGROUND ===== */
.blob {
  position: fixed;
  border-radius: 50%;
  opacity: 0.08;
  z-index: -1;
  will-change: transform;
}

.blob--1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  top: -100px;
  left: 10%;
  animation: float 8s ease-in-out infinite;
}

.blob--2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(45deg, var(--a2), var(--a1));
  bottom: 50px;
  right: 5%;
  animation: float 10s ease-in-out infinite 1s;
}

.blob--3 {
  width: 700px;
  height: 700px;
  background: linear-gradient(225deg, var(--a1), var(--a2));
  top: 50%;
  right: -200px;
  animation: float 12s ease-in-out infinite 2s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-30px) translateX(20px); }
}

/* ===== 5) SKIP LINK ===== */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  z-index: 9999;
}

.skip-link:focus {
  position: fixed;
  left: var(--s3);
  top: var(--s3);
  background: var(--surface);
  padding: var(--s2) var(--s3);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 10000;
}

/* ===== 6) HEADER & NAVIGATION ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 20, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

:root[data-theme="light"] .site-header {
  background: rgba(250, 250, 249, 0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s2) 0;
}

.brand {
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--a1), var(--a2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.2s ease;
}

.brand:hover {
  transform: scale(1.05);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex: 1;
  justify-content: space-between;
  margin-left: var(--s4);
}

.nav-list {
  list-style: none;
  display: flex;
  gap: var(--s3);
}

.nav-link {
  display: inline-block;
  padding: var(--s2) var(--s3);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-link.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.15), rgba(245, 158, 11, 0.1));
  border: 1px solid var(--a1);
  box-shadow: inset 0 0 12px rgba(45, 212, 191, 0.1);
}

.nav-link:focus-visible {
  outline: 2px solid var(--a1);
  outline-offset: 4px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: var(--s2) var(--s3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: var(--s1);
  font-weight: 500;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface);
  border-color: var(--a1);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--a1);
  outline-offset: 2px;
}

.theme-icon {
  font-size: 1rem;
}

.theme-text {
  font-size: 0.9rem;
}

/* Nav toggle (mobile hamburger) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: var(--s1);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--a1);
  outline-offset: 2px;
}

.hamburger {
  width: 24px;
  height: 2px;
  background: var(--text);
  display: block;
  position: relative;
  transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text);
  left: 0;
  transition: all 0.3s ease;
}

.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

body.nav-open .hamburger { background: transparent; }
body.nav-open .hamburger::before { transform: rotate(45deg) translateY(0); top: 0; }
body.nav-open .hamburger::after { transform: rotate(-45deg) translateY(0); top: 0; }

/* ===== 7) SECTIONS & TYPOGRAPHY ===== */
.section {
  padding: var(--s7) 0;
}

.section-title {
  font-size: clamp(2rem, 2.5vw, 2.8rem);
  font-weight: 700;
  margin-bottom: var(--s5);
  letter-spacing: -0.01em;
}

.lead {
  max-width: 65ch;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.8;
}

/* ===== 8) HERO SECTION ===== */
.hero {
  padding: var(--s7) 0 var(--s6);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6);
  align-items: center;
}

.hero-content {
  order: 2;
}

.eyebrow {
  color: var(--a1);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--s2);
}

.name {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: var(--s3);
  line-height: 1.1;
}

.title-line {
  color: var(--text-muted);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  margin-bottom: var(--s4);
  min-height: 1.5em;
}

.hero-actions {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
  margin-bottom: var(--s4);
}

.socials {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
}

.socials a {
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s ease;
}

.socials a:hover {
  color: var(--a1);
  transform: translateY(-2px);
}

/* ===== 9) BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--a1);
  background: rgba(45, 212, 191, 0.08);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--a1);
  outline-offset: 2px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--a1), var(--a2));
  border: none;
  color: white;
  box-shadow: 0 0 24px rgba(45, 212, 191, 0.2);
}

.btn.primary:hover {
  box-shadow: 0 0 32px rgba(45, 212, 191, 0.3);
  filter: brightness(1.08);
}

.btn.outline {
  border: 2px solid var(--a1);
  background: transparent;
  color: var(--a1);
}

.btn.outline:hover {
  background: rgba(45, 212, 191, 0.08);
}

/* ===== 10) PROFILE CARD ===== */
.profile-card {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  padding: var(--s4);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--a1);
}

.photo-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.15);
}

.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  font-size: 2.5rem;
}

.photo-wrap.no-photo img { display: none; }
.photo-wrap.no-photo .photo-placeholder { display: flex; }

.profile-body {
  text-align: center;
}

.profile-body h2 {
  font-size: 1.3rem;
  margin-bottom: var(--s2);
}

.profile-body p {
  color: var(--text-muted);
  margin-bottom: var(--s3);
}

.profile-meta {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-meta a {
  color: var(--a1);
  transition: color 0.2s ease;
}

.profile-meta a:hover {
  color: var(--a2);
}

/* ===== 11) SKILL CHIPS ===== */
.skills-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s5);
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--s2) var(--s3);
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.skill-chip:hover {
  border-color: var(--a1);
  color: var(--text);
  background: rgba(45, 212, 191, 0.08);
  transform: translateY(-2px);
}

.skill-chip.active {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.2), rgba(245, 158, 11, 0.15));
  border-color: var(--a1);
  color: var(--text);
  box-shadow: var(--glow);
}

.skill-chip:focus-visible {
  outline: 2px solid var(--a1);
  outline-offset: 2px;
}

.skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s3);
}

.skill-item {
  padding: var(--s3);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  text-align: center;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: default;
  opacity: 1;
  max-height: 100px;
  overflow: hidden;
}

.skill-item.hidden {
  opacity: 0;
  max-height: 0;
  padding: 0;
  border: none;
}

.skill-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
  border-color: var(--a1);
}

/* ===== 12) PROJECT CARDS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s5);
}

.project-card {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, rgba(45, 212, 191, 0.1), transparent 50%, rgba(245, 158, 11, 0.08));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--a1);
}

.project-card:hover::before { opacity: 1; }
.project-card:hover .project-media img { transform: scale(1.05); }

.project-media {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.08), rgba(245, 158, 11, 0.05));
}

.project-spotlight {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.3), rgba(245, 158, 11, 0.15) 70%, transparent);
  filter: blur(30px);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
  transform: translate(-50%, -50%);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  position: relative;
  z-index: 0;
}

.project-body {
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-body h3 {
  font-size: 1.3rem;
  margin-bottom: var(--s2);
}

.project-points {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: auto;
}

.project-links {
  margin-top: var(--s3);
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
}

@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr 1fr;
  }

  .hero-content {
    order: 1;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== 13) EXPERIENCE & TIMELINE ===== */
.job {
  margin-bottom: var(--s5);
}

.job h3 {
  font-size: 1.2rem;
  margin-bottom: var(--s1);
}

.job-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--s3);
}

.job ul {
  padding-left: var(--s4);
  color: var(--text-muted);
  line-height: 1.8;
}

.job li {
  margin-bottom: var(--s2);
}

.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.timeline li {
  padding-left: var(--s5);
  position: relative;
  color: var(--text-muted);
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--a1);
  border: 3px solid var(--bg);
  box-shadow: var(--glow);
}

.timeline strong {
  color: var(--text);
  display: block;
  margin-bottom: var(--s1);
}

/* ===== 14) CONTACT FORM ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s5);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.contact-info p {
  color: var(--text-muted);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.contact-form label {
  display: flex;
  flex-direction: column;
}

.contact-form input,
.contact-form textarea {
  padding: var(--s2) var(--s3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

:root[data-theme="light"] .contact-form input::placeholder,
:root[data-theme="light"] .contact-form textarea::placeholder {
  color: rgba(71, 85, 105, 0.5);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  background: rgba(45, 212, 191, 0.06);
  border-color: var(--a1);
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.15);
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== 15) FOOTER ===== */
.site-footer {
  padding: var(--s5) 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  margin-top: var(--s7);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

.copy {
  font-size: 0.9rem;
}

/* ===== 16) REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1), transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .btn,
  .skill-chip,
  .project-card,
  .profile-card {
    transition: none;
    animation: none;
  }

  .blob {
    animation: none;
  }
}

/* ===== 17) ACCESSIBILITY ===== */
:focus {
  outline: none;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ===== 18) RESPONSIVE DESIGN ===== */
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .nav-list {
    position: fixed;
    right: var(--s3);
    top: 70px;
    background: rgba(11, 15, 20, 0.95);
    backdrop-filter: blur(10px);
    padding: var(--s3);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex-direction: column;
    display: none;
    gap: var(--s2);
    border: 1px solid var(--border);
    min-width: 180px;
    z-index: 99;
  }

  :root[data-theme="light"] .nav-list {
    background: rgba(250, 250, 249, 0.95);
  }

  body.nav-open .nav-list {
    display: flex;
  }

  .nav {
    margin-left: 0;
  }

  .hero-inner {
    gap: var(--s4);
  }

  .theme-text {
    display: none;
  }
}

@media (max-width: 768px) {
  .section {
    padding: var(--s6) 0;
  }

  .hero {
    padding: var(--s6) 0 var(--s5);
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

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

  .skills-list {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

@media (max-width: 480px) {
  .container {
    width: calc(100% - var(--s3));
  }

  .name {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
  }

  .section-title {
    font-size: clamp(1.5rem, 2vw, 1.8rem);
  }

  .photo-wrap {
    width: 100px;
    height: 100px;
  }

  .nav-list {
    right: var(--s2);
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
