/* Shared colors keep the existing page layouts readable over the trunk. */
:root.trunk-theme {
  color-scheme: dark;
  --bg: #0a0c09;
  --bg-alt: #1b2219;
  --bg-card: #111810ed;
  --bg-card-hover: #1b2519f7;
  --ink: #f5f6ef;
  --ink-soft: #e2e8dc;
  --muted: #d5decf;
  --subtle: #bfccba;
  --brand: #acd989;
  --brand-hover: #c5e7ae;
  --brand-on-dark: #b3dc96;
  --brand-deep: #b9e4a0;
  --brand-wash: #b9e4a022;
  --link: #c1e6ac;
  --stroke: #edf5e529;
  --stroke-brand: #acd98970;
  --stroke-strong: #edf5e54d;
  --trunk-surface: #0d120ee0;
  --trunk-primary: #38682d;
  --trunk-primary-hover: #305b26;
}

.trunk-theme :focus-visible {
  outline-color: var(--brand);
}

.trunk-theme .site-header {
  background: #0a0e0bdf;
  border-color: var(--stroke);
}

.trunk-theme .site-header.is-scrolled {
  background: #0a0e0bf5;
}

.trunk-theme .brand-logo img {
  /* Lift the original dark wordmark without flattening its green leaf. */
  filter: invert(1) hue-rotate(180deg);
}

.trunk-theme .primary-nav a {
  color: var(--muted);
}

.trunk-theme .primary-nav a:hover,
.trunk-theme .primary-nav a[aria-current="page"] {
  color: var(--ink);
}

.trunk-theme .lang-btn {
  background: #edf5e514;
}

.trunk-theme .lang-btn:hover {
  background: #edf5e526;
}

.trunk-theme :is(.lang-menu, .mobile-drawer, .site-footer) {
  background: #0d120ef2;
}

.trunk-theme :is(.btn--primary, .btn--light, .lang-opt[aria-selected="true"], .skip-link) {
  background: var(--trunk-primary);
}

.trunk-theme :is(.btn--primary, .btn--light):hover {
  background: var(--trunk-primary-hover);
}

.trunk-theme .btn--secondary {
  background: #0a0e0bd9;
}

.trunk-theme :is(.btn--secondary, .btn--outline-light):hover {
  background: var(--trunk-primary);
}

.trunk-theme :is(.section--mist, .section--stone) {
  background: #0a0e0bc4;
  border-color: var(--stroke);
}

.trunk-theme :is(.card, .ritual-card, .closing-cta) {
  border-color: var(--stroke);
}

.trunk-theme :is(.ritual-card, .closing-cta, .app-tab) {
  background: var(--trunk-surface);
}

.trunk-theme :is(.app-tab:hover, .app-tab.is-active) {
  background: var(--bg-card-hover);
}

.trunk-theme :is(.hero-center, .hero-device__cap, .hero-trust-notes, .page-hero__inner, .section-head, .anatomy-head) {
  text-shadow: 0 1px 12px #000c;
}

.trunk-theme .phone-screen {
  /* The light screen is part of the existing app preview, independent of the site palette. */
  color-scheme: light;
  color: #1d1d1f;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --brand: #407630;
  --brand-hover: #c5e7ae;
  --brand-on-dark: #b3dc96;
  --brand-deep: #305b24;
  --brand-wash: #40763017;
}

/* Subpage cards retain their layout and use the same dark surfaces as the homepage. */
.trunk-theme :is(.spec-table, .story-editorial, .mission-tile, .model-jump-nav, .anatomy-callout,
    .carousel-arrow, .carousel-dots, .carousel-mini-btn) {
  background: var(--trunk-surface);
  border-color: var(--stroke);
}

.trunk-theme :is(.spec-table thead th, .model-jump-pill.is-active, .anatomy-callout.is-active,
    .anatomy-callout:hover, .carousel-arrow:hover, .carousel-mini-btn:hover) {
  background: var(--bg-alt);
}

.trunk-theme .spec-table.is-visible tbody tr:hover {
  background: var(--brand-wash);
}

.trunk-theme .carousel-dot {
  background: var(--stroke-strong);
}

.trunk-theme .carousel-dot.is-active {
  background: var(--brand-wash);
}

.trunk-theme .step-num {
  background: var(--trunk-primary);
}

.trunk-theme :is(.anatomy-dot__num, .anatomy-callout__badge) {
  /* Dark numerals retain contrast on the light green mobile markers. */
  color: var(--bg);
}

/* Legal pages use their existing standalone document styles and variable names. */
:root.trunk-theme--legal {
  --green: var(--trunk-primary);
  --green-deep: var(--brand-deep);
  --card: #111810f5;
  --danger: #ffb9b1;
}

.trunk-theme--legal :is(.doc, .foot) {
  /* Keep the reading column in front of the fixed photograph without resizing it. */
  position: relative;
  z-index: 1;
  background: var(--card);
}

.trunk-theme--legal input:is([type="email"], [type="text"]) {
  background: var(--bg-alt);
}

.trunk-theme--legal button.danger {
  background: #a23932;
}

/* The registered plates remain fixed behind the page content. */
.trunk-backdrop {
  --spot-x: 50%;
  --spot-y: 50%;
  --spot-radius: 220px;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

.trunk-backdrop__plate,
.trunk-backdrop::after {
  position: absolute;
  inset: 0;
}

.trunk-backdrop__plate {
  background-position: center 52%;
  background-size: cover;
}

.trunk-backdrop__plate--bark {
  background-image: url("../img/hero-trunk-dormant.webp");
}

.trunk-backdrop__plate--growth {
  --spot: radial-gradient(circle var(--spot-radius) at var(--spot-x) var(--spot-y),
      #000 34%, #000e 56%, #0008 76%, transparent 100%);
  background-image: url("../img/hero-trunk-living.webp");
  -webkit-mask-image: var(--spot);
  mask-image: var(--spot);
  opacity: 0;
  transition: opacity 260ms ease;
}

.trunk-backdrop.is-lit .trunk-backdrop__plate--growth {
  opacity: 1;
}

.trunk-backdrop::after {
  /* A soft black shadow keeps copy legible while leaving the outer wood grain exposed. */
  background: radial-gradient(ellipse at 50% 43%, #0008 0%, #0004 42%, transparent 72%);
  content: "";
}

.shot .trunk-backdrop__plate--growth {
  -webkit-mask-image: none;
  mask-image: none;
}

@media (prefers-reduced-motion: reduce) {
  .trunk-backdrop__plate--growth {
    -webkit-mask-image: none;
    mask-image: none;
    opacity: 1;
    transition: none;
  }
}
