/* Inferia website. One look per room style: picking a look in the room at the top restyles the whole page. */

:root {
  --bg: #0f0d0b; --bg2: #17130f; --ink: #f4eee5; --ink2: #c3b9ab; --accent: #d8ba8e; --on-accent: #1b150e;
  --line: rgba(255, 236, 208, .16);
  --display: 'Jost', 'Century Gothic', 'Futura', sans-serif; --display-weight: 300; --display-style: normal; --display-track: -.015em; --display-lh: 1.06;
  --body: 'Jost', 'Century Gothic', 'Segoe UI', system-ui, sans-serif;
  --btn-radius: 999px;
  /* wall pattern: the timber slats of the room itself */
  --pattern: repeating-linear-gradient(90deg, rgba(255, 236, 208, .035) 0 14px, transparent 14px 23px);
  --night: #0f0d0b; --cream: #f6efe4; --gold: #d8ba8e;
}
html[data-look="heritage"] {
  --bg: #230a0d; --bg2: #2f0f14; --ink: #f7ead6; --ink2: #dcc0a4; --accent: #d9aa5c; --on-accent: #230a0d;
  --line: rgba(217, 170, 92, .28);
  --display: 'Rozha One', 'Bodoni MT', Georgia, serif; --display-weight: 400; --display-track: 0; --display-lh: 1.04;
  /* harlequin wallpaper, the one on the room's back wall */
  --pattern: linear-gradient(45deg, rgba(217, 170, 92, .055) 25%, transparent 25% 75%, rgba(217, 170, 92, .055) 75%) 0 0 / 44px 72px,
             linear-gradient(-45deg, rgba(122, 28, 38, .32) 25%, transparent 25% 75%, rgba(122, 28, 38, .32) 75%) 0 0 / 44px 72px;
}
html[data-look="japandi"] {
  --bg: #ece5d8; --bg2: #e2d9c8; --ink: #29241d; --ink2: #5b5345; --accent: #56664a; --on-accent: #f3eee3;
  --line: rgba(41, 36, 29, .2);
  --display: 'Shippori Mincho', 'Hiragino Mincho ProN', Georgia, serif; --display-weight: 400; --display-track: .005em; --display-lh: 1.16;
  /* woven grasscloth */
  --pattern: repeating-linear-gradient(0deg, rgba(41, 36, 29, .035) 0 1px, transparent 1px 5px), repeating-linear-gradient(90deg, rgba(41, 36, 29, .03) 0 1px, transparent 1px 7px);
}
html[data-look="midnight"] {
  --bg: #080c16; --bg2: #0e1524; --ink: #ebe7dc; --ink2: #a8adba; --accent: #d4a550; --on-accent: #080c16;
  --line: rgba(212, 165, 80, .3);
  --display: 'Bodoni Moda', 'Didot', 'Bodoni MT', serif; --display-weight: 400; --display-style: italic; --display-track: -.01em; --display-lh: 1.08;
  /* brass pinstripe */
  --pattern: repeating-linear-gradient(90deg, rgba(212, 165, 80, .16) 0 1px, transparent 1px 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 300 1.125rem/1.6 var(--body); overflow-x: hidden; }
img, video, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ol, figure { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; }
h1, h2 { font-family: var(--display); font-weight: var(--display-weight); font-style: var(--display-style); letter-spacing: var(--display-track); line-height: var(--display-lh); text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.4vw, 5rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3.75rem); }
h3 { font: 400 1.5rem/1.2 var(--body); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 50; background: var(--cream); color: var(--night); padding: 10px 14px; }
.skip:focus { top: 12px; }
.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }

/* ---- top bar: always dark glass, so the cream logo reads on every look ---- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 3vw, 40px);
  background: linear-gradient(rgba(12, 10, 8, .72), rgba(12, 10, 8, 0)); color: var(--cream); }
.brand img { height: 46px; width: auto; }
.top nav { display: flex; gap: clamp(14px, 2.4vw, 34px); font-size: 1rem; font-weight: 400; }
.top nav a { text-decoration: none; padding: 6px 2px; border-bottom: 1px solid transparent; text-shadow: 0 1px 10px rgba(0, 0, 0, .7); }
.top nav a:hover { border-bottom-color: currentColor; }
.top nav a.knock { border: 1px solid rgba(246, 239, 228, .55); padding: 6px 16px; border-radius: var(--btn-radius); }
.top nav a.knock:hover { background: var(--cream); color: var(--night); text-shadow: none; }

/* ---- the room ---- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; background: #050403; color: var(--cream); overflow: hidden; }
.stage { position: absolute; inset: 0; }
.stage canvas { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; cursor: crosshair; touch-action: pan-y; }
.shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(10, 8, 6, .78) 0, rgba(10, 8, 6, 0) 30%), radial-gradient(ellipse 78% 92% at 0 100%, rgba(10, 8, 6, .86), rgba(10, 8, 6, .5) 45%, rgba(10, 8, 6, 0) 72%); }
/* the one big moment: the page opens like the door in the logo */
html.js .stage { clip-path: polygon(47.4% 21%, 52.6% 13%, 52.6% 87%, 47.4% 87%); }
html.js.open .stage { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); transition: clip-path 1.7s cubic-bezier(.7, 0, .15, 1); }
html.js .hud, html.js .fine { opacity: 0; transform: translateY(14px); }
html.js.open .hud, html.js.open .fine { opacity: 1; transform: none; transition: opacity .9s 1.25s, transform .9s 1.25s cubic-bezier(.2, .7, .2, 1); }

.hud { position: absolute; inset: auto 0 0 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 0 clamp(16px, 3vw, 40px) 58px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.say { max-width: 44rem; }
.say p { margin-top: 18px; max-width: 34rem; color: #e6dccd; text-shadow: 0 1px 14px rgba(0, 0, 0, .8); }
.say h1 { text-shadow: 0 2px 30px rgba(0, 0, 0, .55); }
.acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.fine { position: absolute; left: clamp(16px, 3vw, 40px); bottom: 18px; font-size: .82rem; color: rgba(246, 239, 228, .72); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 26px; font: 400 1.05rem/1 var(--body); text-decoration: none; cursor: pointer;
  border: 1px solid var(--cream); border-radius: var(--btn-radius); color: var(--cream); background: transparent; transition: background .2s, color .2s; }
.btn.solid { background: var(--gold); border-color: var(--gold); color: #1b150e; }
.btn.solid:hover { background: var(--cream); border-color: var(--cream); }
.btn.ghost:hover { background: var(--cream); color: var(--night); }
.btn[disabled] { opacity: .5; cursor: default; }
html[data-look="heritage"] .btn.solid { background: #d9aa5c; border-color: #d9aa5c; }
html[data-look="japandi"] .btn.solid { background: #f3eee3; border-color: #f3eee3; }
html[data-look="midnight"] .btn.solid { background: #d4a550; border-color: #d4a550; }

.side { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.looks { display: flex; flex-direction: column; gap: 8px; }
.look { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 18px 8px 8px; font: 400 1rem/1 var(--body); color: var(--cream); cursor: pointer;
  background: rgba(14, 11, 9, .58); border: 1px solid rgba(246, 239, 228, .28); border-radius: var(--btn-radius); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: border-color .2s, background .2s; }
.look:hover { border-color: var(--cream); }
.look[aria-pressed="true"] { background: var(--cream); color: var(--night); border-color: var(--cream); }
.look:disabled { opacity: .4; cursor: default; }
.sw { display: flex; width: 54px; height: 30px; overflow: hidden; border-radius: var(--btn-radius); }
.sw i { flex: 1; }
.budget { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: rgba(14, 11, 9, .62); border: 1px solid rgba(246, 239, 228, .22); border-radius: var(--btn-radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 1rem; font-variant-numeric: tabular-nums; }
.budget .spent { font-weight: 500; font-size: 1.25rem; min-width: 6.2em; text-align: right; }
.meter { width: 120px; height: 4px; background: rgba(246, 239, 228, .22); }
.meter i { display: block; height: 100%; width: 0; background: var(--gold); }
.budget .of { color: #d6ccbd; }
[hidden] { display: none !important; }

/* label that follows a piece */
.tag { position: absolute; z-index: 5; left: 0; top: 0; pointer-events: none; transform: translate(-50%, -100%); padding: 9px 14px 10px; max-width: 260px;
  background: rgba(14, 11, 9, .82); border: 1px solid rgba(216, 186, 142, .6); color: var(--cream); font-size: .95rem; line-height: 1.3; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tag::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 18px; background: rgba(216, 186, 142, .8); }
.tag b { display: block; font-weight: 500; }
.tag span { display: block; color: #cfc4b3; font-size: .85rem; }
.tag em { font-style: normal; color: var(--gold); }

/* ---- sections below the room ---- */
.band { padding: clamp(84px, 11vw, 160px) 0; background: var(--bg); }
.band.wall { background: var(--pattern), var(--bg2); }
.band h2.narrow { max-width: 17ch; }
.band p { max-width: 36rem; color: var(--ink2); }

.film-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: end; }
.film-say p { margin-top: 22px; }
.screen { position: relative; border: 1px solid var(--line); padding: clamp(8px, 1.2vw, 16px); background: var(--bg); }
.screen video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
/* light spilling on the floor under the screen, like the doorway in the logo */
.screen::after { content: ''; position: absolute; left: 6%; right: 6%; top: 100%; height: 60px; background: radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%); pointer-events: none; }

.steps-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); margin-top: clamp(40px, 6vw, 80px); align-items: start; }
.steps { counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 26px 0 28px 64px; border-top: 1px solid var(--line); cursor: default; transition: opacity .3s; }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 18px; font-family: var(--display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: 2.6rem; line-height: 1; color: var(--accent); }
.steps li p { margin-top: 6px; }
.steps.picking li:not(.on) { opacity: .5; }
.state { display: inline-block; margin-top: 12px; padding: 3px 12px 4px; font-size: .82rem; font-weight: 400; border-radius: 999px; border: 1px solid var(--line); color: var(--ink2); }
.state.live { border-color: var(--accent); color: var(--accent); }
.step-pic { position: sticky; top: 96px; }
.step-pic img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); background: var(--bg2); }
.step-pic figcaption { margin-top: 12px; font-size: .95rem; color: var(--ink2); }
.honest { margin-top: clamp(40px, 5vw, 64px); padding-left: 20px; border-left: 2px solid var(--accent); }
.band p.honest { color: var(--ink); max-width: 44rem; }

.homes { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); margin-top: clamp(40px, 6vw, 80px); }
.home.wide { grid-column: 1 / -1; }
.home img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.home figcaption { margin-top: 12px; color: var(--ink2); max-width: 40rem; }
.home figcaption b { font-weight: 500; color: var(--ink); }
.compare { position: relative; overflow: hidden; aspect-ratio: 16 / 9; user-select: none; }
.compare > img, .compare .before img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--cut)) 0 0); }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; }
.compare .grip { position: absolute; top: 0; bottom: 0; left: var(--cut); width: 2px; margin-left: -1px; background: var(--cream); box-shadow: 0 0 18px rgba(0, 0, 0, .6); z-index: 2; pointer-events: none; }
.compare .grip::after { content: ''; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px; border-radius: 50%; background: var(--cream);
  -webkit-mask: linear-gradient(#000 0 0) center / 14px 2px no-repeat, radial-gradient(circle, transparent 15px, #000 16px); mask: linear-gradient(#000 0 0) center / 14px 2px no-repeat, radial-gradient(circle, transparent 15px, #000 16px); }
.compare input:focus-visible ~ .grip { outline: 2px solid var(--gold); outline-offset: 4px; }
.lab-a, .lab-b { position: absolute; bottom: 14px; z-index: 2; padding: 5px 12px 6px; font-size: .9rem; font-weight: 400; background: rgba(14, 11, 9, .7); color: var(--cream); pointer-events: none; }
.lab-a { left: 14px; } .lab-b { right: 14px; }

/* ---- front door: always night, with light behind the door ---- */
.door-band { background: #0b0907; color: var(--cream); padding: clamp(84px, 11vw, 160px) 0 0; }
.door-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 6vw, 96px); align-items: center; }
.door-band p { margin-top: 20px; max-width: 34rem; color: #d6ccbd; }
.doorway { position: relative; height: clamp(260px, 34vw, 430px); }
.doorway .leaf { position: absolute; left: 34%; top: 0; bottom: 18%; width: 15%; background: linear-gradient(180deg, #f3e2c6, #d8ba8e 55%, #9c7a50); clip-path: polygon(0 16%, 100% 0, 100% 100%, 0 100%); transform-origin: left center; transition: width .9s cubic-bezier(.3, .7, .2, 1); }
.doorway .spill { position: absolute; left: 0; right: 0; bottom: 0; height: 24%; background: radial-gradient(ellipse at 42% 0, rgba(243, 226, 198, .55), rgba(216, 186, 142, .12) 45%, transparent 70%); }
.doorway.near .leaf { width: 42%; }
.foot { margin-top: clamp(72px, 9vw, 130px); padding: 34px 0 44px; border-top: 1px solid rgba(255, 236, 208, .16); display: grid; grid-template-columns: auto 1fr; gap: 10px 40px; align-items: center; }
.door-band .foot p { margin: 0; justify-self: end; color: var(--cream); }
.by { display: flex; align-items: center; gap: 16px; font-size: .95rem; color: #d6ccbd; }
.by img { height: 30px; width: auto; }
.door-band .foot p.small { grid-column: 1 / -1; justify-self: start; max-width: 46rem; font-size: .85rem; color: #b5ab9c; }

/* ---- floor plan of the page ---- */
.plan { position: fixed; right: 16px; top: 50%; z-index: 15; transform: translateY(-50%); width: 100px; padding: 8px; background: rgba(12, 10, 8, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #f6efe4; font-size: .78rem; line-height: 1.25; text-align: center; }
.plan svg { display: block; width: 100%; height: auto; overflow: visible; margin-bottom: 7px; }
.plan .rm { fill: transparent; stroke: rgba(246, 239, 228, .6); stroke-width: 1.2; transition: fill .3s; }
.plan a:hover .rm, .plan a:focus-visible .rm { fill: rgba(246, 239, 228, .16); }
.plan .rm.here { fill: rgba(216, 186, 142, .3); stroke: #d8ba8e; }
.plan .swing { fill: none; stroke: rgba(246, 239, 228, .6); stroke-width: 1; stroke-dasharray: 2 2; }
.plan .you { fill: #f3e2c6; transition: cx .5s, cy .5s; filter: drop-shadow(0 0 4px #f3e2c6); }
.plan a { outline: none; }

/* ---- the light sweep: old page stays, new page wipes across it, room and website together ---- */
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: sweep 1.25s cubic-bezier(.6, 0, .25, 1) both; -webkit-mask: linear-gradient(105deg, #000 0 42%, transparent 58%) 100% 0 / 360% 100% no-repeat; mask: linear-gradient(105deg, #000 0 42%, transparent 58%) 100% 0 / 360% 100% no-repeat; }
@keyframes sweep { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { -webkit-mask-position: 0 0; mask-position: 0 0; } }

@media (max-width: 1390px) { .plan { display: none; } }
@media (max-width: 860px) {
  body { font-size: 1.05rem; }
  .top nav a:not(.knock) { display: none; }
  .brand img { height: 38px; }
  /* on a phone the room sits on top and the words below it, so a thumb can reach the room */
  .hero { height: auto; min-height: 100svh; display: flex; flex-direction: column; overflow: visible; }
  .stage { position: relative; height: 56svh; min-height: 300px; flex: none; }
  .shade { background: linear-gradient(to top, #050403 0, rgba(5, 4, 3, 0) 22%); }
  .hud { position: static; flex-direction: column; align-items: stretch; gap: 18px; padding: 4px 16px 18px; }
  .fine { position: static; padding: 0 16px 22px; }
  .say p { margin-top: 12px; }
  .acts { margin-top: 18px; }
  .side { align-items: stretch; }
  .looks { flex-direction: row; flex-wrap: wrap; }
  .look { flex: 1 1 auto; padding-right: 12px; font-size: .92rem; }
  .sw { width: 36px; height: 24px; }
  .budget { justify-content: space-between; }
  .film-grid, .steps-grid, .door-grid { grid-template-columns: 1fr; }
  .step-pic { position: static; order: -1; }
  .homes { grid-template-columns: 1fr; }
  .doorway { height: 200px; }
  .foot { grid-template-columns: 1fr; }
  .door-band .foot p { justify-self: start; }
  .fine { font-size: .74rem; right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .stage, html.js.open .stage { clip-path: none; transition: none; }
  html.js .hud, html.js .fine, html.js.open .hud, html.js.open .fine { opacity: 1; transform: none; transition: none; }
  ::view-transition-new(root) { animation: none; -webkit-mask: none; mask: none; }
  .doorway .leaf, .plan .you { transition: none; }
}
