/* Ettix Walkthrough: warm architectural palette, system fonts only (no external requests). */
:root {
  --paper: #f6f1ea;
  --paper-deep: #ece4d8;
  --ink: #2a2622;
  --ink-soft: #5c544b;
  --line: #d8ccbb;
  --accent: #a4532f;
  --accent-dark: #833f21;
  --sage: #6d7b62;
  --danger: #a3302a;
  --ok: #3f6b3f;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}
a { color: var(--accent-dark); }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); margin: 0 0 0.5em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 0 0 0.6em; }
h3 { font-size: 1.25rem; margin: 0 0 0.4em; }
p { margin: 0 0 1em; }
small, .muted { color: var(--ink-soft); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--line); background: rgba(246, 241, 234, 0.94); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--accent); }
.nav a.btn, .nav a.btn:hover, .nav a.btn:focus-visible { color: #fff; }
.site-footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 32px 0; font-size: 0.9rem; color: var(--ink-soft); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--ink-soft); margin-right: 16px; }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0.7em 1.3em; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.secondary { background: transparent; color: var(--accent-dark); }
.btn.secondary:hover { background: var(--paper-deep); color: var(--accent-dark); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

form.stack, .stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input[type="email"], input[type="password"], input[type="text"], input[type="url"], input[type="number"], textarea, select {
  font: inherit; padding: 0.65em 0.8em; border: 1px solid var(--line); border-radius: 8px; background: #fffdfa; color: var(--ink); width: 100%;
}
input:focus, textarea:focus, select:focus, .btn:focus-visible, .wt-btn:focus-visible { outline: 3px solid rgba(164, 83, 47, 0.35); outline-offset: 2px; }
textarea { min-height: 90px; resize: vertical; }

.notice { padding: 12px 16px; border-radius: 8px; background: var(--paper-deep); border-left: 4px solid var(--sage); margin: 0 0 16px; }
.notice.error { border-left-color: var(--danger); background: #f6e3df; }
.notice.ok { border-left-color: var(--ok); background: #e5eedf; }

/* Landing */
.hero { padding: 48px 0 24px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.hero-copy { max-width: 760px; }
.hero-copy .lead { font-size: 1.2rem; color: var(--ink-soft); }
.demo-frame { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--paper-deep); box-shadow: 0 24px 60px -30px rgba(42, 38, 34, 0.45); }
.demo-viewer { height: min(68vh, 620px); min-height: 380px; position: relative; z-index: 1; }
.demo-placeholder { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; background: linear-gradient(180deg, #f3ede4, #e2d9cb); color: var(--ink-soft); font-size: 0.95rem; letter-spacing: 0.04em; }
.demo-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.demo-flag { display: inline-block; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); background: rgba(255, 253, 250, 0.85); padding: 2px 10px; border-radius: 999px; margin-bottom: 8px; }
.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.demo-caption { font-size: 0.88rem; color: var(--ink-soft); margin-top: 10px; }
.demo-start {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  background: linear-gradient(180deg, rgba(236, 228, 216, 0.55), rgba(236, 228, 216, 0.92));
  z-index: 5;
}
.section { padding: 56px 0 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.card { background: #fffdfa; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card.featured { border-color: var(--accent); }
.price { font-family: var(--serif); font-size: 2.6rem; margin: 0.2em 0; }
.price small { font-size: 1rem; font-family: var(--sans); }
ul.checks { list-style: none; padding: 0; margin: 0 0 1em; }
ul.checks li { padding-left: 1.5em; position: relative; margin: 0.35em 0; }
ul.checks li::before { content: "\2713"; color: var(--sage); position: absolute; left: 0; }

/* Dashboard */
.app-main { padding: 36px 0; }
.auth-card { max-width: 440px; margin: 24px auto; }
.project-list { display: grid; gap: 16px; }
.project-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.badge { display: inline-block; font-size: 0.8rem; padding: 2px 10px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); border: 1px solid var(--line); }
.badge.live { background: #e5eedf; color: var(--ok); border-color: #c4d6ba; }
.badge.warn { background: #f6e3df; color: var(--danger); border-color: #e6c2bb; }
.editor { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.editor-viewer { height: 520px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--paper-deep); }
.panel { display: grid; gap: 18px; }
.progress-outer { height: 8px; background: var(--paper-deep); border-radius: 999px; overflow: hidden; }
.progress-inner { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Public tour */
.tour-body { background: var(--ink); color: #f3ede4; }
.tour-layout { display: grid; grid-template-rows: auto 1fr; height: 100vh; height: 100dvh; }
.tour-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 18px; background: #1f1c19; }
.tour-head h1 { font-size: 1.2rem; margin: 0; color: #f3ede4; }
.tour-head p { margin: 0; font-size: 0.85rem; color: #c9bfb2; }
.tour-head a { color: #f0b48f; }
.tour-viewer { height: 100%; min-height: 0; }
.tour-message { display: grid; place-items: center; height: 100%; padding: 24px; text-align: center; }
.tour-credit { font-size: 0.75rem; color: #a99d8f; }

/* Viewer */
.wt-viewer { position: relative; width: 100%; overflow: hidden; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--paper-deep); }
.wt-viewer:fullscreen { height: 100vh; }
.wt-stage, .wt-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wt-toolbar { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 3; flex-wrap: wrap; justify-content: flex-end; }
.wt-btn { font: 600 0.85rem var(--sans); padding: 0.5em 0.95em; border-radius: 999px; border: 1px solid rgba(42, 38, 34, 0.15); background: rgba(255, 253, 250, 0.92); color: var(--ink); cursor: pointer; }
.wt-btn:hover { background: #fff; }
.wt-btn:disabled { opacity: 0.6; cursor: default; }
.wt-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.wt-btn[aria-pressed="true"]:hover { background: var(--accent-dark); }
.wt-quality-status { position: absolute; top: 12px; left: 12px; z-index: 3; max-width: calc(100% - 24px); font: 500 0.78rem var(--sans); padding: 5px 11px; border-radius: 999px; background: rgba(255, 253, 250, 0.9); color: var(--ink); border: 1px solid rgba(42, 38, 34, 0.12); pointer-events: none; }
.wt-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wt-hint { position: absolute; left: 12px; bottom: 12px; right: 12px; text-align: center; font-size: 0.82rem; color: var(--ink); pointer-events: none; z-index: 2; }
.wt-hint:empty { display: none; }
.wt-hint { text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8); }
.wt-status { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center; z-index: 4; background: rgba(236, 228, 216, 0.85); }
.wt-status-text { margin: 0; color: var(--ink-soft); }
.wt-progress { width: 220px; height: 6px; border-radius: 999px; background: rgba(42, 38, 34, 0.12); overflow: hidden; margin: 0 auto; }
.wt-progress-bar { height: 100%; width: 0; background: var(--accent); }
.wt-error { position: absolute; inset: auto 16px 16px 16px; padding: 14px 16px; background: #f6e3df; color: var(--danger); border-radius: 8px; z-index: 6; border: 1px solid #e6c2bb; }
.wt-joystick { position: absolute; left: 22px; bottom: 44px; width: 116px; height: 116px; border-radius: 50%; background: rgba(255, 253, 250, 0.5); border: 2px solid rgba(42, 38, 34, 0.25); z-index: 3; touch-action: none; }
.wt-joystick-knob { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: rgba(164, 83, 47, 0.85); pointer-events: none; }

/* Rendered 360 degree views (panorama.js): opt-in button row under the demo and the full-screen overlay. */
.demo-panorama-row { margin-top: 12px; font-size: 0.88rem; align-items: flex-start; }
.demo-panorama-row .btn { flex: 0 0 auto; }
.demo-panorama-row span { flex: 1 1 260px; }
.pano-overlay { position: fixed; inset: 0; z-index: 1000; background: #1f1c19; color: #f3ede4; display: block; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.pano-stage, .pano-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pano-stage { outline: none; cursor: grab; }
.pano-stage:active { cursor: grabbing; }
.pano-stage:focus-visible { outline: 3px solid rgba(240, 180, 143, 0.7); outline-offset: -3px; }
.pano-bar { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; z-index: 3; pointer-events: none; }
.pano-bar > * { pointer-events: auto; }
.pano-bar-top { top: 0; background: rgba(31, 28, 25, 0.78); border-bottom: 1px solid rgba(243, 237, 228, 0.12); }
.pano-bar-top > * { pointer-events: auto; }
.pano-bar-bottom { bottom: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(31, 28, 25, 0.85), rgba(31, 28, 25, 0)); }
.pano-title { font-size: 0.9rem; line-height: 1.4; max-width: 720px; }
.pano-title strong { font-family: var(--serif); font-weight: 500; font-size: 1.1rem; display: block; }
.pano-note { color: #e3dacd; }
.pano-close { flex: 0 0 auto; }
.pano-views, .pano-zoom { display: flex; gap: 8px; flex-wrap: wrap; }
.pano-zoom .wt-btn { min-width: 2.6em; font-size: 1.05rem; line-height: 1; }
.pano-label { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 2; font-family: var(--serif); font-size: 1.1rem; color: #f3ede4; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); pointer-events: none; }
.pano-hint { position: absolute; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); text-align: center; font-size: 0.85rem; color: rgba(243, 237, 228, 0.85); pointer-events: none; z-index: 1; opacity: 0; animation: pano-hint 6s ease forwards; }
@keyframes pano-hint { 0% { opacity: 0; } 10% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.pano-status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; display: grid; gap: 10px; justify-items: center; text-align: center; max-width: min(90vw, 420px); padding: 14px 18px; border-radius: 10px; background: rgba(31, 28, 25, 0.88); border: 1px solid rgba(243, 237, 228, 0.2); }
.pano-status-text { margin: 0; color: #f3ede4; }
.pano-status.pano-status-quiet { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 640px) {
  .pano-bar-top { flex-direction: column; align-items: flex-start; }
  .pano-note { display: none; }
  .pano-label { bottom: 84px; }
}

.prose h2 { margin-top: 1.6em; }
.prose li { margin: 0.3em 0; }
.study-render { display: block; max-width: 100%; height: auto; }
#local-ai-review { scroll-margin-top: 80px; }
@media (max-width: 560px) {
  #local-ai-review { scroll-margin-top: 160px; }
}

@media (max-width: 860px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-viewer { height: 400px; }
  .nav { gap: 12px; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .demo-viewer { min-height: 340px; }
  .wt-quality-status { top: auto; bottom: 40px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
}
