/* ==================================================
   STUDENT PORTFOLIO — STYLESHEET
   Design direction: modern, Apple/Stripe-inspired —
   generous whitespace, restrained color, tight
   headline tracking, soft depth via shadow not border.

   Table of contents:
   1. Design tokens (light + dark themes)
   2. Reset & base styles
   3. Layout helpers
   4. Navigation + theme toggle
   5. Hero section
   6. About section
   7. Skills section
   8. Projects section
   9. Education timeline
   10. Contact section
   11. Footer
   12. Buttons & shared components
   13. Scroll animations
   14. Responsive breakpoints
================================================== */

/* --------------------------------------------------
   1. DESIGN TOKENS
   Light theme lives on :root. Dark theme overrides
   the same variable names under [data-theme="dark"],
   so every component below only has to be written once.
-------------------------------------------------- */
:root {
  /* Colors — light */
  --bg: #FFFFFF;
  --bg-elevated: #FBFBFD;
  --bg-alt: #F5F5F7;
  --ink: #1D1D1F;
  --ink-soft: #6E6E73;
  --ink-faint: #A1A1A6;
  --accent: #635BFF;
  --accent-dark: #4B44D6;
  --accent-soft: #EEEDFF;
  --line: #E5E5EA;
  --card-bg: #FFFFFF;
  --editor-bg: #16161D;
  --shadow-color: 220 20% 20%;

  /* Typography */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing scale — generous, Apple/Stripe-like rhythm */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5.5rem;
  --space-2xl: 8.5rem;

  /* Layout */
  --max-width: 1180px;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  color-scheme: light;
}

/* Dark theme overrides — same variable names, new values */
[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #0A0A0C;
  --bg-alt: #17171B;
  --ink: #F5F5F7;
  --ink-soft: #A1A1A6;
  --ink-faint: #6E6E73;
  --accent: #8B85FF;
  --accent-dark: #A8A3FF;
  --accent-soft: #211F3D;
  --line: #29292E;
  --card-bg: #131316;
  --editor-bg: #000000;
  --shadow-color: 240 60% 2%;

  color-scheme: dark;
}

/* --------------------------------------------------
   2. RESET & BASE STYLES
-------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

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

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

ul, ol {
  list-style: none;
}

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

/* Visible keyboard focus for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .fade-up {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------
   3. LAYOUT HELPERS
-------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: var(--space-2xl) 0;
}

.section--alt {
  background: var(--bg-alt);
  transition: background-color 0.35s ease;
}

.section__title {
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  margin: 0.6rem 0 var(--space-lg);
  max-width: 24ch;
  font-weight: 600;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

/* --------------------------------------------------
   4. NAVIGATION + THEME TOGGLE
-------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

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

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav__links a {
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.nav__links a:hover {
  color: var(--ink);
}

.nav__cta {
  background: var(--ink);
  color: var(--bg) !important;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  transition: opacity 0.2s ease;
}

.nav__cta:hover {
  opacity: 0.8;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme toggle button */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.35s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle__icon {
  width: 18px;
  height: 18px;
}

/* Show moon in light mode (click to go dark), sun in dark mode */
.theme-toggle__icon--sun { display: none; }
.theme-toggle__icon--moon { display: block; }

[data-theme="dark"] .theme-toggle__icon--sun { display: block; }
[data-theme="dark"] .theme-toggle__icon--moon { display: none; }

/* Mobile hamburger toggle (hidden on desktop) */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.35s ease;
}

/* --------------------------------------------------
   HEADER / BANNER IMAGE
   A full-width editable cover image above the hero.
-------------------------------------------------- */
.header-banner {
  padding-top: var(--space-lg);
}

.header-banner__img {
  width: 100%;
  height: clamp(160px, 26vw, 340px);
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px -24px hsl(var(--shadow-color) / 0.35);
}

/* --------------------------------------------------
   5. HERO SECTION
-------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
  padding: var(--space-xl) 2rem var(--space-2xl);
  min-height: calc(100vh - 76px - 200px);
}

.hero__name {
  font-size: clamp(3rem, 6vw, 4.75rem);
  margin: 0.75rem 0 0.3rem;
  letter-spacing: -0.035em;
}

.hero__role {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--ink-soft);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

.hero__intro {
  color: var(--ink-soft);
  max-width: 50ch;
  font-size: 1.08rem;
  margin-bottom: var(--space-lg);
}

.hero__cta {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Mock code editor — the hero's signature visual */
.hero__visual {
  perspective: 1000px;
}

.editor {
  background: var(--editor-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 2px 6px hsl(var(--shadow-color) / 0.08),
    0 30px 60px -20px hsl(var(--shadow-color) / 0.45);
  transform: rotate(1.2deg);
  transition: box-shadow 0.35s ease;
}

.editor__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.04);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot--red { background: #FF5F57; }
.dot--yellow { background: #FEBC2E; }
.dot--green { background: #28C840; }

.editor__filename {
  margin-left: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

.editor__code {
  padding: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.9;
  overflow-x: auto;
  color: #C6C9E8;
}

.tok-key { color: #C792EA; }
.tok-var { color: #82AAFF; }
.tok-prop { color: #89DDFF; }
.tok-str { color: #C3E88D; }
.tok-bool { color: #F78C6C; }

/* --------------------------------------------------
   6. ABOUT SECTION
-------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: var(--space-2xl);
  align-items: center;
}

.about__image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px -28px hsl(var(--shadow-color) / 0.4);
}

.about__text {
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1.75;
}

/* --------------------------------------------------
   7. SKILLS SECTION
-------------------------------------------------- */
.skills__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.8rem 1.5rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.35s ease;
}

.skill-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 24px -14px hsl(var(--shadow-color) / 0.4);
}

.skill-card__label {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}

/* --------------------------------------------------
   8. PROJECTS SECTION
-------------------------------------------------- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.35s ease, border-color 0.35s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 50px -24px hsl(var(--shadow-color) / 0.35);
  border-color: transparent;
}

/* Placeholder image box — swap the <img> src for a real screenshot */
.project-card__img {
  height: 190px;
  overflow: hidden;
  background: var(--bg-alt);
}

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

.project-card:hover .project-card__img img {
  transform: scale(1.04);
}

.project-card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card__title {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.project-card__desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
  flex: 1;
  line-height: 1.65;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: var(--space-md);
}

.tag-row li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
}

.project-card__links {
  display: flex;
  gap: 0.75rem;
}

.link-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--ink);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s ease, background-color 0.35s ease, color 0.35s ease;
}

.link-btn:hover {
  opacity: 0.8;
}

.link-btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.link-btn--ghost:hover {
  background: var(--bg-alt);
  opacity: 1;
}

/* --------------------------------------------------
   9. EDUCATION TIMELINE
-------------------------------------------------- */
.timeline {
  position: relative;
  max-width: 640px;
  padding-left: var(--space-lg);
  border-left: 2px solid var(--line);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-xl);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__marker {
  position: absolute;
  left: calc(-1 * var(--space-lg) - 6px);
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg-alt);
  transition: box-shadow 0.35s ease;
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.timeline__title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.timeline__desc {
  color: var(--ink-soft);
  max-width: 52ch;
  line-height: 1.7;
}

/* --------------------------------------------------
   10. CONTACT SECTION
-------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.contact__intro {
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0.85rem 0 var(--space-lg);
  font-size: 1.05rem;
  line-height: 1.7;
}

.contact__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact__list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-sm);
  transition: border-color 0.35s ease;
}

.contact__list a {
  font-weight: 600;
  font-size: 1.05rem;
  transition: color 0.2s ease;
}

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

.contact__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.contact__form {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.contact__form label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: var(--space-xs);
}

.contact__form input,
.contact__form textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s ease, background-color 0.35s ease, color 0.35s ease;
}

.contact__form input::placeholder,
.contact__form textarea::placeholder {
  color: var(--ink-faint);
}

.contact__form input:focus,
.contact__form textarea:focus {
  border-color: var(--accent);
}

.contact__form .btn {
  margin-top: var(--space-sm);
  align-self: flex-start;
}

/* --------------------------------------------------
   11. FOOTER
-------------------------------------------------- */
.footer {
  text-align: center;
  padding: var(--space-lg) 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink-faint);
  transition: border-color 0.35s ease;
}

/* --------------------------------------------------
   12. BUTTONS & SHARED COMPONENTS
-------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.9rem 1.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

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

.btn--primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -14px hsl(var(--shadow-color) / 0.55);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

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

/* Back to top floating button */
.back-to-top {
  position: fixed;
  right: 1.75rem;
  bottom: 1.75rem;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  box-shadow: 0 12px 24px -14px hsl(var(--shadow-color) / 0.4);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease, background-color 0.35s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------
   13. SCROLL ANIMATIONS
   Elements start hidden/shifted, then script.js adds
   the .is-visible class when they scroll into view.
-------------------------------------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* --------------------------------------------------
   14. RESPONSIVE BREAKPOINTS
-------------------------------------------------- */

/* Tablet */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
    min-height: auto;
  }

  .hero__visual {
    order: -1;
  }

  .editor {
    transform: rotate(0deg);
  }

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

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

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

  .about__image img {
    max-width: 320px;
    margin: 0 auto;
  }

  :root {
    --space-2xl: 6rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .nav__links {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, background-color 0.35s ease;
  }

  .nav__links.is-open {
    max-height: 320px;
    padding: var(--space-sm) 0;
  }

  .nav__links a {
    width: 100%;
    padding: 0.9rem 2rem;
  }

  .nav__cta {
    margin: 0.5rem 2rem;
    border-radius: var(--radius-sm);
    text-align: center;
  }

  .nav__toggle {
    display: flex;
  }

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

  .hero__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__cta .btn {
    text-align: center;
  }

  .section {
    padding: var(--space-xl) 0;
  }

  :root {
    --space-2xl: 4.5rem;
    --space-xl: 3.5rem;
  }
}
