@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&display=swap');

:root {
  --bg-light: #f5f5f5;
  --bg-soft-light: #ffffff;
  --card-light: #ffffff;
  --text-light: #333333;
  --muted-light: #666666;
  --brand-light: #000000;
  --accent-light: #d9d9d9;
  --ring-light: #cccccc;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.05);

  --bg-dark: #0f172a;
  --bg-soft-dark: #1e293b;
  --card-dark: #1e293b;
  --text-dark: #e2e8f0;
  --muted-dark: #94a3b8;
  --brand-dark: #60a5fa;
  --accent-dark: #38bdf8;
  --ring-dark: #334155;
  --shadow-dark: 0 4px 12px rgba(0, 0, 0, 0.1);

  /* Generic theme variables (default -> light). Use these throughout the stylesheet. */
  --bg: var(--bg-light);
  --bg-soft: var(--bg-soft-light);
  --card: var(--card-light);
  --text: var(--text-light);
  --muted: var(--muted-light);
  --brand: var(--brand-light);
  --accent: var(--accent-light);
  --ring: var(--ring-light);
  --shadow: var(--shadow-light);
}

/* Respect system preference for dark mode (optional). If user's OS prefers dark,
   the generic vars will switch to the dark palette. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--bg-dark);
    --bg-soft: var(--bg-soft-dark);
    --card: var(--card-dark);
    --text: var(--text-dark);
    --muted: var(--muted-dark);
    --brand: var(--brand-dark);
    --accent: var(--accent-dark);
    --ring: var(--ring-dark);
    --shadow: var(--shadow-dark);
  }
}

/* Opt-in class to force dark mode on the page */
body.dark-mode, .dark-mode {
  --bg: var(--bg-dark);
  --bg-soft: var(--bg-soft-dark);
  --card: var(--card-dark);
  --text: var(--text-dark);
  --muted: var(--muted-dark);
  --brand: var(--brand-dark);
  --accent: var(--accent-dark);
  --ring: var(--ring-dark);
  --shadow: var(--shadow-dark);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

body {
  overscroll-behavior-y: none;
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  letter-spacing: 0.02rem;
  overflow-x: hidden;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-soft);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 6px;
  border: 3px solid var(--bg-soft);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 1rem;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.2rem 1rem 2rem;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(140%) blur(8px);
  background: var(--bg);
  border-bottom: 1px solid var(--ring);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .8rem 1rem;
  z-index: 100;
}

.brand {
  font-weight: 700;
}

.nav a {
  margin: 0 1rem;
  color: var(--text);
  font-weight: 500;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

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

.menu-btn {
  display: none;
  background: none;
  border: 1px solid rgba(0,0,0,0.06);
  color: var(--text);
  padding: .3rem .5rem;
  border-radius: .6rem;
}

@media (max-width: 720px) {
  .nav {
    display: none;
  }

  .menu-btn {
    display: inline-block;
  }
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 2rem;
  align-items: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 .6rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 1.2rem;
}

.hero-cta {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
}

.hero-img {
  box-shadow: var(--shadow);
  border-radius: 1.2rem;
  width: 100%;
  height: 45vh;
  object-fit: cover;
  margin-bottom: 2rem;
  max-height: 60vh;
}

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

.btn {
  display: inline-block;
  background: var(--brand);
  color: #ffffff;
  padding: 0.8rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  transition: background 0.3s ease;
}

.btn:hover {
  background: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0,0,0,0.08);
}

/* Light mode button styles */
.light-mode .btn {
  background: #d3d3d3; /* Light gray background */
  color: #000000; /* Black text */
}

.light-mode .btn-ghost {
  background: var(--bg-light); /* Same as main background */
  color: #000000; /* Black text */
}

.cards h2 {
  margin-top: 2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--ring);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-body {
  padding: 1rem;
}

.card h3 {
  margin: .2rem 0 .4rem;
}

.pill {
  display: inline-block;
  margin-right: .4rem;
  margin-top: .4rem;
  padding: .2rem .5rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  font-size: .8rem;
  color: var(--muted);
}

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

.page {
  padding-top: 2rem;
}

.page>h1 {
  margin: 0 0 .6rem;
}

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

.project {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.2rem;
  margin: 2rem 0;
  padding: 1rem;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 1rem;
  background: rgba(0,0,0,0.02);
}

.project-media {
  order: 1;
}

.project-body {
  order: 2;
}

@media (max-width: 900px) {
  .project {
    grid-template-columns: 1fr;
  }
}

.about {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 900px) {
  .about {
    grid-template-columns: 1fr;
  }
}

.timeline {
  margin-top: 1rem;
  border-left: 2px solid rgba(255, 255, 255, .08);
  padding-left: 1.2rem;
}

.titem {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 1rem;
  margin: 1.4rem 0;
}

.tleft h3 {
  margin: .2rem 0;
}

.tright {
  margin: 0;
  padding-left: 1.1rem;
}

.tright li {
  margin: .4rem 0;
}

@media (max-width: 900px) {
  .titem {
    grid-template-columns: 1fr;
  }
}

.contact {
  margin-top: 3rem;
  text-align: center;
}

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--ring);
  padding: 1.2rem 1rem;
  background: var(--bg); /* Match the page background */
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner .mono {
  font-family: "Manrope", sans-serif;
  font-size: 1rem;
  color: var(--text);
}

.footer-inner p {
  margin: 0.5rem 0;
}

.socials a {
  margin-right: .8rem;
}

/* Add subtle animations */
* {
  transition: all 0.3s ease;
}

/* Animation for elements appearing on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Spacing adjustments */
section {
  padding: 4rem 2rem;
}

header, footer {
  padding: 2rem;
}

header {
  background: var(--bg);
  border-bottom: 1px solid var(--ring);
  padding: 2rem;
}

/* Helper class to force light mode on the page */
.light-mode, body.light-mode {
  --bg: var(--bg-light);
  --bg-soft: var(--bg-soft-light);
  --card: var(--card-light);
  --text: var(--text-light);
  --muted: var(--muted-light);
  --brand: var(--brand-light);
  --accent: var(--accent-light);
  --ring: var(--ring-light);
  --shadow: var(--shadow-light);
}

.light-mode header {
  background: var(--bg);
  border-bottom: none;
}

.light-mode .nav a {
  color: var(--text);
}

.light-mode .btn {
  background: #d3d3d3; /* Light gray background */
  color: #000000; /* Black text */
}

.light-mode .btn-ghost {
  background: var(--bg-light); /* Same as main background */
  color: #000000; /* Black text */
}

/* Footer background tweak for light mode */
.light-mode .site-footer {
  background: var(--bg);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Photography portfolio styles */
.photos-page {
  scroll-snap-type: y proximity; /* gentle snapping between sections */
}
.photo-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 6rem 1rem 3rem;
}
.photo-hero-left {
  flex: 1 1 40%;
}
.photo-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(3.5rem, 12vw, 8rem);
  line-height: 0.9;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text);
}
.photo-hero-right {
  flex: 1 1 55%;
}
.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 2rem 1rem 6rem;
  align-items: start;
}
.photo-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  display: block;
  text-decoration: none;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-card .caption {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  color: #fff;
  font-weight: 600;
  background: rgba(0,0,0,0.35);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.95rem;
}
.photo-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}
.photo-card.large { grid-column: span 2; grid-row: span 2; }
.photo-card.wide { grid-column: span 2; }

/* Photography adjustments: smaller photos, bio, one-screen row, and lightbox */
.photo-top {
  display: flex;
  gap: 2rem;
  align-items: center;
  padding: 3rem 1rem;
}
.bio-thumb img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.bio-copy {
  max-width: 720px;
}
.section-header {
  padding: 1.2rem 1rem 0.6rem;
}
.one-screen {
  padding: 1rem;
}
.scroll-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 1rem 2rem;
  scroll-snap-type: x proximity;
}
.photo-card-thumb {
  flex: 0 0 auto;
  width: 280px;
  border-radius: 10px;
  overflow: hidden;
  scroll-snap-align: start;
}
.photo-card-thumb img { width: 100%; height: 180px; object-fit: cover; display: block; }

/* make photos smaller in the main grid */
.photos-grid { gap: 0.8rem; }
.photo-card { height: 220px; }
.photo-card img { height: 100%; object-fit: cover; }
.photo-card .caption { font-size: 0.9rem; }

/* Modal / lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.lightbox[aria-hidden="false"] { display: flex; }
.lb-image {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  background: #000;
}
.lb-close {
  position: absolute;
  top: 24px;
  right: 28px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}

/* Scroll-snapped full-screen photography pages */
.photos-scroll {
  scroll-snap-type: y mandatory;
}
.screen {
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Hero screen */
.screen-hero { padding: 2rem; }
.hero-inner { display: flex; gap: 2rem; align-items: center; }
.hero-left { flex: 0 0 48%; }
.hero-right { flex: 1; }
.hero-portrait { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
.hero-title { font-family: 'Playfair Display', serif; font-size: clamp(3rem, 10vw, 7rem); margin: 0 0 1rem; }
.hero-bio { font-size: 1.05rem; color: var(--muted); }
.scroll-hint { text-align: center; margin-top: 2rem; color: var(--muted); font-size: .95rem; opacity: 0.7; transition: opacity 0.6s ease; }
body.scrolled .scroll-hint { opacity: 0; pointer-events: none; }

/* Project grid (study abroad + hobby) */
.screen-grid { padding: 3rem 2rem; }
.section-header h2 { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 1rem; }
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.project-card { position: relative; overflow: hidden; border-radius: 12px; }
.project-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-caption {
  position: absolute; left: 1rem; bottom: 1rem; color: #fff; background: rgba(0,0,0,0.35); padding: .5rem .8rem; border-radius: 999px; font-weight:600;
}
.project-card.wide { grid-column: span 2; }

/* Skills screen */
.screen-skills { padding: 3rem 2rem; }
.skills-inner { display: flex; gap: 2rem; align-items: flex-start; }
.skills-left { flex: 1; }
.skills-right { flex: 1; }
.tags { display:flex; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.tag { border:1px solid rgba(0,0,0,0.12); padding: .45rem .8rem; border-radius: 999px; font-size: .95rem; }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { flex-direction: column-reverse; }
  .hero-left, .hero-right { width: 100%; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .project-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: clamp(2rem, 10vw, 4rem); }
  .skills-inner { flex-direction: column; }
}

/* New photography hero section styles */
.photography-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.photography-hero .hero-img {
  flex: 0 0 420px;
  width: 420px;
  height: 320px;
  object-fit: cover;
  border-radius: 1.2rem;
  box-shadow: var(--shadow);
}

.photography-hero .hero-text {
  flex: 1;
  font-size: 1.15rem;
  color: var(--text);
}

@media (max-width: 900px) {
  .photography-hero {
    flex-direction: column;
    gap: 1.5rem;
  }
  .photography-hero .hero-img {
    width: 100%;
    height: 220px;
    max-width: 100%;
  }
}
