/*
 * One stylesheet for every page. Phone first: most visitors arrive from Telegram on a
 * mid-range Android, so it is small, uses system fonts (no font download), and keeps
 * the main action reachable with one thumb.
 */

:root {
  --bg: #f6f2ec;
  --surface: #ffffff;
  --ink: #1f1b16;
  --muted: #6a6157;
  --line: #e2d9cc;
  --accent: #0e5c49;
  --accent-press: #0a4638;
  --on-accent: #ffffff;
  --stage-a: #ffffff;
  --stage-b: #ebe4d8;
  --note-bg: #e9f1ee;
  --note-ink: #1f3f38;
  --warn-bg: #fdf1d3;
  --warn-ink: #5a4200;
  --radius: 14px;
  /* The Ethiopic fallbacks cover Android (Noto), iPhone (Kefa) and Windows (Nyala, Ebrima). */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Ethiopic", "Abyssinica SIL", Kefa, Nyala, Ebrima, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
}

[hidden] {
  display: none !important;
}

/* Both languages are in the page; show the chosen one. */
html[data-lang="en"] [data-l="am"],
html[data-lang="am"] [data-l="en"] {
  display: none;
}

h1,
h2,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 650;
}

a {
  color: var(--accent);
}

img {
  max-width: 100%;
}

.num {
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 3px solid #1565c0;
  outline-offset: 2px;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px;
}

/* ------------------------------------------------------------------ bar */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 6px 8px 6px 16px;
  min-height: 52px;
}

.bar__back,
.bar__brand {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  padding: 10px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar__lang {
  flex: none;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.btn--primary:active {
  background: var(--accent-press);
}

.btn--big {
  width: 100%;
  min-height: 56px;
  font-size: 18px;
}

.btn--quiet {
  border-color: var(--line);
  background: var(--surface);
  font-weight: 500;
}

.btn--small {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 15px;
}

.icon {
  flex: none;
}

/* --------------------------------------------------------------- viewer */

.viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 66vh;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, var(--stage-a) 0%, var(--stage-b) 100%);
}

.viewer__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.25s;
}

.viewer.is-loaded .viewer__poster {
  opacity: 0;
  visibility: hidden;
}

.viewer model-viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  --poster-color: transparent;
  --progress-bar-color: var(--accent);
  --progress-bar-height: 3px;
  --min-hotspot-opacity: 1;
}

/* The page has its own, bigger "View in your room" button. */
.viewer model-viewer::part(default-ar-button) {
  display: none;
}

.viewer__load {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 2;
  transform: translateX(-50%);
  min-height: 44px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.18);
}

.viewer__load .when-loading,
.viewer.is-loading .viewer__load .when-idle {
  display: none;
}

.viewer.is-loading .viewer__load .when-loading {
  display: inline;
}

.viewer.is-loading .viewer__load {
  background: rgb(31 27 22 / 0.72);
  cursor: progress;
}

/* Measurements drawn on the model. */
.dot {
  display: block;
  width: 1px;
  height: 1px;
  visibility: hidden;
}

.dim {
  display: none;
  transform: translate(-50%, -50%);
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
}

.dim-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: none;
}

.dim-lines line {
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.viewer.show-sizes .dim,
.viewer.show-sizes .dim-lines {
  display: block;
}

.viewer.in-ar .dim,
.viewer.in-ar .dim-lines {
  display: none;
}

/* -------------------------------------------------------------- product */

.product {
  max-width: 1040px;
  margin: 0 auto;
}

.product__info {
  padding: 14px 16px 8px;
}

.actions:empty {
  display: none;
}

.hint {
  margin-top: 8px;
  font-size: 15px;
  color: var(--muted);
}

.hint--quiet {
  font-size: 14px;
}

.notice {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--note-bg);
  color: var(--note-ink);
  font-size: 15px;
}

.notice--warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.notice .btn {
  display: flex;
  width: fit-content;
  margin-top: 10px;
  background: var(--surface);
}

.product__name {
  margin-top: 18px;
}

.price {
  margin-top: 4px;
  font-size: 18px;
}

.price b {
  font-size: 22px;
}

.dims {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.dims__row {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.dims dt {
  font-size: 13px;
  color: var(--muted);
}

.dims dd {
  font-size: 15px;
  white-space: nowrap;
}

.dims dd b {
  font-size: 21px;
  font-weight: 650;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 6px;
  font-size: 15px;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.product__text {
  margin-top: 12px;
  color: var(--ink);
}

.contact {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.desktop-qr {
  display: none;
}

.credit {
  font-size: 12px;
}

@media (min-width: 640px) {
  .viewer {
    border-radius: var(--radius);
  }
}

@media (min-width: 900px) {
  .product {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    padding: 16px 24px 24px;
  }

  .viewer {
    position: sticky;
    top: 16px;
    max-height: 80vh;
  }

  .product__info {
    padding: 0;
  }

  .product__name {
    margin-top: 14px;
  }
}

/* A laptop cannot place a sofa in a room; offer the QR code to move to the phone. */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .desktop-qr {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .desktop-qr img {
    flex: none;
  }
}

/* Showroom tablet: the seller is standing right there. */
.is-showroom .contact,
.is-showroom .desktop-qr {
  display: none;
}

/* ------------------------------------------------------------ catalogue */

.shop-head {
  margin-bottom: 16px;
}

.shop-head__area {
  color: var(--muted);
}

.shop-head__intro {
  margin-top: 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.card__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: radial-gradient(ellipse at 50% 40%, var(--stage-a) 0%, var(--stage-b) 100%);
}

.card__name {
  padding: 10px 12px 0;
  font-weight: 600;
  line-height: 1.3;
}

.card__price {
  padding: 2px 12px 0;
}

.card__size {
  margin-top: auto;
  padding: 4px 12px 12px;
  font-size: 14px;
  color: var(--muted);
}

@media (min-width: 700px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1000px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ----------------------------------------------------------------- home */

.home {
  max-width: 720px;
}

.home section {
  margin-top: 28px;
}

.home__hero h1 {
  font-size: 30px;
  line-height: 1.2;
}

.home__lead {
  margin-top: 12px;
  font-size: 18px;
}

.home__demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.home__demo img {
  display: block;
  width: 100%;
  height: auto;
  background: radial-gradient(ellipse at 50% 40%, var(--stage-a) 0%, var(--stage-b) 100%);
}

.home__demo-text {
  display: grid;
  gap: 6px;
  padding: 12px 14px 12px 0;
}

.home__demo-text .btn {
  margin-top: 6px;
  min-height: 44px;
  padding: 8px 12px;
}

.home__list,
.home__steps {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-left: 22px;
}

.home__cta {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

@media (min-width: 560px) {
  .home__cta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ------------------------------------------------------ message + footer */

.message {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding-top: 40px;
  padding-bottom: 40px;
}

.foot {
  max-width: 1040px;
  margin: 24px auto 0;
  padding: 16px 16px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.foot a {
  color: inherit;
}

/* ----------------------------------------------------------- price tags */

.page-tags {
  background: #fff;
}

.tags__help {
  display: grid;
  gap: 10px;
  max-width: 190mm;
  margin: 0 auto;
  padding: 16px;
}

.tags__buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tags__sheet {
  display: grid;
  grid-template-columns: repeat(2, 95mm);
  justify-content: center;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.tag {
  display: flex;
  justify-content: space-between;
  gap: 4mm;
  height: 68mm;
  padding: 6mm;
  border: 0.3mm dashed #8a8a8a;
  break-inside: avoid;
  page-break-inside: avoid;
  color: #000;
}

.tag__text {
  display: grid;
  align-content: start;
  gap: 1.5mm;
  min-width: 0;
}

.tag__name {
  font-size: 15pt;
  font-weight: 700;
  line-height: 1.2;
}

.tag__name2 {
  font-size: 10.5pt;
}

.tag__size {
  margin-top: 2mm;
  font-size: 11pt;
}

.tag__price {
  font-size: 13pt;
}

.tag__price b {
  font-size: 18pt;
}

.tag__qr {
  flex: none;
  width: 36mm;
  text-align: center;
}

.tag__qr svg {
  display: block;
  width: 36mm;
  height: 36mm;
}

.tag__cta {
  margin-top: 1.5mm;
  font-size: 7pt;
  line-height: 1.3;
}

.tag__url {
  margin-top: 1mm;
  font-size: 6pt;
  word-break: break-all;
  color: #333;
}

@page {
  size: A4;
  margin: 10mm;
}

@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
  }
}

@media screen and (max-width: 200mm) {
  .tags__sheet {
    grid-template-columns: minmax(0, 95mm);
  }
}

/* ------------------------------------------------------ census and lab */

.tool {
  max-width: 640px;
}

.tool h1 {
  font-size: 22px;
}

.tool__lead {
  margin-top: 6px;
  color: var(--muted);
}

.step {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.step h2 {
  font-size: 17px;
}

.step > * + * {
  margin-top: 10px;
}

.step .viewer {
  border-radius: 10px;
  max-height: 46vh;
}

.facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  font-size: 14px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  overflow-wrap: anywhere;
}

.answers {
  display: grid;
  gap: 8px;
}

.answers .btn {
  justify-content: flex-start;
  text-align: left;
  font-weight: 500;
}

.answers .btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--note-bg);
  font-weight: 650;
}

.field {
  display: grid;
  gap: 4px;
}

.field label {
  font-size: 14px;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.status {
  font-weight: 600;
}

.status--ok {
  color: var(--accent);
}

.status--bad {
  color: #9b2c1b;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
