@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Source+Serif+4:ital,wght@0,400;1,400&display=swap');
/* ...font-face rules remain unchanged... */

:root {
    --bg: #181818;
    --text: #e7e7e7;
    --muted: #cfcfcf;
    --shadow: rgba(0, 0, 0, 0.55);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-strong: rgba(255, 255, 255, 0.14);
    --card-border: rgba(255, 255, 255, 0.25);
    --rule: rgba(255, 255, 255, 0.35);
    --container: 1100px;
}

html.light-mode {
  --bg: #f7f7f7;
  --text: #181818;
  --muted: #444;
  --shadow: rgba(0,0,0,0.08);
  --glass: rgba(0,0,0,0.04);
  --glass-strong: rgba(0,0,0,0.08);
  --card-border: rgba(0,0,0,0.10);
  --rule: rgba(0,0,0,0.10);
}


* { box-sizing: border-box; }
html { height: 100%; }
body { min-height: 100%; }
html {
	/* Use a single document scrollbar (avoid double-scrollbar look) */
	overflow-y: auto;
	background: var(--bg);
	color-scheme: dark;
}
html.light-mode {
	color-scheme: light;
}
body {
  margin: 0;
  font-family: 'Inter', system-ui, Segoe UI, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-y: visible;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* Smooth theme transitions (avoid sudden flashes)
   Enabled only after JS marks the page as ready, so navigation doesn't animate. */
html.theme-ready body {
  transition: background-color 220ms ease, color 220ms ease;
}
html.theme-ready .site-header,
html.theme-ready .divider,
html.theme-ready .nav,
html.theme-ready .brand,
html.theme-ready .links a,
html.theme-ready .footer,
html.theme-ready .card,
html.theme-ready .card-media,
html.theme-ready .project-card,
html.theme-ready .project-card .img-overlay,
html.theme-ready .icon,
html.theme-ready .socials .icon img,
html.theme-ready .contact-container .icon img,
html.theme-ready .theme-toggle .theme-icon img {
  transition:
    background-color 220ms ease,
    color 220ms ease,
    border-color 220ms ease,
    opacity 220ms ease,
    filter 220ms ease;
}

@media (prefers-reduced-motion: reduce) {
  html.theme-ready body,
  html.theme-ready .site-header,
  html.theme-ready .divider,
  html.theme-ready .nav,
  html.theme-ready .brand,
  html.theme-ready .links a,
  html.theme-ready .footer,
  html.theme-ready .card,
  html.theme-ready .card-media,
  html.theme-ready .project-card,
  html.theme-ready .project-card .img-overlay,
  html.theme-ready .icon,
  html.theme-ready .socials .icon img,
  html.theme-ready .contact-container .icon img,
  html.theme-ready .theme-toggle .theme-icon img {
    transition: none !important;
  }
}

/* Some pages are short; keep a consistent scrollbar without reintroducing the home-page gutter issue */
html:has(body.contact-page) {
	overflow-y: scroll;
}

html:has(body.force-scroll) {
  overflow-y: scroll;
}

@supports not selector(html:has(body.contact-page)) {
  body.contact-page {
    min-height: 101vh;
  }
}

@supports not selector(html:has(body.force-scroll)) {
  body.force-scroll {
    min-height: 101vh;
  }
}

/* Headings: Inter, negative letter-spacing, neutral weight */
h1, h2, h3, h4, h5, h6, .project-title-centered {
  font-family: 'Inter', system-ui, Segoe UI, Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
  font-weight: 500;
}

/* Editorial/long-form text: Source Serif 4 */
.editorial, .about-content, .long-desc, .project-desc.serif {
  font-family: 'Source Serif 4', Georgia, Times, 'Times New Roman', serif;
  font-size: 1.13em;
  line-height: 1.65;
  font-weight: 400;
}

/* Default project-desc remains sans-serif unless .serif is added */

.background {
    position: fixed;
    inset: 0;
    background: url('base2.png') center/cover no-repeat fixed;
    filter: grayscale(100%) contrast(1.05) brightness(0.85);
    z-index: -2;
}

.background::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 60% at 50% 10%, rgba(255,255,255,0.35), rgba(255,255,255,0) 60%),
        radial-gradient(120% 80% at 50% 100%, rgba(0,0,0,0.75), rgba(0,0,0,0.1) 60%);
    pointer-events: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.site-header { position: sticky; top: 0; backdrop-filter: blur(4px); z-index: 10; }
.nav {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 24px;
    padding: 22px 0 10px;
}
.brand {
  font-family: 'Inter', system-ui, Segoe UI, Helvetica, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.12em;
  font-size: 24px;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.92;
}
.links { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.links a { color: var(--text); text-decoration: none; font-size: 20px; opacity: 0.9; }

.clock {
  margin-left: auto;
  font-size: 20px;
  letter-spacing: 0.03em;
  opacity: 0.9;
  width: 7ch;
  text-align: right;
  display: inline-block;
}
.divider { height: 1px; background: var(--rule); opacity: 0.6; }

.hero { text-align: center; padding: clamp(70px, 14vw, 140px) 0 40px; }
.hero h1 { font-size: clamp(42px, 8vw, 82px); line-height: 1.05; margin: 0; }

.projects { text-align: center; position: relative; margin-top: clamp(200px, 40vw, 400px); }
.projects-page .projects { margin-top: clamp(40px, 10vw, 120px); }
.projects-page .projects.container { max-width: none; }
.projects-page .cards {
    display: block;
    overflow: visible;
    padding-bottom: 0;
    column-count: 5;
    column-gap: 18px;
    width: 100%;
    margin: 0 auto;
}
@media (min-width: 1800px) { .projects-page .cards { column-count: 7; column-gap: 22px; } }
@media (min-width: 1500px) and (max-width: 1799.98px) { .projects-page .cards { column-count: 6; column-gap: 20px; } }
@media (min-width: 1200px) and (max-width: 1499.98px) { .projects-page .cards { column-count: 5; } }
@media (min-width: 900px) and (max-width: 1199.98px) { .projects-page .cards { column-count: 4; column-gap: 18px; } }
@media (min-width: 600px) and (max-width: 899.98px) { .projects-page .cards { column-count: 3; column-gap: 16px; } }
@media (max-width: 599.98px) { .projects-page .cards { column-count: 2; column-gap: 14px; } }
.projects-page .projects.container { padding-inline: 24px; }
.projects-page .card {
    width: 100%;
    display: inline-block;
    margin: 0 0 18px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 16px;
    overflow: hidden;
}
.projects-page .card-media { aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; }
.projects-page .card-media img { height: 100%; width: 100%; object-fit: cover; display: block; border-radius: 16px; transition: transform .2s ease, filter .2s ease; }
.projects-page .card.square .card-media { aspect-ratio: 1 / 1; }
.projects-page .cards .card:nth-child(3n) .card-media { aspect-ratio: 1 / 1; }
.projects-page .cards .card:nth-child(10n+5) .card-media { aspect-ratio: 2 / 3; }
.projects-page .cards .card:nth-child(8n+4) .card-media { aspect-ratio: 4 / 5; }
.projects-page .card-body { display: none; }

/* Social icons: white in dark mode, dark in light mode */
.socials .icon img {
  filter: invert(1) brightness(1.05);
}
html.light-mode .socials .icon img {
  filter: invert(1) brightness(0.5) contrast(1.2) !important;
}

/* Contact icons are separate from the socials section */
html.light-mode .contact-container .icon img {
  filter: invert(1) brightness(0.5) contrast(1.2) !important;
}
.projects h2 { font-size: clamp(28px, 5vw, 48px); margin: 0 0 22px; }
.cards {
  display: flex;
  flex-wrap: nowrap;
  gap: 32px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cards::-webkit-scrollbar { display: none; }
.card {
  display: grid; grid-template-rows: auto 1fr;
  text-decoration: none; color: var(--text);
  width: clamp(180px, 22vw, 240px);
  flex: 0 0 auto;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--card-border);
  box-shadow: none;
  overflow: hidden;
  text-align: center;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  margin-right: 8px;
}
.card-media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--glass); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; filter: contrast(0.95) brightness(0.9); -webkit-user-drag: none; }
.card-body { padding: 10px 12px 14px; text-align: center; }
.card-title { margin: 0 0 6px; font-size: clamp(16px, 2.6vw, 22px); font-weight: 300; }
.card-desc { margin: 0; color: var(--muted); font-size: clamp(12px, 2.2vw, 14px); line-height: 1.35; }


.currently { text-align: center; margin-top: 48px; }
.currently .rule { height: 2px; background: var(--rule); opacity: 0.5; margin: 26px 0; width: 100%; border: none; }
.currently h3 { font-size: clamp(24px, 3.8vw, 40px); font-weight: 300; margin: 0 0 4px; }
.currently p { margin: 6px 0; font-size: clamp(18px, 2.7vw, 28px); color: var(--muted); }
.currently .school { font-size: clamp(20px, 3.2vw, 32px); color: var(--text); }

.socials { text-align: center; margin-top: 8px; }
.socials h3 { font-size: clamp(24px, 3.8vw, 40px); font-weight: 300; margin: 8px 0 18px; }
.icons { display: flex; justify-content: center; gap: 22px; }
.icon { color: var(--text); width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: transparent; border: none; box-shadow: none; backdrop-filter: none; }
/* Theme toggle button styles */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1em;
  margin-left: 0.5em;
  cursor: pointer;
  padding: 0.08em 0.18em;
    border-radius: 0;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    max-width: 32px;
    max-height: 32px;
}
.theme-toggle .theme-icon {
  width: 22px;
  height: 22px;
  display: block;
  background: none;
  padding: 0;
}
  .theme-toggle:focus {
    outline: none;
    background: none;
  }
  .theme-toggle:hover {
    background: none;
  }

.socials .rule { height: 2px; background: var(--rule); opacity: 0.5; margin: 26px 0; width: 100%; border: none; }

.footer { text-align: center; color: var(--muted); padding: 10px 0 30px; font-size: 16px; }

@media (max-width: 900px) {
    .links { gap: 18px; }
    .cards { gap: 22px; }
    .card img { height: 100%; }
	.container { padding-inline: 16px; }
}

.home-page .hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70vh;
}



.about-page .background,
.projects-page .background {
  display: none;
}

.projects-page {
  background: var(--bg);
}
.masonry-board {
  background: var(--bg);
}

.nav .links a {
  position: relative;
  overflow: hidden;
  transition: color 0.18s;
}
.nav .links a::after {
  content: '';
  position: absolute;
  right: 0;
  left: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
}
.nav .links a:hover::after,
.nav .links a:focus-visible::after {
  transform: scaleX(1);
  left: 0;
  right: 0;
  transform-origin: left;
}

.cards-track {
  overflow: visible;
  gap: 1.5em;
}
.cards-track .card {
  position: relative;
  transition: box-shadow 0.22s cubic-bezier(.4,0,.2,1), border-color 0.22s cubic-bezier(.4,0,.2,1);
  z-index: 1;
  border: none;
  box-shadow: none;
  outline: none;
  border-radius: 0;
}

.project-card {
  background: var(--glass);
  border: 1px solid var(--card-border);
  color: var(--text);
  box-shadow: none;
  outline: none;
.project-card .img-overlay {
  background: linear-gradient(to bottom, var(--shadow, rgba(0,0,0,0.08)) 0%, var(--glass-strong, rgba(0,0,0,0.08)) 60%, var(--glass, rgba(0,0,0,0.04)) 100%);
}
}

.cards-track .card-media img {
  filter: none;
  transition: filter 0.22s cubic-bezier(.4,0,.2,1);
}

.cards[data-source="projects"] {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  transform: none;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
  border-radius: 0;
  grid-template-columns: none;
  gap: 0;
  background: none;
  box-shadow: none;
  overflow-x: visible;
}

/* Home page infinite projects scroller: no card background fill */
.cards[data-source="projects"] .card {
	background: transparent;
	border: none;
}
.cards[data-source="projects"] .card-media {
	background: transparent;
}

.projects[data-source="projects"], section.projects[data-source="projects"] {
  padding-left: 0;
  padding-right: 0;
}

body, html {
  overflow-x: hidden;
}

.cards[data-source="projects"] {
  overflow-x: hidden;
}

.projects-page .project-card:focus-visible,
.projects-page .project-card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: none;
  outline: none;
}
.projects-page .project-card::after {
  display: none;
  content: none;
  box-shadow: none;
  border: none;
}

.project-card.wide .img-wrap {
  aspect-ratio: 3/2;
}
.project-card.tall .img-wrap {
  aspect-ratio: 2/3;
}
.project-card.default .img-wrap,
.project-card:not(.square):not(.tall):not(.wide):not(.default) .img-wrap {
  aspect-ratio: 16/10;
}

.projects-grid .project-card .img-wrap {
  height: auto;
  min-height: 0;
  max-height: none;
}

.project-card.square .img-wrap {
  aspect-ratio: 1/1;
}
.project-card.tall .img-wrap {
  aspect-ratio: 2/3;
}
.project-card.wide .img-wrap {
  aspect-ratio: 3/2;
}
.project-card.default .img-wrap,
.project-card:not(.square):not(.tall):not(.wide):not(.default) .img-wrap {
  aspect-ratio: 16/10;
}

@media (max-width: 600px) {
  .clock {
    display: none !important;
  }
}