@font-face {
  font-family: "Memorial Titles";
  src: url("fonts/memorial-titles-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --forest: #192115;
  --sunlight: #f4e4af;
  --vh: 1vh;
}
@supports (height: 1svh) { :root { --vh: 1svh; } }
* { box-sizing: border-box; }
html { background: var(--forest); scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body { margin: 0; color: var(--sunlight); background: var(--forest); overscroll-behavior-y: none; }
::selection { color: var(--forest); background: var(--sunlight); }
#journey { height: calc(var(--vh) * 6700); }
.scene { position: fixed; inset: 0; margin: 0; overflow: hidden; }
.scene img, .scene canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: var(--scene-focus, 5%) center;
}
.scene canvas { opacity: 0; }
.scene canvas.is-ready { opacity: 1; }
.scene[data-framing="complete"] { background: var(--forest); }
.scene[data-framing="complete"][data-ready="true"] #poster { visibility: hidden; }
.scene[data-framing="complete"] canvas {
  inset: 50% auto auto 50%;
  width: var(--frame-width);
  height: var(--frame-height);
  transform: translate(-50%, -50%);
  object-fit: fill;
}
#map-overlay { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; pointer-events: none; }
.map-backdrop { fill: var(--forest); }
.map-route, .map-route-outline { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.map-route { stroke: #ffd428; stroke-width: 5; }
.map-route-outline { stroke: #755417; stroke-opacity: .75; stroke-width: 8; }
.map-medallion { fill: #a88d54; fill-opacity: .88; }
.map-ring-inner { fill: none; stroke: #ffe3a3; stroke-width: 3; }
.map-ring-outer { fill: none; stroke: #e6bd67; stroke-width: 3; }
.map-ring-tip { fill: #ffe3a3; }
.map-pin { fill: #163e82; stroke: #fff; stroke-width: 3; }
.map-label { font: 700 28px Arial, sans-serif; text-anchor: middle; fill: #fff; stroke: #20291e; stroke-width: 3; stroke-opacity: .75; paint-order: stroke fill; }
.progress {
  position: fixed;
  inset: auto 0 0;
  height: 2px;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--sunlight);
  transform: scaleX(0);
  transform-origin: left;
}
.decoder { position: fixed; left: -2px; top: -2px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#product-title {
  transform: scale(.7);
  transform-origin: top left;
  position: fixed;
  top: max(24px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));
  max-width: calc(100vw - 48px);
  margin: 0;
  padding: 14px 20px;
  color: var(--sunlight);
  font-family: "Memorial Titles", "Times New Roman", serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
  pointer-events: none;
}
#retry, #map-toggle {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  right: max(24px, env(safe-area-inset-right));
  width: 48px;
  height: 48px;
  padding: 12px;
  border: 1px solid var(--sunlight);
  border-radius: 50%;
  color: var(--sunlight);
  background: var(--forest);
  cursor: pointer;
}
#map-toggle { right: auto; left: max(24px, env(safe-area-inset-left)); }
#retry svg, #map-toggle svg { width: 100%; height: 100%; }
#retry:hover, #map-toggle:hover { background: #354229; }
#retry:focus-visible, #map-toggle:focus-visible { outline: 2px solid var(--sunlight); outline-offset: 5px; }
[hidden] { display: none !important; }
#tree-selector {
  position: fixed;
  left: max(24px, env(safe-area-inset-left));
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
#tree-selector button {
  width: 48px;
  height: 48px;
  padding: 12px;
  border: 0;
  border-radius: 50%;
  color: var(--sunlight);
  background: transparent;
  cursor: pointer;
}
#tree-selector svg { width: 100%; height: 100%; }
.liquid-glass {
  border: 1px solid #f4e4af66;
  border-radius: 24px;
  background: radial-gradient(ellipse at top left, #f4e4af1f, transparent 65%),
    linear-gradient(135deg, #192115cc, #192115bd);
  box-shadow: 0 16px 40px #0000003d, inset 0 1px 0 #f4e4af33;
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
}
.tree-controls {
  width: 294px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 11px;
  pointer-events: auto;
}
#urn-info {
  position: fixed;
  top: max(24px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  width: 294px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  font: 400 14px/1.4 Arial, sans-serif;
  max-height: calc(calc(var(--vh) * 100) - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sunlight) var(--forest);
}
#urn-info-title {
  min-height: 2.24em;
  margin: 0;
  font: 700 18px/1.12 "Memorial Titles", "Times New Roman", serif;
  text-transform: uppercase;
  text-wrap: balance;
}
#urn-info-description { min-height: 2.8em; margin: 8px 0 0; }
.urn-info-pricing { display: grid; gap: 12px; margin: 16px 0 0; }
.urn-info-pricing > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.urn-info-pricing dt { margin: 0; }
.urn-info-pricing dd {
  margin: 0;
  font: 700 18px/1.12 "Memorial Titles", "Times New Roman", serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#urn-info-price { font-size: 22px; }
#urn-info-details { margin-top: 10px; border-top: 1px solid #f4e4af33; }
#urn-info-details summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-weight: 700; }
#urn-info-details summary:hover { text-decoration: underline; text-underline-offset: 3px; }
#urn-info-details summary:focus-visible { outline: 2px solid var(--sunlight); outline-offset: 3px; border-radius: 4px; }
#urn-info-features { display: grid; gap: 14px; margin: 4px 0 0; }
#urn-info-features dt { font-weight: 700; }
#urn-info-features dd { margin: 4px 0 0; }
.tree-info-heading { display: flex; align-items: center; gap: 8px; }
.tree-info-color {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
  border: 1px solid #f4e4af80;
  border-radius: 50%;
  background: var(--selected-tree-color, #d8899d);
}
#tree-name {
  margin: 0;
  font: 700 17px/1.12 "Memorial Titles", "Times New Roman", serif;
  text-transform: uppercase;
  text-wrap: balance;
}
#tree-description {
  min-height: 2.9em;
  max-width: 46ch;
  margin: 6px 0 0;
  font: 400 12px/1.45 Arial, sans-serif;
}
.tree-controls .tree-choices { align-self: center; padding: 0; border: 0; background: transparent; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .liquid-glass { background: var(--forest); }
}
@media (prefers-reduced-transparency: reduce) {
  .liquid-glass { background: var(--forest); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  .liquid-glass { color: CanvasText; background: Canvas; border-color: CanvasText; box-shadow: none; }
}
#journey[data-phase="tree-selector"] #retry { bottom: max(160px, calc(env(safe-area-inset-bottom) + 144px)); }
#tree-selector button:hover:enabled { background: #f4e4af18; }
#tree-selector button:disabled { opacity: .3; cursor: default; }
#tree-selector button:focus-visible { outline: 2px solid var(--sunlight); outline-offset: 2px; }
.tree-choices, .urn-choices {
  display: flex;
  align-items: center;
  padding: 4px;
  pointer-events: auto;
}
.tree-choices { border: 1px solid var(--sunlight); border-radius: 32px; background: var(--forest); }
.urn-choices { padding: 6px; border-radius: 32px; }
.tree-choice span { display: block; width: 18px; height: 18px; margin: 3px; border-radius: 50%; background: var(--tree-color); box-shadow: inset 0 0 0 1px #f4e4af60; }
.tree-choice[aria-pressed="true"] span { outline: 1px solid var(--sunlight); outline-offset: 5px; }
.urn-choice[aria-pressed="true"] { background: #f4e4af29 !important; outline: 1px solid var(--sunlight); outline-offset: -5px; }
#tree-selector[aria-busy="true"] .tree-choices,
#tree-selector[aria-busy="true"] .urn-choices { border-style: dashed; }
@media (max-width: 740px) {
  #urn-info {
    top: max(92px, calc(env(safe-area-inset-top) + 68px));
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    width: auto;
    max-width: none;
    padding: 12px 16px;
    font-size: 13px;
    max-height: calc(calc(var(--vh) * 100) - 376px);
  }
  #urn-info-title { min-height: 0; }
  #urn-info-description { min-height: 0; }
  .urn-info-pricing { grid-template-columns: 1fr 1fr; margin-top: 10px; gap: 8px; }
  #urn-info-details { margin-top: 6px; }
  .urn-info-pricing > div:first-child { grid-column: 1 / -1; }
  .urn-info-pricing > div:not(:first-child) { flex-direction: column; gap: 4px; }
  #product-title {
    transform-origin: top center;
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    max-width: none;
    text-align: center;
  }
  #tree-selector {
    left: 50%; right: auto;
    transform: translateX(-50%);
    flex-direction: column;
    max-width: calc(100vw - 32px);
  }
  .tree-controls { width: min(420px, calc(100vw - 32px)); }
}
@media (max-width: 440px) {
  .tree-controls { padding: 14px; }
  #tree-name { font-size: 22px; }
  #tree-selector { bottom: max(16px, env(safe-area-inset-bottom)); }
  #tree-selector .tree-choice { width: 40px; height: 44px; padding: 8px; }
}
@media (max-width: 360px) {
  .tree-choices { display: grid; grid-template-columns: repeat(4, 48px); }
  #tree-selector .tree-choice { width: 48px; }
  #journey[data-phase="tree-selector"] #retry { bottom: 192px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { .progress { display: none; } }

/* Keep the requested compact desktop cards without CSS zoom. On small/touch
   screens the hit areas grow, while the scene and all 24 choices stay intact. */
#tree-selector .tree-choice { width: 32px; height: 44px; padding: 7px; }
.tree-choice span { width: 14px; height: 14px; margin: 2px; }
.info-summary { display: flex; align-items: center; gap: 8px; list-style: none; }
.info-summary::-webkit-details-marker { display: none; }
.info-summary h2 { flex: 1; min-width: 0; }
.info-summary .disclosure { display: none; flex: 0 0 18px; width: 18px; height: 18px; }
.info-summary { pointer-events: none; }
#urn-info-panel[open] > .info-summary { margin-bottom: 0; }
#urn-info[data-scrollable="true"], .tree-controls[data-scrollable="true"] { overscroll-behavior: contain; }
.sr-only { clip: rect(0, 0, 0, 0); }

@media (pointer: coarse) {
  .tree-controls .tree-choices { display: grid; grid-template-columns: repeat(4, 44px); }
  #tree-selector .tree-choice { width: 44px; height: 44px; padding: 13px; }
}
@media (max-width: 740px), (max-width: 900px) and (orientation: portrait), (max-height: 580px) {
  .info-summary { min-height: 44px; cursor: pointer; pointer-events: auto; }
  .info-summary .disclosure { display: block; }
  details[open] > .info-summary .disclosure { transform: rotate(180deg); }
  .info-summary:focus-visible { outline: 2px solid var(--sunlight); outline-offset: 3px; border-radius: 4px; }
  .tree-controls .tree-choices { display: grid; grid-template-columns: repeat(4, 44px); }
  #tree-selector .tree-choice { width: 44px; height: 44px; padding: 13px; }
  #tree-name { font-size: 17px; }
  .tree-controls { gap: 4px; padding: 6px 12px; }
  #urn-info { max-height: calc(100vh - 140px); max-height: calc(var(--vh) * 100 - 140px); }
  #urn-info-title { min-height: 0; font-size: 16px; }
  #urn-info-description { min-height: 0; }
  #tree-info[open] #tree-description { margin: 0 0 6px; }
}
@media (max-width: 740px) and (orientation: portrait), (max-width: 900px) and (orientation: portrait) {
  #product-title { top: max(12px, env(safe-area-inset-top)); }
  #urn-info {
    top: max(84px, calc(env(safe-area-inset-top) + 72px));
    left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right));
    width: auto; padding: 4px 12px; font-size: 13px;
    max-height: calc(var(--vh) * 100 - 312px);
  }
  #urn-info .urn-info-body { padding: 0 0 10px; }
  #product-title { left: 16px; right: 16px; max-width: none; transform-origin: top center; text-align: center; }
  #tree-selector { left: 50%; right: auto; transform: translateX(-50%); flex-direction: column; align-items: center; bottom: max(12px, env(safe-area-inset-bottom)); gap: 4px; }
  .tree-controls { width: min(360px, calc(100vw - 32px)); }
  .urn-choices { padding: 4px; }
  #tree-selector .urn-choice, #tree-selector #urn-previous, #tree-selector #urn-next { width: 44px; height: 44px; padding: 10px; }
  #journey[data-phase="tree-selector"] #retry { top: max(148px, calc(env(safe-area-inset-top) + 136px)); bottom: auto; }
}
@media (max-height: 580px) and (orientation: landscape) {
  #product-title { top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); right: auto; max-width: 48vw; transform-origin: top left; text-align: left; }
  #urn-info { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); left: auto; width: min(294px, 44vw); padding: 4px 12px; }
  #tree-selector { left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); max-width: none; transform: none; flex-direction: row; }
  .tree-controls { width: min(294px, 46vw); max-height: calc(var(--vh) * 100 - 92px); overflow-y: auto; }
  .urn-choices { padding: 4px; }
  #tree-selector .urn-choice, #tree-selector #urn-previous, #tree-selector #urn-next { width: 44px; height: 44px; padding: 10px; }
}
@media (max-height: 580px) and (orientation: landscape) and (min-width: 740px) {
  .tree-controls { width: 384px; }
  .tree-controls .tree-choices { display: flex; }
}
