/* ──────────────────────────────────────────────────────
   Maa Kuu — main.css
   Single design principle: make the images luminous.
   Everything else disappears.
   ────────────────────────────────────────────────────── */

/* ── Self-hosted fonts ──────────────────────────────── */
/* Place woff2 files in /static/fonts/
   EB Garamond: https://fonts.google.com/specimen/EB+Garamond
   Inter:       https://rsms.me/inter/                        */

@font-face {
  font-family: 'EB Garamond';
  src: url('/fonts/EBGaramond-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'EB Garamond';
  src: url('/fonts/EBGaramond-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ──────────────────────────────────────────── */

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

/* ── Design tokens ──────────────────────────────────── */

:root {
  --bg:            #0e0d0c;
  --petroleum:     #465f6a;
  --text:          #c8c4bd;
  --text-mid:      #87837e;
  --text-lo:       #484440;

  --font-serif:    'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-wordmark: Palatino, 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
}

/* ── Base ───────────────────────────────────────────── */

html {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 2.5rem;
  /* near-transparent — a soft fade keeps nav legible over artwork
     without drawing a bar across it */
  background: linear-gradient(to bottom, rgba(14,13,12,0.8) 0%, rgba(14,13,12,0.4) 55%, rgba(14,13,12,0) 100%);
  pointer-events: none;
}

.site-header > * {
  pointer-events: auto;
}

.wordmark {
  display: flex;
  align-items: center;
  color: var(--text-lo);
}

.wordmark svg {
  height: 18px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-lo);
  transition: color 0.25s ease;
  /* generous hit area for touch without shifting layout */
  padding: 0.75rem 0.25rem;
  margin: -0.75rem -0.25rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text-mid);
}

/* ── Homepage ───────────────────────────────────────── */

.page-home {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* track the real viewport when mobile browser chrome collapses */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
}

.hero-figure {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.hero-figure img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.hero-figure--pair {
  gap: 1rem;
}

.hero-figure--pair img {
  max-width: calc(50% - 0.5rem);
  height: 100%;
  object-fit: contain;
}

.hero-hint {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-lo);
  pointer-events: none;
}

/* ── Home — current series overlay ─────────────────── */

.hero-series {
  position: fixed;
  bottom: 3.5rem;
  left: 3rem;
  max-width: 22rem;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.hero-series__label {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin: 0 0 0.4rem;
}

.hero-series__title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 0.6rem;
}

.hero-series__desc {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
  margin: 0 0 1.2rem;
}

.hero-series__link {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
}

.hero-series__link:hover {
  color: #fff;
}

/* ── Works — series listing ─────────────────────────── */

.page-works {
  padding: 9rem 2.5rem 8rem;
  max-width: 1080px;
  margin: 0 auto;
}

/* Same treatment as the About/CV h1 so section titles match site-wide */
.page-title {
  font-family: var(--font-wordmark);
  font-size: 1.1rem;
  font-weight: normal;
  letter-spacing: 0.08em;
  color: var(--text-mid);
  margin-bottom: 5rem;
}

.page-intro {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-mid);
  max-width: 560px;
  margin: -3.5rem 0 5rem;
}

.page-intro p + p {
  margin-top: 1.25rem;
}

.series-list {
  display: flex;
  flex-direction: column;
  gap: 7rem;
}

.series-entry {
  display: block;
}

.series-entry-cover {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  margin-bottom: 1.4rem;
}

.series-entry-cover img {
  max-width: 100%;
  max-height: 72vh;
  max-height: 72dvh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.series-entry-meta {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.series-entry-title {
  font-family: var(--font-wordmark);
  font-size: 1.1rem;
  font-weight: normal;
  color: var(--text);
  letter-spacing: 0.06em;
  transition: color 0.25s ease;
}

.series-entry:hover .series-entry-title {
  color: var(--text-mid);
}

.series-entry-year {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-lo);
}

/* ── Series overview ────────────────────────────────── */

.page-series-overview {
  padding: 9rem 2.5rem 8rem;
  max-width: 820px;
  margin: 0 auto;
}

.series-overview-header {
  margin-bottom: 4.5rem;
}

.series-overview-year {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--text-lo);
  margin-bottom: 1rem;
}

.series-overview-title {
  font-family: var(--font-wordmark);
  font-size: 1.5rem;
  font-weight: normal;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 2rem;
}

.series-overview-statement {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.8;
  color: var(--text-mid);
  max-width: 560px;
}

.series-overview-body {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-mid);
  max-width: 560px;
  margin-top: 2rem;
}

.series-overview-body p + p {
  margin-top: 1.25rem;
}

/* When the series shows its images directly, the intro block hands
   over to the full-width sequence and the chapter list follows it */
.series-overview--intro {
  padding-bottom: 4rem;
}

.series-overview--after {
  padding-top: 0;
}

.chapter-nav-list {
  list-style: none;
  margin-top: 5rem;
  border-top: 1px solid var(--text-lo);
  padding-top: 2.5rem;
}

.chapter-nav-list li {
  padding: 0.6rem 0;
}

.chapter-nav-list a {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-lo);
  transition: color 0.25s ease;
}

.chapter-nav-list a:hover {
  color: var(--text);
}

/* ── Chapter — image sequence ───────────────────────── */

.page-chapter {
  padding-top: 5.5rem;
  padding-bottom: 10rem;
}

.chapter-header {
  padding: 2rem 2.5rem 3.5rem;
  max-width: 820px;
  margin: 0 auto;
}

.chapter-series-link {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--petroleum);
  transition: color 0.25s;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.chapter-series-link:hover {
  color: var(--text-mid);
}

.chapter-title {
  font-family: var(--font-wordmark);
  font-size: 1.2rem;
  font-weight: normal;
  letter-spacing: 0.07em;
  color: var(--text-mid);
}

.image-sequence {
  display: flex;
  flex-direction: column;
  gap: 5vw;
}

.image-frame {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  margin: 0;
  padding: 0 2.5rem;
}

.image-frame img {
  max-width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Edge-to-edge option for wide/landscape images */
.image-frame.full-bleed {
  padding: 0;
}

.image-caption {
  padding: 0.75rem 2.5rem 0;
  max-width: 820px;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-lo);
}

/* ── Chapter navigation ─────────────────────────────── */

.chapter-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5rem 2.5rem 0;
  max-width: 820px;
  margin: 0 auto;
}

.chapter-pagination a,
.chapter-pagination span {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-lo);
  transition: color 0.25s ease;
}

.chapter-pagination a:hover {
  color: var(--text);
}

.chapter-pagination .series-return {
  color: var(--petroleum);
}

.chapter-pagination .series-return:hover {
  color: var(--text-mid);
}

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

.page-about {
  padding: 11rem 2.5rem 10rem;
  max-width: 600px;
  margin: 0 auto;
}

.page-about h1 {
  font-family: var(--font-wordmark);
  font-size: 1.1rem;
  font-weight: normal;
  letter-spacing: 0.08em;
  color: var(--text-mid);
  margin-bottom: 3.5rem;
}

.page-about h2 {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-lo);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
}

.page-about p {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.82;
  color: var(--text);
  margin-bottom: 1.4rem;
}

.page-about a {
  color: var(--petroleum);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

.page-about a:hover {
  border-color: var(--petroleum);
}

/* ── CV ─────────────────────────────────────────────── */

.page-cv {
  padding: 11rem 2.5rem 10rem;
  max-width: 720px;
  margin: 0 auto;
}

.page-cv h1 {
  font-family: var(--font-wordmark);
  font-size: 1.1rem;
  font-weight: normal;
  letter-spacing: 0.08em;
  color: var(--text-mid);
  margin-bottom: 5rem;
}

.page-cv h2 {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-lo);
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--text-lo);
}

.page-cv ul {
  list-style: none;
}

.page-cv li,
.page-cv p {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.page-cv .cv-year {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-lo);
  display: inline-block;
  width: 4rem;
  flex-shrink: 0;
}

.page-cv .cv-entry {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.page-cv .cv-entry-text {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

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

.site-footer {
  padding: 3rem 2.5rem;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.newsletter {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
  width: 100%;
  max-width: 28rem;
}

.newsletter__label {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-lo);
  width: 100%;
  text-align: center;
}

.newsletter__form {
  width: 100%;
}

.newsletter__row {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--text-lo);
}

.newsletter__email-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.newsletter__input {
  flex: 1;
  min-width: 0; /* let the input shrink so the button stays inside the border */
  background: transparent;
  border: none;
  outline: none;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text);
  letter-spacing: 0.04em;
}

.newsletter__input::placeholder {
  color: var(--text-lo);
}

.newsletter__submit {
  background: transparent;
  border: none;
  padding: 0.6rem 0.9rem 0.6rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-lo);
  cursor: pointer;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.newsletter__submit:hover {
  color: var(--text-mid);
}

.newsletter__powered {
  margin-top: 0.75rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  color: var(--text-lo);
}

.newsletter__powered a {
  color: inherit;
  text-decoration: none;
}

.newsletter__powered a:hover {
  color: var(--text-mid);
}

/* ── Tablet ─────────────────────────────────────────── */

@media (max-width: 900px) {
  .page-works,
  .page-series-overview,
  .page-about,
  .page-cv {
    padding-top: 7.5rem;
  }

  .hero-series {
    left: 2rem;
    bottom: 2.5rem;
  }
}

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

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .site-header {
    padding: 1.1rem max(1.25rem, env(safe-area-inset-right))
             1.1rem max(1.25rem, env(safe-area-inset-left));
  }

  .wordmark svg {
    height: 14px;
  }

  .site-nav {
    gap: 1.4rem;
  }

  .site-nav a {
    font-size: 0.62rem;
  }

  /* ── Homepage: the image owns the screen, series text
       flows below it instead of covering it ──────────── */
  .page-home {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    display: block;
    padding-top: 3.9rem; /* clear the fixed header */
  }

  .hero-figure {
    height: auto;
  }

  .hero-figure img {
    width: 100%;
    max-height: 80vh;
    max-height: 80svh;
    object-fit: contain;
  }

  .hero-figure--pair {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero-figure--pair img {
    max-width: 100%;
    max-height: 58vh;
    max-height: 58svh;
  }

  .hero-series {
    position: static;
    max-width: none;
    padding: 2.25rem 1.25rem 3.5rem;
    color: var(--text);
    text-shadow: none;
  }

  .hero-series__label {
    color: var(--text-lo);
  }

  .hero-series__title {
    font-size: 1.9rem;
    color: var(--text);
  }

  .hero-series__desc {
    color: var(--text-mid);
  }

  .hero-series__link {
    color: var(--petroleum);
    display: inline-block;
    padding: 0.5rem 0;
  }

  /* ── Text pages ───────────────────────────────────── */
  .page-works,
  .page-series-overview,
  .page-about,
  .page-cv {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-top: 6rem;
    padding-bottom: 5rem;
  }

  .page-title {
    margin-bottom: 3rem;
  }

  .series-overview--intro {
    padding-bottom: 2.5rem;
  }

  .page-intro {
    margin: -1.75rem 0 3.5rem;
  }

  .series-list {
    gap: 4.5rem;
  }

  .series-entry-cover img {
    width: 100%;
    max-height: 70vh;
    max-height: 70svh;
  }

  /* ── Chapters: images edge-to-edge ────────────────── */
  .page-chapter {
    padding-top: 4.5rem;
    padding-bottom: 5rem;
  }

  .chapter-header {
    padding: 1.5rem 1.25rem 2.5rem;
  }

  .image-sequence {
    gap: 2.75rem;
  }

  .image-frame {
    padding: 0;
  }

  .image-frame img {
    max-height: 88vh;
    max-height: 88svh;
  }

  .image-caption {
    padding: 0.6rem 1.25rem 0;
  }

  .chapter-pagination {
    padding: 3.5rem 1.25rem 0;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }

  .chapter-pagination a {
    padding: 0.4rem 0;
  }

  /* ── CV ───────────────────────────────────────────── */
  .page-cv .cv-entry {
    gap: 1rem;
  }

  .page-cv .cv-year {
    width: 3.25rem;
  }

  /* ── Footer ───────────────────────────────────────── */
  .site-footer {
    padding: 2.5rem 1.25rem;
    justify-content: center;
  }

  .newsletter {
    align-items: center;
    max-width: 100%;
  }

  .newsletter__input {
    font-size: 1rem; /* ≥16px prevents iOS zoom-on-focus */
  }

  .hero-hint {
    display: none;
  }
}

/* ── Print ──────────────────────────────────────────── */

@media print {
  .site-header,
  .site-footer,
  .chapter-pagination {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
