* { box-sizing: border-box; }

:root {
  --bg: #0A2238;
  --bg-deep: #06202F;
  --ink: #EAF2F6;
  --ink-soft: #B9CEDA;
  --ink-mute: #8FAFC2;
  --accent: #4EC5D9;
  --card: #10314A;
  --border: rgba(234,242,246,0.12);
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 900px 700px at 15% -8%, rgba(79,168,216,0.28), transparent 60%),
    radial-gradient(ellipse 1000px 800px at 100% 110%, rgba(20,90,120,0.35), transparent 55%),
    var(--bg);
  color: var(--ink);
}

body { font-family: 'Work Sans', sans-serif; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg-deep); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 48px;
  background: rgba(10,34,56,0.55);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-family: 'Ogg', serif; font-style: italic; font-size: 34px; font-weight: 100; color: var(--accent); line-height: 1; }
.nav-links { display: flex; gap: 34px; }
.nav-link { font-size: 14px; font-weight: 500; letter-spacing: 0.02em; }
.nav-link.is-active { color: var(--accent); }
.nav-toggle { display: none; background: none; border: none; color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: 0.05em; cursor: pointer; }

.mobile-menu {
  position: fixed; inset: 0; background: var(--bg-deep); z-index: 600;
  display: none; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 22px; padding: 48px;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu-link { font-size: 38px; font-weight: 700; }
.mobile-menu-close { position: absolute; top: 26px; right: 32px; background: none; border: none; color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: 0.05em; cursor: pointer; }

/* Layout helpers */
main { position: relative; }
.page-wide, .page-medium, .page-narrow { margin: 0 auto; padding: 150px 48px 100px; }
.page-wide { max-width: 1400px; }
.page-medium { max-width: 1200px; }
.page-narrow { max-width: 1000px; }
.page-header { margin-bottom: 60px; }
.page-title { font-family: 'Work Sans', sans-serif; font-size: clamp(38px,6vw,80px); font-weight: 700; margin: 0; }
.page-lead { font-size: 17px; color: var(--ink-soft); max-width: 560px; margin: 0; }
.script-title { font-family: 'Ogg', serif; font-style: italic; font-weight: 100; font-size: clamp(48px,7vw,80px); margin: 0; color: var(--accent); }
.script-title-lg { font-family: 'Ogg', serif; font-style: italic; font-weight: 100; font-size: clamp(48px,7vw,88px); margin: 0 0 20px; color: var(--accent); }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 16px; }

.btn { padding: 16px 30px; border-radius: 100px; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.btn-solid { background: var(--accent); color: var(--bg-deep); }
.btn-outline { border: 1.5px solid rgba(234,242,246,0.5); color: var(--ink); }
.btn-nowrap { white-space: nowrap; }

.text-link { font-size: 13.5px; font-weight: 600; border-bottom: 1.5px solid var(--accent); padding-bottom: 1px; color: var(--accent); }

/* Hero */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 140px 48px 60px; }
.hero-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 60px; align-items: center; max-width: 1400px; margin: 0 auto; width: 100%; }
.hero-portrait { animation: fadeUp 1s cubic-bezier(.16,1,.3,1) both; }
.hero-copy { animation: fadeUp .8s cubic-bezier(.16,1,.3,1) .1s both; }
.hero-title { font-family: 'Work Sans', sans-serif; font-size: clamp(44px,6vw,88px); line-height: 1.02; font-weight: 700; margin: 0 0 20px; letter-spacing: -0.02em; }
.accent-script { font-family: 'Ogg', serif; font-style: italic; font-weight: 100; font-size: 1.4em; color: var(--accent); }
.hero-lead { font-size: 19px; line-height: 1.6; color: var(--ink-soft); max-width: 520px; margin: 0 0 36px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Image placeholders */
.img-slot {
  position: relative; width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(79,168,216,0.22), rgba(20,90,120,0.35));
  border: 1px dashed rgba(234,242,246,0.25);
  display: flex; align-items: center; justify-content: center;
  border-radius: inherit;
}
.img-slot-label { font-size: 13px; font-weight: 500; color: var(--ink-mute); text-align: center; padding: 0 12px; }

/* Sections */
.section { padding: 60px 48px; max-width: 1400px; margin: 0 auto; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 56px; flex-wrap: wrap; gap: 16px; }
.section-title { font-family: 'Work Sans', sans-serif; font-size: clamp(32px,4.5vw,56px); font-weight: 700; margin: 0; }
.section-link { font-size: 15px; font-weight: 600; border-bottom: 1.5px solid var(--accent); padding-bottom: 2px; color: var(--accent); }

/* Project cards */
.project-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
.project-grid-full { display: grid; grid-template-columns: repeat(2,1fr); gap: 44px 32px; }
.project-thumb { width: 100%; aspect-ratio: 4/3; border-radius: 18px; overflow: hidden; margin-bottom: 18px; }
.project-thumb-full { width: 100%; aspect-ratio: 16/11; border-radius: 20px; overflow: hidden; margin-bottom: 20px; }
.project-meta { display: flex; justify-content: space-between; align-items: baseline; }
.project-title { font-family: 'Work Sans', sans-serif; font-size: 22px; font-weight: 700; margin: 0; }
.project-title-lg { font-family: 'Work Sans', sans-serif; font-size: 26px; font-weight: 700; margin: 0; }
.project-year { font-size: 13px; color: var(--ink-mute); }
.project-tag { font-size: 14px; color: var(--ink-mute); margin: 6px 0 0; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.gallery-item { display: block; width: 100%; aspect-ratio: 3/4; border-radius: 14px; overflow: hidden; }
.gallery-masonry { columns: 3; column-gap: 20px; }
.gallery-masonry-item { display: block; break-inside: avoid; margin-bottom: 20px; border-radius: 16px; overflow: hidden; width: 100%; padding: 0; border: none; cursor: pointer; }

/* Books */
.book-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
.book-card { display: flex; gap: 18px; align-items: flex-start; background: var(--card); border: 1.5px solid var(--border); border-radius: 16px; padding: 20px; }
.book-cover { width: 78px; aspect-ratio: 3/4; border-radius: 6px; overflow: hidden; flex-shrink: 0; box-shadow: 0 6px 16px rgba(2,10,18,0.4); }
.book-title { font-family: 'Work Sans', sans-serif; font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.book-blurb { font-size: 13.5px; color: var(--ink-mute); line-height: 1.5; margin: 0 0 12px; }
.book-grid-full { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 36px; margin-bottom: 90px; }
.book-card-full { display: flex; flex-direction: column; gap: 16px; }
.book-cover-full { width: 100%; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; box-shadow: 0 20px 40px -18px rgba(2,10,18,0.6); }

/* Posts */
.posts-section { border-top: 1.5px solid rgba(234,242,246,0.2); padding-top: 50px; }
.cv-heading { font-family: 'Work Sans', sans-serif; font-size: 26px; font-weight: 700; margin: 0 0 24px; }
.posts-list { display: flex; flex-direction: column; }
.post-row { display: flex; justify-content: space-between; align-items: baseline; padding: 22px 0; border-bottom: 1.5px solid rgba(234,242,246,0.12); gap: 20px; }
.post-title { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.post-excerpt { font-size: 14px; color: var(--ink-mute); margin: 0; }
.post-date { font-size: 13px; color: var(--ink-mute); white-space: nowrap; }
.post-single .post-content { font-size: 16px; line-height: 1.7; color: var(--ink-soft); margin: 30px 0 50px; }

/* CV page */
.cv-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px; margin-bottom: 70px; border-bottom: 1.5px solid rgba(234,242,246,0.2); padding-bottom: 36px; }
.cv-intro { font-size: 17px; color: var(--ink-soft); margin: 14px 0 0; max-width: 520px; }
.cv-section { margin-bottom: 70px; }
.timeline { display: flex; flex-direction: column; gap: 0; border-left: 1.5px solid rgba(234,242,246,0.2); padding-left: 32px; }
.timeline-item { position: relative; padding-bottom: 44px; }
.timeline-dot { position: absolute; left: -38.5px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.timeline-title { font-size: 19px; font-weight: 700; margin: 0; }
.timeline-company { font-weight: 500; color: var(--ink-mute); }
.timeline-period { font-size: 14px; color: var(--ink-mute); }
.timeline-desc { font-size: 15.5px; color: var(--ink-soft); line-height: 1.6; margin: 0; max-width: 640px; }
.timeline-school { font-size: 15px; color: var(--ink-mute); margin: 4px 0 0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 12px; }
.pill { background: var(--card); border: 1.5px solid rgba(234,242,246,0.15); padding: 10px 18px; border-radius: 100px; font-size: 14px; font-weight: 500; }

/* Contact */
.contact-page { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.contact-email { font-size: clamp(22px,3vw,34px); font-weight: 600; border-bottom: 2px solid var(--accent); display: inline-block; width: fit-content; margin-bottom: 56px; }
.contact-socials { display: flex; gap: 36px; flex-wrap: wrap; }
.contact-social { font-size: 15px; font-weight: 600; letter-spacing: 0.04em; border-bottom: 1.5px solid rgba(234,242,246,0.3); padding-bottom: 2px; }

/* Footer */
.site-footer { border-top: 1.5px solid rgba(234,242,246,0.15); padding: 48px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; max-width: 1400px; margin: 0 auto; }
.footer-copy { font-size: 13.5px; color: var(--ink-mute); }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-link { font-size: 13.5px; font-weight: 600; letter-spacing: 0.03em; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(6,32,47,0.95); z-index: 800;
  display: none; align-items: center; justify-content: center; padding: 60px;
}
.lightbox.is-open { display: flex; }
.lightbox-frame { width: min(700px,80vw); aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; }
.lightbox-close { position: absolute; top: 36px; right: 48px; background: none; border: none; color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: 0.05em; cursor: pointer; }

@media (max-width: 900px) {
  [data-hero-grid] { grid-template-columns: 1fr !important; }
  .project-grid, .project-grid-full { grid-template-columns: 1fr !important; }
  [data-gallery-preview] { grid-template-columns: repeat(2,1fr) !important; }
  .gallery-masonry { columns: 2 !important; }
  .book-grid { grid-template-columns: 1fr !important; }
  [data-desktop-nav] { display: none !important; }
  .nav-toggle { display: block !important; }
}

@media (max-width: 560px) {
  .gallery-masonry { columns: 1 !important; }
  .page-wide, .page-medium, .page-narrow { padding-left: 24px; padding-right: 24px; }
  .nav { padding: 18px 24px; }
  .hero { padding-left: 24px; padding-right: 24px; }
  .section { padding-left: 24px; padding-right: 24px; }
}
