:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --ink: #23201c;
  --muted: #7a736a;
  --line: #e6e0d7;
  --accent: #23201c;
  --user-bubble: #23201c;
  --user-ink: #f7f4ef;
  --stage: radial-gradient(circle at 50% 40%, #ffffff 0%, #efe9e0 75%);
  --error: #a33a2c;
  --sans: "Manrope", system-ui, sans-serif;
  --display: "Space Grotesk", "Manrope", sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
}

/* The font files are Latin-only, so Hebrew pages use the platform's Hebrew
   coverage, as Neo does, and drop the Latin tracking on the wordmark. */
html[lang="he"] {
  --sans: Arial, "Helvetica Neue", sans-serif;
  --display: Arial, "Helvetica Neue", sans-serif;
  --mono: "DM Mono", Arial, sans-serif;
}
html[lang="he"] :is(h1, h2, .brand) { letter-spacing: normal; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }

.studio { display: flex; flex-direction: column; height: 100dvh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; border-bottom: 1px solid var(--line);
}
.brand { font: 600 13px var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.link-button { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.languages { display: flex; gap: 10px; font-size: 13px; }
.language { color: var(--muted); text-decoration: none; }
.language:hover { color: var(--ink); }
.language[aria-current] { color: var(--ink); font-weight: 600; }

.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); }

/* Preview */
.preview-pane { overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 24px; }
.ring-stage { background: var(--stage); border-radius: 18px; padding: 24px 12px 12px; text-align: center; }
.ring-svg { width: 100%; max-width: 460px; height: auto; display: block; margin: 0 auto; }
.ring-shadow { fill: #000; opacity: .07; }
.ring-canvas { display: none; width: 100%; max-width: 560px; aspect-ratio: 4 / 3; margin: 0 auto; }
.ray-traced .ring-canvas { display: block; }
.ray-traced .ring-svg { display: none; }

.spec h1 { font: 600 34px/1.12 var(--display); letter-spacing: -.035em; margin: 0; }
.tagline { color: var(--muted); margin: 4px 0 18px; }
.spec-list { margin: 0; border-top: 1px solid var(--line); }
.spec-list div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.spec-list dt { color: var(--muted); }
.spec-list dd { margin: 0; text-align: end; }

.breakdown { margin-top: 18px; }
.breakdown summary { display: flex; align-items: baseline; justify-content: space-between; cursor: pointer; list-style: none; }
.breakdown summary::-webkit-details-marker { display: none; }
.price { font: 500 30px var(--mono); letter-spacing: -.02em; }
.currency { font-family: var(--sans); font-size: .68em; font-weight: 500; margin-inline-end: 1px; }
.lead { color: var(--muted); font-size: 13px; }
.breakdown ul { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.breakdown li { display: flex; justify-content: space-between; padding: 3px 0; }

/* Ring selector */
.rings { flex: 1; overflow-y: auto; width: 100%; max-width: 1180px; margin: 0 auto; padding: 36px 28px 48px; }
.rings h1 { font: 600 40px/1.12 var(--display); letter-spacing: -.035em; margin: 0; }
.rings .intro { color: var(--muted); margin: 8px 0 28px; max-width: 60ch; }
.in-progress { margin: -14px 0 24px; font-size: 14px; }
.in-progress a { color: var(--ink); text-underline-offset: 3px; }
.ring-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ring-card { display: flex; flex-direction: column; gap: 14px; }
.ring-card .ring-stage { padding: 12px 8px 4px; }
.ring-card h2 { font: 600 28px/1.2 var(--display); letter-spacing: -.02em; margin: 0; }
.ring-card .tagline { margin: 4px 0 10px; }
.from { font-weight: 500; margin: 0 0 12px; }

/* Chat */
.chat-pane { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-inline-start: 1px solid var(--line); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 24px 22px; display: flex; flex-direction: column; }
#messages { display: flex; flex-direction: column; gap: 12px; }

.message { max-width: 85%; padding: 10px 14px; border-radius: 16px; }
.message p { margin: 0; }
.message p + p { margin-top: 8px; }
.message.assistant { align-self: flex-start; background: var(--bg); border-end-start-radius: 4px; }
.message.user { align-self: flex-end; background: var(--user-bubble); color: var(--user-ink); border-end-end-radius: 4px; }
.message.error { align-self: stretch; max-width: none; color: var(--error); border: 1px solid currentColor; font-size: 13px; }

.typing { display: flex; gap: 4px; margin-top: 12px; padding: 14px; }
.typing[hidden] { display: none; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--ink); }

.composer { display: flex; gap: 8px; align-items: flex-end; padding: 14px 16px; border-top: 1px solid var(--line); }
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px;
  font: inherit; color: var(--ink); background: var(--surface); max-height: 160px;
}
.composer textarea:focus { outline: none; border-color: var(--ink); }
.send { border: 0; border-radius: 14px; padding: 10px 18px; background: var(--accent); color: var(--surface); font: 500 14px var(--sans); cursor: pointer; }
.send:disabled { opacity: .4; cursor: default; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171513; --surface: #1f1c19; --ink: #f1ece4; --muted: #a39b90; --line: #34302b;
    --accent: #f1ece4; --user-bubble: #f1ece4; --user-ink: #171513;
    --stage: radial-gradient(circle at 50% 40%, #2c2824 0%, #1a1816 75%); --error: #ef8a7a;
  }
  .ring-shadow { opacity: .35; }
}

@media (max-width: 820px) {
  .rings { padding: 20px 16px 32px; }
  .rings h1 { font-size: 30px; }
  .ring-cards { grid-template-columns: 1fr; gap: 28px; }
  .layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .preview-pane { padding: 12px 16px; flex-direction: row; align-items: center; gap: 12px; overflow: visible; }
  .ring-stage { flex: 0 0 42%; padding: 8px 4px 4px; }
  .spec h1 { font-size: 22px; }
  .spec .tagline, .spec-list { display: none; }
  .price { font-size: 22px; }
  .breakdown summary { flex-direction: column; align-items: flex-start; }
  .chat-pane { border-inline-start: 0; border-top: 1px solid var(--line); }
  .chat-scroll { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .topbar-actions { gap: 12px; }
  .brand { letter-spacing: .12em; }
}
