*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #faf9f7;
  --bg-card: #ffffff;
  --text: #1c1917;
  --text-secondary: #78716c;
  --accent: #b45309;
  --accent-light: #f59e0b;
  --border: #e7e5e4;
  --border-light: #f5f5f4;
  --shadow-sm: 0 1px 3px rgba(28,25,23,0.04), 0 1px 2px rgba(28,25,23,0.06);
  --shadow-md: 0 4px 16px rgba(28,25,23,0.06), 0 2px 6px rgba(28,25,23,0.04);
  --shadow-lg: 0 12px 40px rgba(28,25,23,0.1), 0 4px 12px rgba(28,25,23,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Manrope', -apple-system, sans-serif;
  --max-width: 1200px;
  --nav-height: 72px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* ─── NAV ─── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(250,249,247,0.85);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  z-index: 1000;
  border-bottom: 1px solid rgba(231,229,228,0.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.nav.scrolled {
  box-shadow: 0 1px 12px rgba(28,25,23,0.06);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 3px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.7; }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.3s;
  position: relative;
  padding-bottom: 4px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.3s ease, left 0.3s ease;
  border-radius: 1px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; left: 0; }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { width: 100%; left: 0; }

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}
.hamburger span {
  width: 24px; height: 1.5px;
  background: var(--text);
  transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -5px); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(250,249,247,0.98);
  backdrop-filter: blur(24px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.3s, transform 0.3s;
}
.mobile-menu a:hover, .mobile-menu a.active { color: var(--text); transform: translateX(4px); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}

/* ─── PAGE CONTAINER ─── */
.page { padding-top: var(--nav-height); min-height: 100vh; }

/* ─── HOME ─── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 32px 48px;
}
.hero-img {
  width: 160px; height: 160px;
  object-fit: cover;
  border-radius: 50%;
  filter: brightness(0.92);
  box-shadow: 0 8px 32px rgba(28,25,23,0.12);
  border: 3px solid var(--bg-card);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}
.hero-img:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 40px rgba(28,25,23,0.16);
}
.hero-overlay {
  text-align: center;
  margin-top: 28px;
  color: var(--text);
}
.hero-overlay h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 400;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.hero-overlay p {
  font-size: clamp(14px, 1.8vw, 16px);
  font-weight: 400;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  max-width: 420px;
  line-height: 1.7;
}

/* Home grid */
.home-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 32px 80px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.home-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}
.home-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.home-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
}
.home-card:hover img {
  transform: scale(1.06);
  filter: brightness(0.7);
}
.home-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28,25,23,0);
  transition: background 0.4s ease;
}
.home-card:hover .home-card-overlay {
  background: rgba(28,25,23,0.15);
}
.home-card-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px 24px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: white;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transform: translateY(4px);
  opacity: 0.9;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.home-card:hover .home-card-label {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 600px) {
  .home-grid { grid-template-columns: 1fr; padding: 40px 20px; gap: 16px; }
}

/* ─── FOOTER ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 56px 32px 48px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  transition: color 0.3s;
}
.footer-links a:hover { color: var(--text); }
.footer-links a svg { width: 16px; height: 16px; }
.footer-location {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ─── PROJECTS ─── */
.projects-header {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 32px 40px;
  text-align: center;
}
.projects-header h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
  margin-bottom: 16px;
  letter-spacing: 1px;
}
.projects-header p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.project-card {
  max-width: 800px;
  margin: 0 auto 40px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.project-card h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.project-card img {
  width: 100%;
  height: clamp(150px, 24vw, 220px);
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.project-card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 16px;
}
.project-card a.github-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  padding: 8px 0;
  border-bottom: 1.5px solid var(--accent);
  transition: gap 0.3s ease, opacity 0.3s;
}
.project-card a.github-link:hover { gap: 10px; }

@media (max-width: 640px) {
  .project-card {
    margin-bottom: 28px;
    padding: 22px;
  }

  .project-card h3 {
    font-size: 24px;
  }

  .project-card img {
    height: 140px;
  }
}

.notes-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 88px 32px 32px;
  text-align: center;
}
.notes-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.notes-hero h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.notes-intro {
  max-width: 720px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.8;
}

.notes-shell {
  max-width: 900px;
  margin: 0 auto 72px;
  padding: 0 32px;
}
.notes-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}
.notes-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.6px;
}
.notes-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 36px;
}
.notes-raw {
  margin: 0;
  white-space: pre-wrap;
  overflow-x: auto;
  tab-size: 4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
}
.notes-raw code {
  font-family: inherit;
  font-size: inherit;
}
.notes-section + .notes-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}
.notes-section h2 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  margin-bottom: 14px;
}
.notes-section p,
.notes-section li {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
}
.notes-section ul {
  padding-left: 20px;
}
.notes-section pre {
  overflow-x: auto;
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: #1f1b16;
  color: #f8f5f1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.notes-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94em;
}

@media (max-width: 700px) {
  .notes-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .notes-content {
    padding: 24px;
  }

  .notes-section h2 {
    font-size: 24px;
  }
}

/* ─── PHOTOGRAPHY ─── */
.photo-hero {
  position: relative;
  height: 70vh;
  min-height: 400px;
  overflow: hidden;
}
.photo-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.75);
  transition: transform 8s ease;
}
.photo-hero:hover img {
  transform: scale(1.03);
}
.photo-hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 72px 48px;
  background: linear-gradient(transparent 0%, rgba(0,0,0,0.55) 100%);
  color: white;
}
.photo-hero-overlay h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 400;
  font-style: italic;
  margin-bottom: 16px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.2);
}
.photo-hero-overlay p {
  max-width: 520px;
  font-size: 15px;
  line-height: 1.8;
  font-weight: 300;
  opacity: 0.9;
}

.photo-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 32px 40px;
}
.photo-section h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 36px;
  color: var(--text-secondary);
  position: relative;
  display: inline-block;
}
.photo-section h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Masonry photo grid */
.photo-grid {
  display: flex;
  gap: 14px;
}
.photo-grid .photo-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.photo-grid img {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
  box-shadow: var(--shadow-sm);
  background: var(--bg);
}
.photo-grid img:hover {
  filter: brightness(0.88);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 900px) {
  .photo-grid { gap: 10px; }
  .photo-grid .photo-col { gap: 10px; }
}
@media (max-width: 500px) {
  .photo-grid { gap: 8px; }
  .photo-grid .photo-col { gap: 8px; }
  .photo-grid img { border-radius: 6px; }
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10,10,8,0.95);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox.visible { opacity: 1; }
.lightbox img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.lightbox.visible img { transform: scale(1); }
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  color: white;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
  font-family: var(--sans);
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.lightbox-close:hover { opacity: 1; transform: scale(1.1); }

/* ─── MUSIC ─── */
.music-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - 120px);
  padding: 80px 32px;
  text-align: center;
}
.music-page .piano-img {
  width: 100%;
  max-width: 680px;
  margin-bottom: 56px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.music-page h1 {
  font-family: var(--serif);
  font-size: clamp(24px, 3.5vw, 38px);
  font-weight: 400;
  line-height: 1.55;
  max-width: 700px;
  margin-bottom: 24px;
}
.music-page h1 em { font-style: italic; }
.music-page h1 strong { font-weight: 600; }
.music-page p.music-sub {
  font-family: var(--serif);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
}

/* ─── FLYING ─── */
.flying-hero {
  position: relative;
  height: 80vh;
  min-height: 450px;
  overflow: hidden;
}
.flying-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.75);
  transition: transform 8s ease;
}
.flying-hero:hover img { transform: scale(1.03); }
.flying-hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 72px 48px;
  background: linear-gradient(transparent 0%, rgba(0,0,0,0.55) 100%);
  color: white;
}
.flying-hero-overlay h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 300;
  letter-spacing: 3px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.flying-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 64px 32px;
}
.flying-content p {
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.flying-content blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.7;
  border-left: 2.5px solid var(--accent);
  padding-left: 28px;
  margin: 48px 0;
  color: var(--text);
}
.flying-content .bq-attribution {
  font-family: var(--sans);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 14px;
}
.flying-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 56px 0;
}

.flying-img-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 40px 0;
}
.flying-img-row.single { grid-template-columns: 1fr; }
.flying-img-item img {
  width: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.flying-img-item img:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.flying-img-item .caption {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
  font-style: italic;
  letter-spacing: 0.2px;
}

@media (max-width: 600px) {
  .flying-img-row { grid-template-columns: 1fr; }
}

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}
.page-transition {
  animation: pageSlide 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes pageSlide {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.35s; }

/* Image fade-in on load */
.img-reveal {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.img-reveal.loaded { opacity: 1; }
