@import url('/assets/fonts/fonts.css');

/* Tema urmează faza zilei în Cheia (data-phase, calculat din poziția soarelui). Culorile vin din casă:
   tencuiala albă, solzii antracit ai acoperișului, pinul tâmplăriei. */
:root {
  --bg: #ece7dd; --bg2: #e3ddd1; --ink: #1d1e20; --muted: #6f695f; --line: #cfc7b9; --accent: #a4622c; --sunc: #d9722b;
  --sans: 'Schibsted Grotesk', ui-sans-serif, sans-serif; --mono: 'Martian Mono', ui-monospace, monospace;
  --gut: clamp(16px, 4vw, 56px); --max: 1360px;
  color-scheme: light;
}
:root[data-phase="dusk"] { --bg: #ecdccb; --bg2: #e4d0bc; --ink: #241d1b; --muted: #7a685d; --line: #d3bda8; --accent: #b0532a; --sunc: #e0602a; }
:root[data-phase="night"] {
  --bg: #121417; --bg2: #181b1f; --ink: #e7e2d8; --muted: #8f8a80; --line: #2b2f34; --accent: #e0a56a; --sunc: #ffb867;
  color-scheme: dark;
}

*, *::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: 400 17px/1.55 var(--sans);
  transition: background-color .8s ease, color .8s ease; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--bg); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 9; background: var(--ink); color: var(--bg); padding: 8px 12px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ------------------------------------------------------------------ marca */
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: .02em; font-size: 17px; }
.mark svg { width: 15px; height: 15px; fill: var(--ink); transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.mark:hover svg { transform: rotate(90deg); }
.mark em { font-style: normal; font-weight: 400; font-family: var(--mono); font-size: .78em; letter-spacing: 0; margin-left: 2px; color: var(--accent); }

.top {
  position: fixed; inset: 0 0 auto 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: max(14px, env(safe-area-inset-top)) var(--gut) 14px;
  background: linear-gradient(var(--bg), color-mix(in srgb, var(--bg) 0%, transparent));
}
.where { margin: 0; font: 400 11.5px/1 var(--mono); color: var(--muted); letter-spacing: .02em; }
.where time { color: var(--ink); }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; padding: 0 var(--gut) clamp(20px, 4vh, 44px); }
.stage { position: absolute; inset: 0; }
#macheta { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.4s ease .1s; }
.ready #macheta { opacity: 1; }
.fallback { display: none; position: absolute; inset: 12% var(--gut) 34%; width: calc(100% - 2 * var(--gut)); height: 54%; object-fit: cover; }
.no-webgl .fallback { display: block; }
.no-webgl #macheta { display: none; }

.intro { position: relative; grid-row: 2; max-width: 760px; pointer-events: none; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 400 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.eyebrow .dot { width: 7px; height: 7px; background: var(--sunc); transform: rotate(45deg); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
h1 { margin: 0; font-weight: 700; font-size: clamp(36px, 6.4vw, 92px); line-height: .98; letter-spacing: -.035em; text-wrap: balance; }
.lead { margin: 22px 0 0; max-width: 34em; font-size: clamp(16px, 1.35vw, 19px); color: var(--muted); text-wrap: pretty; }
.sunline {
  position: absolute; right: var(--gut); bottom: clamp(20px, 4vh, 44px); max-width: 300px; text-align: right;
  font: 400 11px/1.6 var(--mono); color: var(--muted);
}
.sunline p { margin: 0; }
.sunline .k { margin-bottom: 6px; }
.sunline [data-sun] { color: var(--ink); }
.sunline b { font-weight: 500; color: var(--accent); }

.intro > * { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.intro .eyebrow { animation-delay: .15s; } .intro h1 { animation-delay: .25s; } .intro .lead { animation-delay: .4s; }
.sunline { animation: rise .9s cubic-bezier(.2,.7,.2,1) .7s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ------------------------------------------------------------------ secțiuni */
.sec { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 12vw, 150px) var(--gut) 0; }
.sec-h { display: grid; grid-template-columns: 64px 1fr; column-gap: 20px; align-items: baseline; margin-bottom: clamp(28px, 4vw, 48px); border-top: 1px solid var(--line); padding-top: 18px; }
.num { margin: 0; font: 400 12px/1 var(--mono); color: var(--accent); }
h2 { margin: 0; font-weight: 700; font-size: clamp(26px, 3.2vw, 42px); letter-spacing: -.025em; line-height: 1.05; }
.sub { grid-column: 2; margin: 12px 0 0; max-width: 46em; color: var(--muted); font-size: 15.5px; text-wrap: pretty; }

.rv { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }

/* galerie */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(10px, 1.4vw, 20px); }
.grid figure { margin: 0; }
.grid a { display: block; overflow: hidden; background: var(--bg2); cursor: zoom-in; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.grid a:hover img { transform: scale(1.025); }
.grid figcaption { margin-top: 10px; font: 400 11px/1.5 var(--mono); color: var(--muted); }
.g-iarna { grid-column: 1 / 8; grid-row: span 2; } .g-iarna a { aspect-ratio: 4 / 3.15; }
.g-vara { grid-column: 8 / 13; } .g-vara a { aspect-ratio: 4 / 3; }
.g-pergola { grid-column: 8 / 13; align-self: end; } .g-pergola a { aspect-ratio: 16 / 9; }
.g-mansarda { grid-column: 1 / 6; } .g-mansarda a { aspect-ratio: 4 / 3; }
.g-living { grid-column: 6 / 13; } .g-living a { aspect-ratio: 16 / 8.6; }
.g-intrare, .g-foc, .g-birou { grid-column: span 4; } .g-intrare a, .g-foc a, .g-birou a { aspect-ratio: 4 / 3; }
.g-toamna { grid-column: 1 / 13; } .g-toamna a { aspect-ratio: 21 / 8; }
.g-toamna img { object-position: 50% 62%; }

/* casa în cifre */
.spec { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-left: 1px solid var(--line); }
.spec > div { padding: 22px 22px 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spec > div:nth-child(-n+3) { border-top: 1px solid var(--line); }
.spec dt { font: 400 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.spec dd { margin: 18px 0 0; display: grid; gap: 4px; }
.spec dd b { font-weight: 700; font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -.03em; line-height: 1; }
.spec dd span { color: var(--muted); font-size: 14.5px; }

/* orizontul */
.hz { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.hz svg { display: block; width: 100%; min-width: 860px; height: auto; }
.hz .land { fill: var(--bg2); }
.hz .ridge { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.hz .base { stroke: var(--line); }
.hz .tick { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.hz .pk { font: 500 12px var(--sans); fill: var(--ink); }
.hz .pe { font: 400 10px var(--mono); fill: var(--muted); }
.hz .card { font: 400 10.5px var(--mono); fill: var(--muted); letter-spacing: .1em; }
.hz #hz-sun { fill: var(--sunc); transition: cx 1s, cy 1s, opacity .6s; }
.hz .halo { fill: var(--sunc); opacity: .18; }

/* stadiu */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); counter-reset: s; }
.steps li { position: relative; padding: 26px 14px 0 0; border-top: 2px solid var(--line); counter-increment: s; }
.steps li::before { content: '0' counter(s); position: absolute; top: -26px; font: 400 10.5px var(--mono); color: var(--muted); }
.steps li::after { content: ''; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; transform: rotate(45deg); background: var(--bg); border: 1.5px solid var(--line); }
.steps li.done { border-top-color: var(--ink); } .steps li.done::after { background: var(--ink); border-color: var(--ink); }
.steps li.now { border-top-color: var(--accent); } .steps li.now::after { background: var(--sunc); border-color: var(--sunc); animation: pulse 2.4s ease-in-out infinite; }
.steps b { display: block; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.steps span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.steps li.now span { color: var(--accent); }

/* subsol */
.foot {
  max-width: var(--max); margin: clamp(90px, 14vw, 180px) auto 0; padding: 22px var(--gut) max(28px, env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; border-top: 1px solid var(--line);
  font: 400 11.5px/1.4 var(--mono); color: var(--muted);
}
.foot p { margin: 0; }
.mark.sm { font-family: var(--sans); font-size: 14px; color: var(--ink); } .mark.sm svg { width: 12px; height: 12px; }
.private { margin-left: auto; text-decoration: none; color: var(--ink); border: 1px solid var(--line); padding: 9px 14px; transition: border-color .3s, background .3s; }
.private:hover { border-color: var(--ink); background: var(--bg2); }

/* imaginea mare */
dialog#lb { padding: 0; border: 0; background: transparent; max-width: min(1600px, 94vw); max-height: 94vh; cursor: zoom-out; }
dialog#lb::backdrop { background: color-mix(in srgb, #0d0e10 88%, transparent); backdrop-filter: blur(4px); }
dialog#lb figure { margin: 0; }
dialog#lb img { max-width: 100%; max-height: 86vh; object-fit: contain; }
dialog#lb figcaption { margin-top: 10px; font: 400 11.5px var(--mono); color: #cfcac1; }

/* ------------------------------------------------------------------ ecrane înguste */
@media (max-width: 860px) {
  .hero { grid-template-rows: 58svh auto auto; padding-top: 0; min-height: auto; }
  .stage { position: relative; inset: auto; grid-row: 1; margin: 0 calc(-1 * var(--gut)); height: 58svh; }
  .intro { grid-row: 2; margin-top: 4px; }
  .sunline { position: static; grid-row: 3; text-align: left; max-width: none; margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); }
  .fallback { inset: 72px 0 0; width: 100%; height: calc(100% - 72px); }
  .sec-h { grid-template-columns: 1fr; } .num { margin-bottom: 10px; } .sub { grid-column: 1; }
  .grid { grid-template-columns: 1fr 1fr; }
  .grid > figure { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .g-intrare, .g-foc { grid-column: span 1 !important; }
  .g-iarna a, .g-vara a, .g-mansarda a, .g-birou a { aspect-ratio: 4 / 3; }
  .g-toamna a { aspect-ratio: 16 / 10; }
  .spec { grid-template-columns: 1fr 1fr; }
  .spec > div:nth-child(3) { border-top: 0; }
  .spec > div { padding: 16px 14px 20px; }
  .steps { grid-template-columns: 1fr; gap: 0; border-left: 2px solid var(--line); margin-left: 6px; }
  .steps li { border-top: 0; padding: 0 0 22px 24px; }
  .steps li::before { position: static; display: block; margin-bottom: 4px; }
  .steps li::after { top: 2px; left: -8px; }
  .steps li.done { border-left: 2px solid var(--ink); margin-left: -2px; } .steps li.now { border-left: 2px solid var(--accent); margin-left: -2px; }
  .private { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; transform: none; }
}

/* pagini mici: 404 și accesul privat la /casa */
body.mini { min-height: 100svh; display: grid; place-items: center; }
.mini-m { width: min(520px, 100% - 2 * var(--gut)); padding: 48px 0; }
.mini-m h1 { font-size: clamp(32px, 6vw, 48px); margin-top: 48px; }
.mini-m .lead { margin-top: 16px; }
.mini-m .private { display: inline-block; margin-top: 28px; }
.mini-m .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 10px; font: 600 15px var(--sans); color: var(--bg); background: var(--ink); border: 0; padding: 12px 18px; cursor: pointer; text-decoration: none; }
.btn.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); font-weight: 500; }
.btn svg { width: 17px; height: 17px; }
.note { margin-top: 26px; font: 400 11.5px/1.6 var(--mono); color: var(--muted); }
[hidden] { display: none !important; }
