
:root {
  --bg: #fff3f8;
  --paper: #fffafd;
  --ink: #1e235f;
  --muted: #67618a;
  --accent: #305bd8;
  --accent-2: #874ca7;
  --line: #ead4ea;
  --soft: #f6ddec;
  --shadow: 0 18px 50px rgba(64, 38, 92, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.75;
  overflow-x: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(18px, 3vw, 40px);
  background: rgba(255, 243, 248, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  flex: 0 0 auto;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-header nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: clamp(10px, 1.6vw, 22px);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.74rem, 1vw, 0.9rem);
  min-width: 0;
}

.site-header nav a,
.essay a {
  color: var(--accent);
  text-decoration-color: rgba(48, 91, 216, 0.35);
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.site-header nav a {
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.site-header nav a:hover,
.essay a:hover { color: var(--accent-2); }

.page-shell {
  width: min(920px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(34px, 7vw, 82px) 0 64px;
}

.essay {
  min-width: 0;
  padding-bottom: 20px;
  overflow-wrap: break-word;
}

.hero-section {
  min-height: clamp(360px, 62vh, 620px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 42px;
}

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(3rem, 8vw, 6.5rem);
  overflow-wrap: break-word;
}

h2 {
  margin: 80px 0 28px;
  padding-top: 18px;
  border-top: 2px solid var(--accent-2);
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.essay p {
  margin: 0 0 24px;
  font-size: clamp(1.05rem, 1.7vw, 1.22rem);
}

.essay .lead {
  color: #29256b;
  font-size: clamp(1.18rem, 2vw, 1.45rem);
  line-height: 1.65;
}

blockquote {
  margin: 44px 0;
  padding: 28px clamp(22px, 4vw, 42px);
  background: var(--paper);
  border-left: 5px solid var(--accent-2);
  box-shadow: var(--shadow);
  color: #30206e;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.58;
}

.media-figure {
  margin: 34px auto 40px;
  width: min(100%, 560px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.media-figure.wide { width: min(100%, 820px); }
.media-figure img,
.media-figure video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  background: #fff;
}
.media-figure video { background: #100f24; }
.media-figure video { aspect-ratio: 16 / 9; }
figcaption {
  padding: 11px 15px 13px;
  color: #5b4a7c;
  background: #fbedf5;
  border-top: 1px solid #efd2e9;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
  line-height: 1.45;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin: 34px auto 42px;
}

.figure-grid .media-figure {
  width: 100%;
  margin: 0;
}

.figure-grid .media-figure img {
  aspect-ratio: 4 / 3;
  max-height: none;
  object-fit: cover;
}

.video-embed {
  position: relative;
  margin: 42px auto 46px;
  width: min(100%, 760px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #100f24;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.carousel {
  margin: 52px 0 58px;
  padding: clamp(18px, 3vw, 28px);
  background: rgba(255, 250, 253, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.carousel-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  align-items: end;
  margin-bottom: 20px;
  font-family: Arial, Helvetica, sans-serif;
}
.carousel-header p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--accent-2);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}
.carousel-header h3 { font-size: clamp(1.35rem, 3vw, 2.15rem); }
.carousel-controls { display: flex; gap: 8px; }
.carousel-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}
.carousel-button:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}
.carousel-track {
  position: relative;
  min-height: 0;
}
.carousel-slide {
  display: none;
  margin: 0;
  background: #f8e7f1;
  border-radius: 8px;
  overflow: hidden;
}
.carousel-slide.is-active {
  display: block;
  animation: carouselFade 320ms ease both;
}
.carousel.portrait .carousel-slide.is-active {
  animation: none;
}
.carousel-slide img {
  display: block;
  width: 100%;
  background: #f3dce9;
}
.carousel.landscape .carousel-slide img {
  aspect-ratio: 16 / 8.8;
  object-fit: cover;
}
.carousel.portrait {
  overflow: hidden;
}
.carousel.portrait .carousel-track {
  display: flex;
  gap: 16px;
  overflow: hidden;
  scroll-behavior: smooth;
  padding: 6px 4px 18px;
}
.carousel.portrait .carousel-slide {
  display: block;
  flex: 0 0 calc((100% - 48px) / 4);
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  padding: 0;
  box-shadow: 0 10px 26px rgba(64, 38, 92, 0.1);
  transition: box-shadow 220ms ease, border-color 220ms ease, transform 220ms ease;
}
.carousel.portrait .carousel-slide.is-active {
  border-color: #e9bfdc;
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(64, 38, 92, 0.16);
}
.carousel.portrait .carousel-slide img {
  width: 100%;
  height: 230px;
  margin: 0 auto;
  border-radius: 7px 7px 0 0;
  object-fit: cover;
  object-position: center 20%;
}
.carousel-slide figcaption {
  background: #fbedf5;
  border-top: 1px solid #efd2e9;
  text-align: center;
}
.carousel.portrait .carousel-slide figcaption {
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 12px 14px;
  background: #f7dfec;
}
.carousel-slide figcaption strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}
.carousel-slide figcaption span {
  display: block;
  margin-top: 4px;
}
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.carousel-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: #d8b8d8;
  cursor: pointer;
}
.carousel-dot.is-active { background: var(--accent-2); }

@keyframes carouselFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-slide.is-active {
    animation: none;
  }
}

@media (max-width: 880px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .site-header nav {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a {
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
  }
  .page-shell {
    width: auto;
    max-width: min(760px, calc(100vw - 28px));
    margin: 0 14px;
    padding-top: 34px;
  }
  .essay,
  .essay p,
  .hero-section {
    max-width: calc(100vw - 28px);
  }
  .hero-section { min-height: 48vh; }
  h2 { margin-top: 58px; }
}

@media (max-width: 540px) {
  body { line-height: 1.68; }
  .site-header { padding-left: 14px; padding-right: 14px; }
  .brand { white-space: normal; max-width: 230px; }
  .site-header nav { font-size: 0.92rem; }
  .site-header nav a { max-width: 100%; }
  h1 {
    font-size: 2.75rem;
    line-height: 1.12;
  }
  .hero-section {
    min-height: 40vh;
  }
  .essay p { font-size: 1rem; }
  blockquote { margin: 34px 0; }
  .media-figure, .video-embed, .carousel { margin-left: -2px; margin-right: -2px; }
  .media-figure {
    width: 100%;
    margin-top: 28px;
    margin-bottom: 34px;
  }
  .media-figure img {
    max-height: 430px;
  }
  .figure-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 28px 0 36px;
  }
  .figure-grid .media-figure img {
    aspect-ratio: auto;
    max-height: 430px;
    object-fit: contain;
  }
  .carousel-header { grid-template-columns: 1fr; }
  .carousel-controls { justify-self: start; }
  .carousel { padding: 16px; }
  .carousel.portrait .carousel-track {
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .carousel.portrait .carousel-track::-webkit-scrollbar { display: none; }
  .carousel.portrait .carousel-slide {
    flex-basis: 78%;
    scroll-snap-align: center;
  }
  .carousel.portrait .carousel-slide img {
    height: 320px;
  }
  .carousel.portrait .carousel-controls {
    display: none;
  }
}

