/* Embercote. A made-up second-hand furniture shop; a concept by ALLOIC.
   One colour field for the piece, big type, one action colour. */

:root {
  --ink: #141414;
  --paper: #ffffff;
  --tone: #f0f2f3;
  --soft: #4b4f52;
  --act: #ff4a00;
  --stage: #e2e6e9;
  --m: clamp(1rem, 4vw, 4rem);
  --gap: clamp(4.5rem, 10vw, 9rem);
  --display: 'Funnel Display', 'Helvetica Neue', Arial, sans-serif;
  --text: 'Funnel Sans', 'Helvetica Neue', Arial, sans-serif;
  --s-small: 0.9375rem;
  --s-ui: 1rem;
  --s-body: 1.1875rem;
  --s-lead: 1.5rem;
  --s-h2: clamp(2.5rem, 5.2vw, 4.75rem);
  --s-h1: clamp(2.5rem, 5.6vw, 5.5rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --r: 1.25rem;
}
html[data-light="daylight"] { --stage: #d4e4ee; }
html[data-light="evening"] { --stage: #ead7ce; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--text); font-size: var(--s-body); line-height: 1.5; overflow-x: clip; }
h1, h2, p, ul, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 0.09em; text-underline-offset: 0.2em; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
section[id] { scroll-margin-top: 1rem; }

.sr { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -0.035em; line-height: 0.98; text-wrap: balance; }
h1 { font-size: var(--s-h1); }
h2 { font-size: var(--s-h2); }
.lead { font-size: var(--s-lead); line-height: 1.35; max-width: 30ch; }

/* ---------- the concept strip ---------- */
.strip { background: var(--ink); color: var(--paper); padding: 0.7rem var(--m); font-size: var(--s-small); line-height: 1.4; }
.strip a { font-weight: 600; white-space: nowrap; margin-left: 0.35em; }
.strip :focus-visible { outline-color: var(--paper); }

/* ---------- masthead ---------- */
.mast { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem var(--m); background: var(--stage); transition: background-color 0.6s var(--ease); }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 1.75rem; letter-spacing: -0.04em; text-decoration: none; line-height: 1; min-height: 44px; display: inline-flex; align-items: center; }
.mast__nav { display: flex; gap: clamp(0.5rem, 2vw, 2rem); }
.mast__nav a { font-size: var(--s-ui); font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 0.25rem; }
.mast__nav a:hover { text-decoration: underline; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3.5rem; padding: 0 1.75rem; border-radius: 999px; background: var(--act); color: var(--ink); font-weight: 700; font-size: var(--s-body); text-decoration: none; white-space: nowrap; transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: scale(0.98); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--act); color: var(--ink); }
.link { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

.chip { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 3rem; padding: 0 1.15rem; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: var(--s-ui); font-weight: 600; white-space: nowrap; transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease); }
.chip:hover { background: var(--ink); color: var(--paper); }
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip[aria-busy="true"] { opacity: 0.6; }
.chip--ar { background: var(--act); color: var(--ink); font-weight: 700; }

.rnd { width: 3rem; height: 3rem; border-radius: 50%; background: var(--paper); color: var(--ink); display: grid; place-items: center; transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease); }
.rnd:hover { background: var(--ink); color: var(--paper); }
.rnd:active { transform: scale(0.94); }

/* ---------- the piece: first screen ---------- */
.hero { background: var(--stage); transition: background-color 0.6s var(--ease); display: flex; flex-direction: column; }
.hero__head { display: contents; }
.hero h1 { order: 1; padding: 0.5rem var(--m) 0; }
.hero__tag { order: 1; padding: 0.4rem var(--m) 0; line-height: 1.35; }
.hero__line { display: none; }
.hero__buy { order: 2; padding: 0.9rem var(--m) 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; }
.price { display: flex; flex-direction: column; line-height: 1.1; }
.price__n { font-family: var(--display); font-weight: 700; font-size: 2.5rem; letter-spacing: -0.03em; }
.price__note { font-size: var(--s-small); color: var(--soft); margin-top: 0.2rem; }
.hero__act { display: flex; align-items: center; gap: 1.25rem; }
.hero__act .link { display: none; }
.stage { order: 3; display: flex; flex-direction: column; min-width: 0; position: relative; }
.rail { order: 5; padding: 1.5rem var(--m) 2rem; }

.viewer { position: relative; height: min(112vw, 31rem); min-height: 19rem; }
model-viewer { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; --poster-color: transparent; --progress-bar-color: transparent; --progress-bar-height: 0px; opacity: 0; transition: opacity 0.45s var(--ease); }
.viewer.is-live model-viewer { opacity: 1; }
.pan-off { display: none; pointer-events: none; } /* model-viewer's own pan marker would swallow a drag that starts dead centre */
.still { position: absolute; inset: 0; margin: auto; width: auto; height: 100%; max-width: 100%; aspect-ratio: 1; object-fit: contain; opacity: 0.9; transition: opacity 0.45s var(--ease); pointer-events: none; }
.js .viewer.is-live .still { opacity: 0; }
.viewer.is-failed .still { opacity: 1; }
.viewer.is-failed model-viewer, .viewer.is-failed .overlay, .viewer.is-failed ~ .view { display: none; }
.fail { position: absolute; left: var(--m); right: var(--m); bottom: 1rem; margin-inline: auto; max-width: 34rem; background: var(--paper); border-radius: var(--r); padding: 0.9rem 1.1rem; font-size: var(--s-ui); line-height: 1.4; }

.overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.overlay__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dim { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.person circle, .person path { fill: var(--ink); fill-opacity: 0.16; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.tag { position: absolute; left: 0; top: 0; background: var(--paper); color: var(--ink); font-size: var(--s-ui); font-weight: 700; line-height: 1; padding: 0.55rem 0.8rem; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; will-change: transform; }
.tag--person { background: var(--ink); color: var(--paper); }

.loader { position: absolute; inset: auto 0 1.25rem 0; display: grid; justify-items: center; gap: 0.6rem; pointer-events: none; transition: opacity 0.3s var(--ease); }
.loader.is-done { opacity: 0; }
.loader__text { font-size: var(--s-ui); font-weight: 600; background: var(--paper); border-radius: 999px; padding: 0.5rem 1rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.loader__bar { width: min(15rem, 60%); height: 6px; border-radius: 3px; background: var(--paper); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left center; transition: transform 0.2s linear; }
.loader.no-bar .loader__bar { visibility: hidden; }

.hint { position: absolute; left: 50%; top: 0.75rem; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 0.6rem; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 0.65rem 1.1rem; font-size: var(--s-ui); line-height: 1.2; white-space: nowrap; pointer-events: none; transition: opacity 0.4s var(--ease); }
.hint.is-gone { opacity: 0; }
.showcase .hint, .showcase .loader, .showcase #ar-note { display: none; }

.view { display: flex; gap: 0.5rem; padding: 0 var(--m); }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem 2rem; padding: 1rem var(--m) 1.25rem; }
.tools__group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.tools__label { font-size: var(--s-ui); font-weight: 700; margin-right: 0.35rem; }
.tools__note { flex-basis: 100%; font-size: var(--s-small); color: var(--soft); line-height: 1.4; max-width: 62ch; }

.rail__label { font-size: var(--s-ui); font-weight: 700; margin-bottom: 0.6rem; }
.rail__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; max-width: 26rem; }
.thumb { display: block; width: 100%; aspect-ratio: 1; border-radius: var(--r); background: var(--paper); overflow: hidden; position: relative; transition: transform 0.25s var(--ease); }
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8%; transition: transform 0.35s var(--ease); }
.thumb:hover img { transform: scale(1.08); }
.thumb[aria-pressed="true"]::after { content: ""; position: absolute; inset: 0; border: 3px solid var(--ink); border-radius: inherit; }

/* ---------- sections ---------- */
.about, .week, .visit { padding: var(--gap) var(--m) 0; }
.about__grid { display: grid; gap: 2rem; margin-top: clamp(1.75rem, 4vw, 3.5rem); }
.about__text { max-width: 34ch; }
.facts { display: grid; gap: 1.5rem; }
.facts dt { font-weight: 700; }
.facts dd { max-width: 46ch; }
.facts__soft { color: var(--soft); }

.fit { margin-top: var(--gap); background: var(--tone); padding: clamp(3.5rem, 8vw, 7rem) var(--m); display: grid; gap: 2.5rem; }
.fit .lead { margin-top: 1.25rem; }
.form { display: grid; gap: 1.25rem; max-width: 30rem; }
.fit .form { margin-top: 2rem; }
.units { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.units legend { float: left; font-weight: 700; margin-right: 0.85rem; padding: 0; line-height: 3rem; }
.seg { position: relative; display: inline-flex; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 3rem; padding: 0 1.15rem; border-radius: 999px; background: var(--paper); font-size: var(--s-ui); font-weight: 600; transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.field label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.field__opt { font-weight: 400; color: var(--soft); }
.field__box { display: flex; align-items: center; background: var(--paper); border: 2px solid var(--ink); border-radius: 0.9rem; transition: border-color 0.2s var(--ease); }
.field__box:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.field__box input, .field__box textarea { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0.85rem 1rem; min-height: 3.25rem; font-size: var(--s-body); outline: none; border-radius: inherit; }
.field__box textarea { resize: vertical; line-height: 1.4; display: block; }
.field__unit { padding: 0 1rem 0 0.25rem; font-weight: 600; color: var(--soft); }
.field.is-bad .field__box { border-color: #b3261e; }
.field__err { color: #b3261e; font-weight: 600; font-size: var(--s-ui); margin-top: 0.4rem; }
.form .btn { justify-self: start; }
.form__note { font-size: var(--s-ui); color: var(--soft); }

.fit__out { display: grid; gap: 1.5rem; align-content: start; min-width: 0; }
.plan { background: var(--paper); border-radius: var(--r); overflow: hidden; }
.plan__svg { width: 100%; height: auto; }
.plan__svg text { font-family: var(--text); font-size: 15px; font-weight: 600; fill: var(--ink); }
.verdict__head { font-family: var(--display); font-weight: 700; font-size: var(--s-lead); line-height: 1.15; letter-spacing: -0.02em; }
.verdict__body, .verdict__door { margin-top: 0.6rem; max-width: 52ch; }
.verdict__door { font-weight: 600; }
.verdict__note { margin-top: 0.6rem; font-size: var(--s-small); color: var(--soft); max-width: 60ch; }
.verdict[data-state="yes"] .verdict__head::before, .verdict[data-state="turn"] .verdict__head::before, .verdict[data-state="no"] .verdict__head::before { content: ""; display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%; margin-right: 0.45em; background: var(--ink); }
.verdict[data-state="no"] .verdict__head::before { background: var(--act); }

.week__head { display: grid; gap: 1.25rem; }
.week__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 0.75rem; margin-top: clamp(1.75rem, 4vw, 3.5rem); }
.tile { display: grid; gap: 0.2rem; width: 100%; text-align: left; }
.tile__pic { display: block; aspect-ratio: 1; background: var(--tone); border-radius: var(--r); overflow: hidden; margin-bottom: 0.7rem; position: relative; }
.tile__pic img { width: 100%; height: 100%; object-fit: contain; padding: 7%; transition: transform 0.5s var(--ease); }
.tile:hover .tile__pic img { transform: scale(1.06); }
.tile[aria-pressed="true"] .tile__pic::after { content: "On view above"; position: absolute; left: 0.75rem; top: 0.75rem; background: var(--ink); color: var(--paper); font-size: var(--s-small); font-weight: 600; line-height: 1; padding: 0.5rem 0.75rem; border-radius: 999px; }
.tile__name { font-weight: 700; line-height: 1.25; }
.tile__meta { color: var(--soft); font-size: var(--s-ui); }

.ask { padding: var(--gap) var(--m) 0; display: grid; gap: 2.5rem; }
.ask .lead { margin-top: 1.25rem; }
.ask__about { margin-top: 1.25rem; max-width: 40ch; }
.field__box { background: var(--paper); }
.sent { background: var(--tone); border-radius: var(--r); padding: clamp(1.25rem, 3vw, 2.25rem); display: grid; gap: 0.9rem; max-width: 36rem; justify-items: start; }
.sent__head { font-family: var(--display); font-weight: 700; font-size: var(--s-lead); line-height: 1.15; letter-spacing: -0.02em; }
.sent__note { background: var(--paper); border-radius: 0.9rem; padding: 0.9rem 1.1rem; white-space: pre-line; overflow-wrap: anywhere; justify-self: stretch; }

.visit { padding-bottom: var(--gap); }
.visit__list { display: grid; gap: 2rem; margin-top: clamp(1.75rem, 4vw, 3.5rem); }
.visit__big { font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 3rem); letter-spacing: -0.03em; line-height: 1.08; overflow-wrap: anywhere; }
.visit__big a { text-decoration-thickness: 0.07em; }
.visit__big a:hover { color: var(--act); }
.visit__note { color: var(--soft); margin-top: 0.4rem; }

/* ---------- foot ---------- */
.foot { background: var(--stage); transition: background-color 0.6s var(--ease); padding: clamp(2.5rem, 6vw, 5rem) var(--m) 2.5rem; overflow: hidden; }
.foot__name { font-family: var(--display); font-weight: 800; letter-spacing: -0.05em; line-height: 0.9; font-size: clamp(3.5rem, 17.5vw, 20rem); margin-left: -0.04em; white-space: nowrap; }
.foot__cols { display: grid; gap: 1.5rem; margin-top: clamp(2rem, 5vw, 4rem); line-height: 1.5; }
.foot__cols p { max-width: 62ch; }
.foot__cols p + p { margin-top: 0.75rem; }
.foot__cols a { font-weight: 600; }

/* ---------- wider screens ---------- */
@media (min-width: 620px) {
  .hero__act .link { display: inline-flex; }
  .week__list { gap: 2rem 1.25rem; }
  .visit__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem 2rem; }
  .foot__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem; }
  .about__text { font-size: var(--s-lead); line-height: 1.35; max-width: 28ch; }
  .viewer { height: min(78vw, 40rem); }
}

@media (max-width: 619px) {
  .mast__nav a:nth-child(n+3) { display: none; }
  .tools__label { flex-basis: 100%; }
  .price__more { display: none; }
  .btn { min-height: 3.25rem; padding: 0 1.35rem; }
}

@media (min-width: 1000px) {
  .hero { display: grid; grid-template-columns: minmax(25rem, 5fr) minmax(0, 7fr); grid-template-rows: auto auto 1fr; column-gap: clamp(1rem, 2vw, 2.5rem); padding-left: var(--m); min-height: max(40rem, calc(100svh - var(--chrome, 7.25rem))); }
  .hero__head { display: block; grid-area: 1 / 1; padding: clamp(1.25rem, 5vh, 3.5rem) 0 0; }
  .hero h1 { padding: 0; }
  .hero__tag { display: none; }
  .hero__line { display: block; font-size: var(--s-lead); line-height: 1.3; margin-top: 1.25rem; max-width: 27ch; }
  .hero__buy { grid-area: 2 / 1; padding: clamp(1.25rem, 4vh, 2.5rem) 0 0; display: grid; justify-content: start; gap: 1.25rem; }
  .price { flex-direction: row; align-items: baseline; gap: 0.85rem; }
  .price__n { font-size: 3rem; }
  .rail { grid-area: 3 / 1; align-self: end; padding: 2rem 0 1.75rem; }
  .stage { grid-area: 1 / 2 / 4 / 3; }
  .viewer { flex: 1; height: auto; min-height: 24rem; }
  .view { position: absolute; right: 1.25rem; top: 0.5rem; padding: 0; }
  .hint { left: 1rem; transform: none; top: 0.5rem; }
  .tools { padding: 0.75rem 1.25rem 1.5rem 0; gap: 0.85rem 1.75rem; }
  .tools__note { flex: 1 1 18rem; max-width: 46ch; }
  .about__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem clamp(1rem, 2vw, 2.5rem); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 2rem; }
  .fit { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1rem, 2vw, 2.5rem); }
  .week__head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; }
  .week__head .lead { justify-self: end; }
  .week__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ask { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1rem, 2vw, 2.5rem); }
  .ask__main .form { max-width: 36rem; }
}

/* ---------- motion: arrivals only when motion is welcome ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js:not(.showcase) [data-load] { animation: rise 0.7s var(--ease) both; animation-delay: var(--d, 0ms); }
  .js:not(.showcase) [data-reveal] { opacity: 0; transform: translateY(1.5rem); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0ms); }
  .js:not(.showcase) [data-reveal].is-in { opacity: 1; transform: none; }
  @keyframes rise { from { opacity: 0; transform: translateY(1rem); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
