:root {
  --paper: #efede7;
  --paper-2: #e7e3da;
  --ink: #242520;
  --ink-soft: #5d5d57;
  --line: rgba(36, 37, 32, .14);
  --panel: rgba(247, 245, 239, .92);
  --accent: #8a755d;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }

.loading {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; align-content: center; gap: 18px;
  background: #22231f; color: #f4f1ea;
  transition: opacity .7s ease, visibility .7s ease;
}
.loading.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading__mark {
  width: 66px; height: 66px; border: 1px solid rgba(255,255,255,.45);
  display: grid; place-items: center; font-family: var(--serif); font-size: 31px; letter-spacing: -.04em;
}
.loading__line { width: 180px; height: 1px; overflow: hidden; background: rgba(255,255,255,.16); }
.loading__line span { display: block; width: 45%; height: 100%; background: #f4f1ea; animation: loadingLine 1.45s ease-in-out infinite; }
.loading p { margin: 0; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; opacity: .62; }
@keyframes loadingLine { 0% { transform: translateX(-110%); } 100% { transform: translateX(330%); } }

.app, .viewer { width: 100%; height: 100%; }
.topbar {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: 78px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px 0 30px; border-bottom: 1px solid var(--line);
  background: rgba(239,237,231,.83); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.brand { display: inline-flex; gap: 14px; align-items: center; color: inherit; text-decoration: none; }
.brand__mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--ink); font-family: var(--serif); font-size: 21px; line-height: 1;
}
.brand__copy { display: grid; gap: 2px; }
.brand__copy strong { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1; }
.brand__copy small { color: var(--ink-soft); font-size: 9px; letter-spacing: .07em; }
.topbar__meta { display: flex; align-items: center; gap: 16px; font-size: 10px; color: var(--ink-soft); letter-spacing: .03em; }
.status { display: inline-flex; align-items: center; gap: 7px; text-transform: uppercase; letter-spacing: .11em; font-size: 9px; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: #66715a; box-shadow: 0 0 0 3px rgba(102,113,90,.12); }
.topbar__divider { width: 1px; height: 20px; background: var(--line); }
.powered strong { color: var(--ink); font-weight: 600; }

.viewer { position: relative; overflow: hidden; background: radial-gradient(circle at 40% 45%, #f7f5ef 0%, #e9e5dc 58%, #ded9ce 100%); }
#scene { display: block; width: 100%; height: 100%; outline: 0; }
.viewer__wash { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(239,237,231,.55) 0%, rgba(239,237,231,.08) 24%, transparent 36%, transparent 76%, rgba(239,237,231,.25) 100%); }

.intro { position: absolute; z-index: 5; left: 42px; top: 135px; width: min(350px, 32vw); pointer-events: none; transition: opacity .45s ease, transform .45s ease; }
.intro.is-muted { opacity: .22; transform: translateY(-4px); }
.eyebrow { margin: 0 0 13px; text-transform: uppercase; letter-spacing: .19em; font-size: 9px; font-weight: 600; color: #77766f; }
.intro h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(43px, 4.3vw, 68px); line-height: .88; letter-spacing: -.045em; }
.intro h1 em { font-weight: 500; color: var(--accent); }
.intro__copy { margin: 24px 0 0; max-width: 315px; font-size: 12px; line-height: 1.75; color: var(--ink-soft); }

.view-label { position: absolute; z-index: 5; left: 42px; bottom: 50px; display: flex; align-items: center; gap: 14px; }
.view-label > span { font-family: var(--serif); color: var(--accent); font-size: 30px; line-height: 1; }
.view-label div { display: grid; gap: 1px; }
.view-label small { text-transform: uppercase; letter-spacing: .15em; color: #77766f; font-size: 8px; }
.view-label strong { font-family: var(--serif); font-weight: 600; font-size: 16px; }

.desktop-hint { position: absolute; z-index: 5; bottom: 32px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; color: #77766f; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; pointer-events: none; }
.mouse-icon { width: 14px; height: 21px; border: 1px solid currentColor; border-radius: 9px; display: grid; justify-items: center; }
.mouse-icon i { width: 1px; height: 4px; background: currentColor; margin-top: 4px; animation: mouseWheel 1.8s infinite; }
@keyframes mouseWheel { 0%,100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(4px); opacity: 1; } }

.panel {
  position: absolute; z-index: 10; top: 102px; right: 22px; bottom: 22px; width: min(355px, 31vw);
  display: flex; flex-direction: column; overflow: auto; scrollbar-width: none;
  padding: 28px 25px 21px; background: var(--panel); border: 1px solid rgba(36,37,32,.13);
  box-shadow: 0 18px 60px rgba(54,51,44,.11); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.panel::-webkit-scrollbar { display: none; }
.panel__handle { display: none; }
.panel__head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.panel__head .eyebrow { margin-bottom: 4px; }
.panel h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 33px; letter-spacing: -.03em; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; transition: background .2s, transform .2s; }
.icon-btn:hover { background: rgba(36,37,32,.05); transform: rotate(-14deg); }
.icon-btn svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.panel__section { padding: 22px 0 2px; }
.panel__section + .panel__section { border-top: 1px solid var(--line); margin-top: 19px; }
.section-label { margin: 0 0 11px; font-size: 8px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: #77766f; }
.actions { display: grid; }
.action { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; text-align: left; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 12px 3px; cursor: pointer; transition: background .2s, padding-left .2s; }
.action:last-child { border-bottom: 1px solid var(--line); }
.action:hover { padding-left: 7px; background: rgba(255,255,255,.28); }
.action.is-active::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; right: 4px; background: var(--accent); }
.action__num { font-family: var(--serif); font-size: 15px; color: var(--accent); }
.action > span:last-child { display: grid; gap: 1px; }
.action strong { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.action small { font-size: 8.5px; color: #797871; }
.section-heading { display: flex; justify-content: space-between; align-items: center; }
.section-heading > span { font-size: 8px; text-transform: uppercase; letter-spacing: .14em; color: #88867e; }
.swatches { display: flex; gap: 13px; flex-wrap: wrap; }
.swatch { border: 0; background: transparent; padding: 0; display: grid; gap: 5px; justify-items: center; color: #77766f; font-size: 7.5px; cursor: pointer; }
.swatch span { width: 31px; height: 31px; border-radius: 50%; background: var(--swatch); border: 3px solid #f3f0e9; box-shadow: 0 0 0 1px rgba(36,37,32,.12); transition: transform .2s, box-shadow .2s; }
.swatch.is-active span { transform: scale(1.07); box-shadow: 0 0 0 1px var(--ink), 0 4px 12px rgba(0,0,0,.12); }
.finish-note { margin: 13px 0 0; font-size: 8px; color: #85837b; line-height: 1.55; }
.panel__footer { margin-top: auto; padding-top: 22px; display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); font-size: 7.5px; color: #85837b; }
.panel__footer p { margin: 0; }
.panel__footer span { white-space: nowrap; }
.style-options { display: flex; gap: 8px; }
.style-option { flex: 1; min-height: 40px; padding: 10px 14px; border: 1px solid var(--line); background: transparent; font-size: 10px; cursor: pointer; }
.style-option:hover { background: rgba(36,37,32,.05); }
.style-option.is-active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.style-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.quote { padding: 20px 0; }
.quote__button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 14px 18px; background: var(--ink); color: var(--paper); text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: .04em; transition: background .2s; }
.quote__button:hover { background: #49483f; }
.quote__button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.quote__button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.quote p { margin: 9px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.6; }
.mobile-panel-toggle, .mobile-scrim { display: none; }

@media (max-width: 1050px) {
  .intro { width: 300px; }
  .panel { width: 330px; }
  .powered { display: none; }
  .topbar__divider { display: none; }
}

@media (max-width: 760px) {
  .topbar { height: 65px; padding: 0 17px; }
  .brand { gap: 10px; }
  .brand__mark { width: 36px; height: 36px; font-size: 18px; }
  .brand__copy strong { font-size: 16px; }
  .brand__copy small { display: none; }
  .status { font-size: 7px; }
  .viewer__wash { background: linear-gradient(180deg, rgba(239,237,231,.58), transparent 30%, transparent 68%, rgba(239,237,231,.33)); }
  .intro { top: 96px; left: 20px; width: calc(100vw - 40px); }
  .intro h1 { font-size: clamp(42px, 12.5vw, 60px); }
  .intro__copy { font-size: 10px; max-width: 270px; margin-top: 16px; }
  .view-label { left: 20px; bottom: 76px; }
  .desktop-hint { display: none; }
  .panel {
    position: fixed; top: auto; right: 0; bottom: 0; left: 0; width: 100%; height: min(76vh, 650px);
    border: 0; border-top: 1px solid var(--line); padding: 13px 20px calc(24px + env(safe-area-inset-bottom));
    transform: translateY(101%); transition: transform .45s cubic-bezier(.22,.7,.2,1); border-radius: 18px 18px 0 0;
  }
  .panel.is-open { transform: translateY(0); }
  .panel__handle { display: grid; place-items: center; height: 20px; margin: -5px -20px 6px; cursor: pointer; }
  .panel__handle span { width: 38px; height: 3px; border-radius: 5px; background: rgba(36,37,32,.2); }
  .panel h2 { font-size: 30px; }
  .mobile-scrim { position: fixed; z-index: 8; inset: 0; display: block; background: rgba(26,27,24,.2); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
  .mobile-scrim.is-visible { opacity: 1; visibility: visible; }
  .mobile-panel-toggle { position: fixed; z-index: 9; left: 50%; bottom: calc(17px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 11px; min-width: 172px; height: 43px; border: 1px solid var(--ink); background: #efede7; box-shadow: 0 8px 30px rgba(37,35,30,.15); cursor: pointer; font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
  .mobile-panel-toggle svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform .35s; }
  .mobile-panel-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .panel__footer { margin-top: 24px; }
}

@media (max-width: 430px) {
  .intro__copy { max-width: 230px; }
  .view-label > span { font-size: 24px; }
  .view-label strong { font-size: 14px; }
}

.panel > * { flex-shrink: 0; }
button:disabled { cursor: wait; opacity: .5; }
.loading__retry { padding: 12px 24px; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; }

button.quote__button { width: 100%; border: 0; cursor: pointer; }
