/* =========================================================
   Tokens
   ========================================================= */
:root {
  --bg: #F1F3F8;
  --bg-glow-a: rgba(108, 130, 235, 0.28);
  --bg-glow-b: rgba(230, 170, 210, 0.20);
  --ink: #171A22;
  --ink-soft: #565C6B;
  --ink-faint: #8A90A0;
  --accent: #3E4EE8;
  --accent-ink: #EDEFFC;
  --line: rgba(23, 26, 34, 0.10);

  --glass-bg: rgba(255, 255, 255, 0.46);
  --glass-bg-strong: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-shadow: 0 8px 30px rgba(30, 34, 60, 0.10);
  --glass-blur: blur(18px);

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-full: 999px;

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --maxw: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161C;
    --bg-glow-a: rgba(94, 112, 235, 0.30);
    --bg-glow-b: rgba(200, 130, 190, 0.16);
    --ink: #F3F4F8;
    --ink-soft: #B7BBC8;
    --ink-faint: #7C8090;
    --accent: #8B97FF;
    --accent-ink: #10122A;
    --line: rgba(255, 255, 255, 0.10);
    --glass-bg: rgba(30, 32, 42, 0.46);
    --glass-bg-strong: rgba(30, 32, 42, 0.65);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  }
}

/* =========================================================
   Reset & base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -10% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(40% 45% at 15% 10%, var(--bg-glow-a), transparent 70%),
    radial-gradient(35% 40% at 85% 20%, var(--bg-glow-b), transparent 70%);
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

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

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

ul { list-style: none; margin: 0; padding: 0; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  z-index: 1000;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* =========================================================
   Content protection (visual layer only — see js/main.js
   for the accompanying event handling)
   ========================================================= */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

.protected-img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* =========================================================
   Glass surface
   ========================================================= */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* =========================================================
   Header / navigation
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1.25rem 1.5rem 0;
}

.nav-shell {
  max-width: var(--maxw);
  margin: 0 auto;
}

.nav-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.6rem 0.7rem 0.6rem 1.25rem;
  border-radius: var(--radius-full);
}

.nav-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  display: inline-block;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  color: var(--ink-soft);
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

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

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  max-width: var(--maxw);
  margin: 0.6rem auto 0;
  border-radius: var(--radius-lg);
  padding: 0.5rem;
}

.mobile-menu ul {
  display: flex;
  flex-direction: column;
}

.mobile-menu a {
  display: block;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
}

.mobile-menu a:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 44px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(62, 78, 232, 0.28);
}

.btn-ghost {
  color: var(--ink);
}

.btn-ghost:hover {
  transform: translateY(-1px);
}

.btn-small {
  padding: 0.6rem 1.1rem;
  font-size: 0.88rem;
  min-height: 38px;
}

/* =========================================================
   Layout helpers
   ========================================================= */
section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 6rem 1.5rem;
}

.section-heading {
  margin-bottom: 2.5rem;
}

.section-heading h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 3rem;
  padding-top: 5rem;
  padding-bottom: 6rem;
  min-height: 88vh;
}

.eyebrow-pill {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
}

.hero-copy h1 {
  font-size: clamp(2.6rem, 5.5vw, 4rem);
  margin-bottom: 0.5rem;
}

.hero-role {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.hero-intro {
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.hero-media {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-media-glow {
  position: absolute;
  inset: -12%;
  background: radial-gradient(60% 60% at 50% 40%, var(--bg-glow-a), transparent 70%);
  filter: blur(20px);
  z-index: 0;
}

.hero-image-frame {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-lg);
  padding: 0.6rem;
  width: min(360px, 80%);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.hero-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 8px);
}

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

.about-text {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-content: flex-start;
}

.skills-list li {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
}

/* =========================================================
   Projects
   ========================================================= */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.project-media {
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-media img {
  transform: scale(1.03);
}

.project-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.project-body h3 {
  font-size: 1.15rem;
}

.project-body p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  flex: 1;
}

.project-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* =========================================================
   Contact
   ========================================================= */
.contact-card {
  border-radius: var(--radius-lg);
  padding: 3.5rem;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.contact-card h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  margin-bottom: 0.9rem;
}

.contact-card > p {
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
}

.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 2rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.social-links a:hover {
  color: var(--ink);
  border-color: var(--line);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* =========================================================
   Responsive — tablet
   ========================================================= */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 3rem;
    text-align: left;
  }

  .hero-media { order: -1; margin-bottom: 1rem; }
  .hero-image-frame { width: min(280px, 60%); margin: 0 auto; }

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

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

/* =========================================================
   Responsive — mobile
   ========================================================= */
@media (max-width: 640px) {
  section { padding: 3.5rem 1.25rem; }

  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .nav-pill { padding: 0.55rem 0.55rem 0.55rem 1.1rem; }

  .hero { padding-top: 2rem; padding-bottom: 3rem; }
  .hero-actions .btn { flex: 1; }

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

  .contact-card { padding: 2.25rem 1.5rem; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
