/* ── Variables & Reset ─────────────────────────────────────────────────── */

:root {
  --bg-a:        #F7F5F1;
  --bg-b:        #EDE9E3;
  --warm-black:  #1E1C1A;
  --blue-header: #7A9BAD;
  --blue-link:   #0099CC;
  --blue-light:  #A5BDCB;
  --grey-mid:    #888580;
  --grey-light:  #C8C4BC;
  --border:      rgba(30,28,26,0.1);
  --radius:      10px;
  --img-radius:  12px;

  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --max-w: 1200px;
  --pad-x: clamp(24px, 5vw, 80px);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--warm-black);
  background: var(--bg-a);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.bg-a { background-color: var(--bg-a); }
.bg-b { background-color: var(--bg-b); }

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


/* ── Header ────────────────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--pad-x);
  transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
  /* Default: transparent over hero */
  background: transparent;
  color: white;
}

/* Name: white over hero, blue-header once scrolled */
.site-header .header-name { color: inherit; }
.site-header.scrolled .header-name { color: var(--blue-header); }

.site-header.scrolled {
  background: var(--bg-a);
  color: var(--warm-black);
  box-shadow: 0 2px 8px rgba(30,28,26,0.06);
  padding: 16px var(--pad-x);
}

/* Resume page — always opaque, no hero */
.resume-page .site-header {
  position: sticky;
  background: var(--bg-a);
  color: var(--warm-black);
  box-shadow: 0 2px 8px rgba(30,28,26,0.06);
  padding: 16px var(--pad-x);
}
.resume-page .site-header .header-name { color: var(--blue-header); }

.header-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: inherit;
}

.header-logo { height: 28px; width: auto; }

.header-nav {
  display: flex;
  gap: 32px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-nav a {
  color: inherit;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.header-nav a:hover { opacity: 1; }

/* Active section indicator — thin underline */
.header-nav a.nav-active,
.header-nav a[aria-current="page"] {
  opacity: 1;
  text-decoration: underline;
  text-decoration-color: var(--blue-header);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}


/* ── Site Hero ─────────────────────────────────────────────────────────── */

.site-hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: var(--warm-black);
}

.hero-track {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-slide.active { opacity: 1; }

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Gradient from bottom — makes meta text readable */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(30,28,26,0.6) 0%,
    rgba(30,28,26,0.08) 35%,
    transparent 55%
  );
  pointer-events: none;
}

.hero-meta {
  position: absolute;
  bottom: 56px;
  left: var(--pad-x);
  color: white;
  pointer-events: none;
}

.hero-num {
  display: none;
}

.hero-title {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(16px, 2vw, 27px);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.hero-scroll-btn {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: background 0.2s;
  pointer-events: all;
}
.hero-scroll-btn:hover { background: rgba(255,255,255,0.3); }
.hero-scroll-btn svg { width: 16px; height: 16px; }

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 16px 12px;
  pointer-events: all;
  transition: color 0.2s;
}
.hero-arrow:hover { color: rgba(255,255,255,0.95); }
.hero-prev { left: var(--pad-x); }
.hero-next { right: var(--pad-x); }
.hero-arrow svg { width: 28px; height: 28px; display: block; }
.site-hero.single .hero-arrow { display: none; }

.hero-dots {
  position: absolute;
  bottom: 36px;
  right: var(--pad-x);
  display: flex;
  gap: 10px;
  align-items: center;
}

.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.25s;
}
.hero-dot.active {
  background: white;
  transform: scale(1.35);
}

/* Sections need top offset so fixed header doesn't cover anchors */
#work, #about, #contact { scroll-margin-top: 72px; }


/* ── Section labels ────────────────────────────────────────────────────── */

.section-eyebrow,
.section-label {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-mid);
  margin-bottom: 32px;
}


/* ── Home: Work Grid ───────────────────────────────────────────────────── */

.home-work {
  padding: 48px var(--pad-x) 60px;
}

.home-work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 860px;
  margin: 0 auto;
}

/* Single vertical divider — column only, no row lines, no bg on empty cells */
.home-work-grid .work-card:nth-child(odd) {
  border-right: 1.5px solid var(--blue-header);
}

.work-card {
  display: block;
  background: var(--bg-a);
  color: var(--warm-black);
  cursor: pointer;
}

.work-card-img {
  aspect-ratio: 3 / 2;
  background-color: var(--bg-b);
  overflow: hidden;
  transition: opacity 0.35s;
}
.work-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.work-card:hover .work-card-img { opacity: 0.82; }

/* Round only the image — outer corners per column */
.home-work-grid .work-card:nth-child(odd)  .work-card-img { border-radius: var(--img-radius) 0 0 var(--img-radius); }
.home-work-grid .work-card:nth-child(even) .work-card-img { border-radius: 0 var(--img-radius) var(--img-radius) 0; }

.work-card-meta {
  padding: 18px 20px 36px;
}

.card-num {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--grey-mid);
  margin-bottom: 6px;
}

.card-name {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 400;
  color: var(--grey-mid);
  margin-bottom: 4px;
}

.card-type,
.card-subtitle {
  font-size: 13px;
  color: var(--grey-mid);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ISFD row on card */
.card-isfd-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--grey-mid);
  margin-top: 6px;
}

.card-isfd-icon {
  height: 1.5em;
  width: auto;
  vertical-align: middle;
  opacity: 0.7;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.card-tag {
  font-size: 11px;
  color: var(--grey-mid);
  letter-spacing: 0.06em;
  background: var(--bg-b);
  border-radius: 4px;
  padding: 3px 8px;
}


/* ── About ─────────────────────────────────────────────────────────────── */

.home-about {
  border-top: 1px solid var(--border);
  padding: 80px var(--pad-x);
  background: var(--bg-b);
}

.about-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-role {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-header);
  margin-bottom: 28px;
}

.about-location {
  color: var(--grey-mid);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}

.about-body {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--warm-black);
  margin-bottom: 16px;
}

.about-portrait {
  display: flex;
  justify-content: flex-start;
}

.about-portrait img {
  width: 67%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--img-radius);
}


/* ── Resume page ───────────────────────────────────────────────────────── */

.resume-section {
  border-top: 1px solid var(--border);
}

.resume-section-top {
  padding: 48px var(--pad-x) 28px;
}

.resume-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.resume-header-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.resume-section-body {
  padding: 40px var(--pad-x) 80px;
}

.resume-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  color: var(--grey-mid);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.resume-download-link {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--blue-link);
  transition: opacity 0.2s;
}
.resume-download-link:hover { opacity: 0.7; }

.resume-doc {
  width: 100%;
}


.resume-section-head {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-header);
  margin-top: 36px;
  margin-bottom: 14px;
}

.resume-subsection {
  font-size: 13px;
  font-weight: 400;
  color: var(--warm-black);
  margin-top: 16px;
  margin-bottom: 4px;
}

.resume-role { margin-top: 16px; }

.resume-role-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 4px;
}

.resume-role-name {
  font-size: 13px;
  font-weight: 400;
  color: var(--warm-black);
}

.resume-role-date {
  font-size: 12px;
  color: var(--grey-mid);
  white-space: nowrap;
}

.resume-bullets {
  list-style: disc;
  padding-left: 20px;
  margin-top: 4px;
}
.resume-bullets li {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--warm-black);
  margin-bottom: 2px;
}

.resume-role-date { margin-bottom: 6px; }

.resume-skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
}

.resume-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 40px;
  margin-top: 16px;
}
.resume-3col .resume-section-head { margin-top: 0; }

.resume-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
  margin-top: 16px;
}
.resume-2col .resume-section-head { margin-top: 0; }

.resume-divider {
  height: 1.5px;
  background: var(--blue-header);
  margin: 40px 0;
}

.resume-affiliation { margin-top: 14px; }

.resume-affiliation-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.resume-affiliation-right { text-align: right; }

.resume-affiliation-date {
  font-size: 12px;
  color: var(--grey-mid);
  margin-top: 2px;
}


/* ── Contact ───────────────────────────────────────────────────────────── */

.contact-section {
  padding: 80px var(--pad-x);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.contact-section .section-label {
  align-self: flex-start;
  text-align: left;
}

.contact-section h2 {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 400;
  color: var(--blue-header);
  margin-bottom: 8px;
}

.contact-location {
  font-size: 14px;
  color: var(--grey-mid);
  margin-bottom: 24px;
}

.contact-link {
  display: block;
  font-size: 15px;
  color: var(--blue-link);
  margin-bottom: 8px;
  transition: opacity 0.2s;
}
.contact-link:hover { opacity: 0.7; }


/* ── Footer ────────────────────────────────────────────────────────────── */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px var(--pad-x);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--grey-mid);
  letter-spacing: 0.04em;
}


/* ── Modal ─────────────────────────────────────────────────────────────── */

.work-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
}
.work-modal.open {
  opacity: 1;
  pointer-events: all;
}

.work-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30,28,26,0.55);
  cursor: pointer;
}

.work-modal-panel {
  position: relative;
  z-index: 1;
  background: var(--bg-a);
  width: 100%;
  max-width: 1200px;
  max-height: 94vh;
  overflow-y: auto;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  transform: translateY(16px);
  transition: transform 0.35s ease;
}
.work-modal.open .work-modal-panel { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: none;
  border: none;
  font-size: 22px;
  font-weight: 300;
  color: var(--grey-mid);
  cursor: pointer;
  line-height: 1;
  z-index: 2;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--warm-black); }

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
}

/* Slideshow side */
.modal-slideshow {
  background: var(--bg-b);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius) 0 0 var(--radius);
  overflow: hidden;
}

.modal-main-img {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 280px;
}

.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  background: rgba(30,28,26,0.25);
  border: none;
  border-radius: 4px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  padding: 10px 7px;
  transition: background 0.2s;
}
.modal-arrow:hover { background: rgba(30,28,26,0.55); }
.modal-prev { left: 8px; }
.modal-next { right: 8px; }
.modal-arrow svg { width: 18px; height: 18px; display: block; }

.modal-main-img img {
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--img-radius);
  cursor: zoom-in;
}

.modal-thumbs {
  display: flex;
  gap: 6px;
  padding: 0 16px 16px;
  overflow-x: auto;
}

.modal-thumb {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  border: 1.5px solid transparent;
  background: none;
  padding: 0;
  transition: border-color 0.2s;
}
.modal-thumb.active { border-color: var(--blue-header); }

.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Info side */
.modal-info {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-num {
  font-size: 10px;
  font-weight: 500;
  color: var(--blue-header);
  letter-spacing: 0.2em;
  margin-bottom: 10px;
}

.modal-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: var(--grey-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.modal-name {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 400;
  color: var(--blue-header);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  line-height: 1.15;
}

.modal-desc {
  font-size: 14px;
  font-weight: 300;
  color: #3A3835;
  line-height: 1.75;
  margin-bottom: 20px;
}

.modal-desc .desc-list {
  padding-left: 18px;
  margin: 6px 0;
}
.modal-desc .desc-list li {
  margin-bottom: 4px;
}

/* Tags */
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.modal-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--grey-mid);
  background: var(--bg-b);
  border-radius: 4px;
  padding: 4px 10px;
}

/* ISFD icon in modal tag */
.isfd-tag-icon {
  height: 1.5em;
  width: auto;
  vertical-align: middle;
}


/* ── Lightbox ──────────────────────────────────────────────────────────── */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(30,28,26,0.92);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox.open { display: flex; }

#lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 20px 16px;
  z-index: 1;
  transition: color 0.2s;
}
.lightbox-arrow:hover { color: rgba(255,255,255,0.85); }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox-arrow svg { width: 32px; height: 32px; display: block; }
#lightbox.single .lightbox-arrow { display: none; }


/* ── Back to top (mobile only) ─────────────────────────────────────────── */

.back-to-top {
  display: none;
}

@media (max-width: 768px) {
  .back-to-top {
    display: block;
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 200;
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--grey-mid);
    background: var(--bg-a);
    border: 1px solid var(--grey-light);
    border-radius: 100px;
    padding: 6px 12px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    box-shadow: 0 2px 8px rgba(30,28,26,0.08);
  }
  .back-to-top.visible {
    opacity: 1;
    pointer-events: all;
  }
}


/* ── Mobile ────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* Header scrolls with the page on mobile — no fixed positioning, no status bar issues */
  .site-header,
  .site-header.scrolled {
    position: static;
    background: var(--bg-a);
    color: var(--warm-black);
    box-shadow: 0 2px 8px rgba(30,28,26,0.06);
    padding: 14px 24px;
  }
  .site-header .header-name { color: var(--blue-header); }

  /* Nav: hide page-anchor links — user is already on the page */
  .header-nav { gap: 20px; font-size: 12px; }
  .header-nav a[href="#work"],
  .header-nav a[href="#about"],
  .header-nav a[href="#contact"],
  .header-nav a[href="index.html#work"],
  .header-nav a[href="index.html#about"],
  .header-nav a[href="index.html#contact"] { display: none; }

  /* Hero */
  .site-hero { height: 60vw; min-height: 280px; }
  .hero-scroll-btn { display: none; }
  .hero-arrow { display: none; }
  #hero-track { cursor: default; }
  .hero-meta { bottom: auto; top: 16px; }

  /* Works grid */
  .home-work-grid { grid-template-columns: 1fr; }
  .home-work-grid .work-card:nth-child(odd) { border-right: none; }
  .home-work-grid .work-card { border-left: 1.5px solid var(--blue-header); }
  .home-work-grid .work-card:nth-child(odd)  .work-card-img,
  .home-work-grid .work-card:nth-child(even) .work-card-img { border-radius: 0 var(--img-radius) var(--img-radius) 0; }

  .about-inner { grid-template-columns: 1fr; gap: 40px; }
  .about-portrait { order: -1; }
  .about-portrait img { aspect-ratio: 1 / 1; max-height: 360px; }

  .modal-body { grid-template-columns: 1fr; }
  .modal-slideshow { border-radius: var(--radius) var(--radius) 0 0; }

  .resume-role-row { flex-direction: column; gap: 1px; }
  .resume-role-date { white-space: normal; }
  .resume-affiliation-row { flex-direction: column; }
  .resume-affiliation-right { text-align: left; }
  .resume-skills-grid,
  .resume-3col,
  .resume-2col { grid-template-columns: 1fr; }
  .resume-divider { display: none; }

  .site-footer { flex-direction: column; gap: 6px; text-align: center; }
}
