:root {
  --bg: #f5efe3;
  --bg-soft: rgba(255,255,255,.62);
  --panel: rgba(255,255,255,.72);
  --panel-solid: #fffaf1;
  --text: #292821;
  --muted: #716e64;
  --line: rgba(64,55,43,.12);
  --orange: #d98b52;
  --orange-soft: #efb77f;
  --green: #709889;
  --shadow: 0 24px 80px rgba(59,44,24,.12);
  --radius: 28px;
}

html[data-theme="night"] {
  --bg: #101413;
  --bg-soft: rgba(18,24,22,.68);
  --panel: rgba(26,32,30,.78);
  --panel-solid: #191f1d;
  --text: #f3efe5;
  --muted: #a8ada7;
  --line: rgba(255,255,255,.09);
  --orange: #efa86d;
  --orange-soft: #ba7f51;
  --green: #80b3a0;
  --shadow: 0 24px 80px rgba(0,0,0,.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  transition:
    background .4s ease,
    color .4s ease;
}

a {
  color: inherit;
}

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

button,
input {
  font: inherit;
}

#ambient-canvas {
  position: fixed;
  z-index: -4;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ambient-orb {
  position: fixed;
  z-index: -5;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  opacity: .16;
  animation: orb-float 22s ease-in-out infinite alternate;
}

.orb-one {
  top: -18vw;
  left: -10vw;
  background: var(--orange);
}

.orb-two {
  top: 24vh;
  right: -18vw;
  background: var(--green);
  animation-delay: -8s;
}

.orb-three {
  bottom: -25vw;
  left: 30vw;
  background: var(--orange-soft);
  animation-delay: -14s;
}

@keyframes orb-float {
  from {
    transform: translate3d(-3vw,-2vh,0) scale(.95);
  }
  to {
    transform: translate3d(6vw,5vh,0) scale(1.12);
  }
}

.shell {
  width: min(1240px, calc(100% - 38px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  padding: 13px 0;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
}

.nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
}

.nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

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

.theme-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.hero {
  min-height: 78vh;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 60px;
  align-items: center;
  padding: 70px 0 54px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(50px, 7vw, 96px);
  line-height: .95;
  letter-spacing: -.065em;
}

.hero h1 em {
  color: var(--orange);
  font-family: Georgia, serif;
  font-weight: 500;
}

.hero-text {
  max-width: 680px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  text-decoration: none;
}

.button.ghost {
  background: var(--panel);
  color: var(--text);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-meta span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12px;
  backdrop-filter: blur(10px);
}

.hero-visual {
  position: relative;
}

.hero-photo {
  position: relative;
  overflow: hidden;
  aspect-ratio: .84;
  border: 1px solid var(--line);
  border-radius: 44px;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-photo::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(
      to top,
      rgba(0,0,0,.3),
      transparent 45%
    );
}

.floating-note {
  position: absolute;
  z-index: 3;
  right: -18px;
  bottom: 40px;
  max-width: 220px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: card-float 5s ease-in-out infinite alternate;
}

@keyframes card-float {
  to {
    transform: translateY(-13px) rotate(-2deg);
  }
}

.section {
  padding: 70px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 58px);
  letter-spacing: -.045em;
}

.section-head p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.category {
  min-height: 195px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 14px 50px rgba(0,0,0,.04);
  backdrop-filter: blur(14px);
  transition:
    transform .25s ease,
    border-color .25s ease;
}

.category:hover {
  transform: translateY(-5px);
  border-color: var(--orange);
}

.category-icon {
  display: block;
  margin-bottom: 28px;
  font-size: 31px;
}

.category h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.category p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.category small {
  display: block;
  margin-top: 14px;
  color: var(--orange);
  font-weight: 800;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.article-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--panel);
  transition:
    transform .25s ease,
    box-shadow .25s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.article-card img {
  width: 100%;
  aspect-ratio: 1.45;
  object-fit: cover;
}

.article-body {
  padding: 18px;
}

.article-category {
  color: var(--orange);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.article-card h3 {
  margin: 8px 0;
  font-size: 18px;
  line-height: 1.25;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.article-card a {
  text-decoration: none;
}

.status {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 14%, transparent);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.status.planned {
  background: color-mix(in srgb, var(--orange) 13%, transparent);
  color: var(--orange);
}

.media-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 12px;
}

.media-tile {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  border-radius: 26px;
  border: 1px solid var(--line);
}

.media-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-tile:first-child {
  min-height: 520px;
  grid-row: span 2;
}

.media-label {
  position: absolute;
  left: 15px;
  bottom: 15px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(12,14,13,.72);
  color: white;
  font-size: 12px;
  backdrop-filter: blur(9px);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--panel);
}

.video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: #000;
}

.video-card div {
  padding: 17px;
}

.video-card h3 {
  margin: 0 0 5px;
}

.video-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(
      125deg,
      color-mix(in srgb, var(--orange) 14%, var(--panel)),
      var(--panel)
    );
  box-shadow: var(--shadow);
}

.cta h2 {
  margin: 0;
  font-size: clamp(28px,4vw,48px);
  letter-spacing: -.04em;
}

.cta p {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--muted);
}

.preview-badge {
  position: fixed;
  z-index: 50;
  right: 15px;
  bottom: 15px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #1d211f;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.footer {
  margin-top: 70px;
  padding: 30px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

.catalog-hero {
  padding: 70px 0 30px;
}

.catalog-hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(48px, 7vw, 88px);
  line-height: .96;
  letter-spacing: -.06em;
}

.catalog-tools {
  position: sticky;
  z-index: 15;
  top: 68px;
  padding: 15px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
}

.search {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  background: var(--panel);
  color: var(--text);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.filters button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.filters button.active {
  background: var(--text);
  color: var(--bg);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  padding: 28px 0 80px;
}

.catalog-card {
  min-height: 205px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
}

.catalog-card h2 {
  margin: 8px 0;
  font-size: 20px;
}

.catalog-card p {
  color: var(--muted);
  font-size: 13px;
}

.catalog-card a {
  color: var(--orange);
  font-weight: 800;
  text-decoration: none;
}

.catalog-card .disabled {
  color: var(--muted);
}

@media (max-width: 1050px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .categories,
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1240px);
  }

  .nav {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 48px;
  }

  .hero-visual {
    max-width: 500px;
  }

  .floating-note {
    right: 8px;
  }

  .categories,
  .article-grid,
  .catalog-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .media-grid {
    grid-template-columns: 1fr 1fr;
  }

  .media-tile:first-child {
    grid-column: span 2;
    min-height: 400px;
  }

  .section-head,
  .cta,
  .footer-inner {
    align-items: start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .catalog-tools {
    top: 65px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================
   V3-LIGHT-CONTRAST-PASS
   Warm paper theme with stronger readable contrast
   ========================================================= */

html:not([data-theme="night"]) {
  --bg: #e9dfcf;
  --bg-soft: rgba(250,244,233,.76);
  --panel: rgba(255,250,240,.88);
  --panel-solid: #faf3e6;

  --text: #25231e;
  --muted: #514c43;

  --line: rgba(49,43,34,.18);

  --orange: #b86532;
  --orange-soft: #d49862;
  --green: #527568;

  --shadow:
    0 24px 70px rgba(65,48,28,.14);
}

html:not([data-theme="night"]) body {
  background:
    radial-gradient(
      circle at 10% 10%,
      rgba(198,137,84,.12),
      transparent 36rem
    ),
    radial-gradient(
      circle at 94% 32%,
      rgba(87,128,113,.11),
      transparent 38rem
    ),
    var(--bg);
}

html:not([data-theme="night"]) .topbar {
  background:
    rgba(235,225,208,.91);
  border-bottom-color:
    rgba(49,43,34,.16);
}

html:not([data-theme="night"]) .nav a {
  color: #49443c;
}

html:not([data-theme="night"]) .nav a:hover {
  color: #1f1d19;
}

html:not([data-theme="night"]) .hero-text,
html:not([data-theme="night"]) .section-head p,
html:not([data-theme="night"]) .article-card p,
html:not([data-theme="night"]) .category p,
html:not([data-theme="night"]) .video-card p,
html:not([data-theme="night"]) .catalog-card p,
html:not([data-theme="night"]) .footer {
  color: #514c43;
}

html:not([data-theme="night"]) .hero-meta span,
html:not([data-theme="night"]) .category,
html:not([data-theme="night"]) .article-card,
html:not([data-theme="night"]) .video-card,
html:not([data-theme="night"]) .catalog-card,
html:not([data-theme="night"]) .search,
html:not([data-theme="night"]) .filters button {
  border-color:
    rgba(49,43,34,.18);
}

html:not([data-theme="night"]) .category,
html:not([data-theme="night"]) .article-card,
html:not([data-theme="night"]) .video-card,
html:not([data-theme="night"]) .catalog-card {
  background:
    rgba(250,244,232,.91);
}

html:not([data-theme="night"]) .search {
  background:
    rgba(250,244,232,.95);
  color: #25231e;
}

html:not([data-theme="night"]) .search::placeholder {
  color: #71695d;
}

html:not([data-theme="night"]) .filters button {
  background:
    rgba(250,244,232,.92);
  color: #49443c;
}

html:not([data-theme="night"])
.filters button.active {
  background: #292720;
  color: #fffaf0;
}

/*
  A number of the current legacy photographs are
  quite bright. Tone them down only in light mode.
*/

html:not([data-theme="night"]) .hero-photo img,
html:not([data-theme="night"]) .media-tile img,
html:not([data-theme="night"]) .article-card img,
html:not([data-theme="night"]) .video-card video {
  filter:
    brightness(.88)
    contrast(1.08)
    saturate(.94);
}

html:not([data-theme="night"]) .floating-note {
  background:
    rgba(247,239,225,.94);
  color: #25231e;
}

html:not([data-theme="night"]) .eyebrow,
html:not([data-theme="night"]) .article-category {
  color: #a65528;
}

/* Slight extra depth for the hero */

.hero-photo {
  animation:
    v3-hero-breathe
    8s
    ease-in-out
    infinite alternate;
}

@keyframes v3-hero-breathe {
  from {
    transform:
      rotate(2deg)
      translateY(0);
  }

  to {
    transform:
      rotate(1deg)
      translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo {
    animation: none;
  }
}
