/* Fourwalls s.r.o. — "the site is the room".
   System fonts only, no external requests. Scroll-driven effects and view
   transitions are progressive: without support the page is simply static. */

:root {
  color-scheme: light dark;
  --paper: #efeee9;
  --ink: #0d0d0d;
  --muted: #64635e;
  --line: rgb(13 13 13 / 0.14);
  --line-strong: rgb(13 13 13 / 0.55);
  --accent: #ff4d00;
  --on-accent: #0d0d0d;
  --focus: #0047ff;
  --frame: clamp(6px, 1.1vw, 14px);
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0, 1);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b0b0b;
    --ink: #ecebe6;
    --muted: #9a9993;
    --line: rgb(236 235 230 / 0.13);
    --line-strong: rgb(236 235 230 / 0.5);
    --accent: #ff5a1f;
    --focus: #6f9bff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-tap-highlight-color: transparent; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}
main { flex: 1; }
::selection { background: var(--accent); color: var(--on-accent); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
img, svg, canvas { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- The four walls: a fixed frame around the viewport ---------- */
.walls { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.walls i { position: absolute; background: var(--ink); }
.walls i:nth-child(1) { top: 0; left: 0; right: var(--frame); height: var(--frame); }      /* north */
.walls i:nth-child(2) { top: 0; right: 0; bottom: var(--frame); width: calc(var(--frame) + var(--safe-r)); }     /* east  */
.walls i:nth-child(3) { bottom: 0; right: 0; left: var(--frame); height: var(--frame); }   /* south */
.walls i:nth-child(4) { bottom: 0; left: 0; top: var(--frame); width: calc(var(--frame) + var(--safe-l)); }      /* west  */
body { padding: var(--frame) calc(var(--frame) + var(--safe-r)) var(--frame) calc(var(--frame) + var(--safe-l)); }

.skip {
  position: fixed; left: calc(var(--frame) + 1rem); top: -4rem; z-index: 60;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; font: 500 0.875rem var(--mono);
}
.skip:focus { top: calc(var(--frame) + 1rem); }

/* ---------- Header ---------- */
.bar {
  position: sticky; top: var(--frame); z-index: 40;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  padding: 0.15rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  font: 500 0.78rem/1 var(--mono); letter-spacing: 0.02em; text-transform: uppercase;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font: 700 1.05rem/1 var(--sans); letter-spacing: -0.03em; text-transform: none; view-transition-name: brand; min-height: 2.75rem; white-space: nowrap; }
.brand svg { width: 1.35rem; height: 1.35rem; flex: none; }
.brand .mark-wall { fill: var(--ink); transition: transform 0.6s var(--ease); transform-box: fill-box; transform-origin: center; }
.brand:hover .mark-wall:nth-child(1) { transform: translateX(2px); }
.brand:hover .mark-wall:nth-child(2) { transform: translateY(2px); }
.brand:hover .mark-wall:nth-child(3) { transform: translateX(-2px); }
.brand:hover .mark-wall:nth-child(4) { transform: translateY(-2px); }
.clock { color: var(--muted); justify-self: center; white-space: nowrap; }
.clock b { color: var(--ink); font-weight: 500; }
.clock .dot { display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--accent); margin-right: 0.5em; vertical-align: 0.05em; }
.nav { justify-self: end; }
.nav ul { list-style: none; display: flex; gap: clamp(0.9rem, 2vw, 2rem); margin: 0; padding: 0; }
.nav a { text-decoration: none; position: relative; display: inline-flex; align-items: center; min-height: 2.75rem; white-space: nowrap; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.7rem; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.4s var(--ease); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 52rem) {
  .bar { grid-template-columns: 1fr auto; }
  .clock { display: none; }
}
@media (max-width: 26rem) {
  .nav ul { gap: 0.85rem; }
  .bar { font-size: 0.7rem; letter-spacing: 0; }
}
@media (max-width: 23rem) { .nav .opt { display: none; } }

/* ---------- Shared type ---------- */
.label { font: 500 0.75rem/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.label .accent, .accent { color: var(--accent); }
.display {
  font-weight: 650; letter-spacing: -0.055em; line-height: 0.88; margin: 0;
  font-size: clamp(3.3rem, min(13vw, 19vh), 13.5rem); text-wrap: balance;
}
.h2 { overflow-wrap: anywhere; font-weight: 650; letter-spacing: -0.045em; line-height: 0.95; margin: 0; font-size: clamp(2.2rem, 6.5vw, 6rem); text-wrap: balance; }
.lede { font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem); line-height: 1.35; letter-spacing: -0.01em; max-width: 34ch; margin: 0; text-wrap: pretty; }
.section { padding: clamp(4rem, 12vw, 10rem) var(--gutter); border-top: 1px solid var(--line); position: relative; }
.section-head { display: grid; gap: 1.25rem; margin-bottom: clamp(2.5rem, 7vw, 6rem); }
@media (min-width: 60rem) { .section-head { grid-template-columns: 1fr 2fr; align-items: end; } }

/* ---------- Hero: the room ---------- */
.hero { position: relative; min-height: calc(100svh - 2 * var(--frame) - 3.2rem); display: grid; grid-template-rows: 1fr auto; isolation: isolate; }
.room { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero-copy { align-self: end; padding: clamp(5rem, 14vh, 9rem) var(--gutter) clamp(2rem, 5vw, 3.5rem); }
.hero .display { view-transition-name: title; }
.hero .display .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero .display .line > span { display: inline-block; }
.hero .display em { font-style: normal; color: var(--accent); }
.hero-meta {
  display: grid; gap: 1rem 2rem; grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 1.1rem var(--gutter); border-top: 1px solid var(--line);
}
@media (min-width: 60rem) { .hero-meta { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: start; } }
.hero-meta p { margin: 0; }
.hero-meta .lede { grid-column: 1 / -1; font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem); }
@media (min-width: 60rem) { .hero-meta .lede { grid-column: auto; } }

/* Headline entrance: lines rise once on load */
@media (prefers-reduced-motion: no-preference) {
  .hero .display .line > span { animation: rise 1.1s var(--ease) both; }
  .hero .display .line:nth-child(2) > span { animation-delay: 0.08s; }
  .hero .display .line:nth-child(3) > span { animation-delay: 0.16s; }
  .hero-meta { animation: fade 1.2s 0.35s var(--ease) both; }
}
@media (max-height: 34rem) and (orientation: landscape) {
  .hero { min-height: 0; }
  .hero-copy { padding-top: 3.5rem; }
  .hero .display { font-size: clamp(2.6rem, 9vw, 6rem); }
}
@keyframes rise { from { transform: translateY(105%); } }
@keyframes fade { from { opacity: 0; transform: translateY(0.6rem); } }

/* ---------- Ticker ---------- */
.ticker { border-block: 1px solid var(--line); overflow: hidden; background: var(--ink); color: var(--paper); }
.ticker-track { display: flex; width: max-content; font: 500 clamp(0.85rem, 0.8rem + 0.4vw, 1.1rem)/1 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }
.ticker-track span { padding: 1.05rem 1.6rem; white-space: nowrap; }
.ticker-track span::before { content: "■"; color: var(--accent); margin-right: 1.6rem; font-size: 0.7em; vertical-align: 0.12em; }
@media (prefers-reduced-motion: no-preference) {
  .ticker-track { animation: ticker 38s linear infinite; }
  .ticker:hover .ticker-track { animation-play-state: paused; }
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Walls (services) ---------- */
.walls-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); counter-reset: wall; }
.wall {
  position: relative; display: grid; gap: 0.75rem 2rem;
  grid-template-columns: 1fr; align-items: baseline;
  padding: clamp(1.5rem, 3.5vw, 2.75rem) 0; border-bottom: 1px solid var(--line-strong);
  isolation: isolate;
}
@media (min-width: 60rem) { .wall { grid-template-columns: 9rem 1.2fr 1fr 6rem; } }
.wall::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent);
  transform: scaleY(0); transform-origin: bottom; transition: transform 0.55s var(--ease);
}
.wall:hover::before, .wall:focus-within::before { transform: scaleY(1); }
.wall:hover, .wall:focus-within { color: var(--on-accent); }
.wall:hover .label, .wall:focus-within .label, .wall:hover p, .wall:focus-within p { color: var(--on-accent); }
.wall .label { padding-left: 0.1rem; }
.wall h3 { margin: 0; font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; font-size: clamp(2.1rem, 4.6vw, 4.2rem); }
.wall p { margin: 0; color: var(--muted); max-width: 42ch; transition: color 0.3s; }
.wall .dir { display: none; font: 500 clamp(2.5rem, 4vw, 3.5rem)/1 var(--mono); justify-self: end; color: var(--line-strong); transition: color 0.3s, transform 0.55s var(--ease); }
.wall:hover .dir { color: var(--on-accent); transform: rotate(-90deg); }
@media (min-width: 60rem) {
  .wall h3 { grid-column: 2; }
  .wall p { grid-column: 3; }
  .wall .dir { display: block; grid-column: 4; }
}
@media (hover: none) {
  .wall::before { transition-duration: 0.25s; }
  .wall:hover::before { transform: scaleY(0); }
  .wall:hover, .wall:hover .label, .wall:hover p { color: inherit; }
  .wall:hover p { color: var(--muted); }
  .wall:hover .dir { transform: none; color: var(--line-strong); }
}

/* ---------- Statement ---------- */
.statement { font-weight: 600; letter-spacing: -0.045em; line-height: 1.02; font-size: clamp(2rem, 5.6vw, 5.4rem); margin: 0; max-width: 18ch; text-wrap: balance; }
.statement .ghost { color: var(--line-strong); }

/* ---------- Approach ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 1.5rem 0 2rem; border-bottom: 1px solid var(--line); display: grid; gap: 0.9rem; align-content: start; }
@media (min-width: 52rem) { .step { padding: 2rem 2rem 0 0; border-bottom: 0; } .step + .step { padding-left: 2rem; border-left: 1px solid var(--line); } }
.step .num { font: 600 clamp(4rem, 9vw, 8rem)/0.8 var(--sans); letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 1px var(--ink); }
.step h3 { margin: 0; font-size: 1.5rem; letter-spacing: -0.03em; }
.step p { margin: 0; color: var(--muted); max-width: 34ch; }

/* ---------- CTA ---------- */
.cta { padding: clamp(5rem, 14vw, 12rem) var(--gutter) clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.cta-link {
  display: inline-block; text-decoration: none; font-weight: 650; letter-spacing: -0.055em; line-height: 0.9;
  font-size: clamp(3rem, 11vw, 12rem);
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 92% / 0% 0.09em;
  transition: background-size 0.7s var(--ease);
}
.cta-link:hover, .cta-link:focus-visible { background-size: 100% 0.09em; }
.cta-link .arrow { display: inline-block; transition: transform 0.6s var(--ease); color: var(--accent); }
.cta-link:hover .arrow { transform: translate(0.12em, -0.12em); }
.todo {
  display: inline-block; font: 700 0.72rem/1.3 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  background: #ffe14d; color: #2b2300; padding: 0.15em 0.45em; vertical-align: middle;
}

/* ---------- Prose pages ---------- */
.page-head { padding: clamp(4rem, 14vw, 10rem) var(--gutter) clamp(2rem, 5vw, 4rem); border-bottom: 1px solid var(--line); }
.page-head .display { font-size: clamp(3rem, 11vw, 10rem); view-transition-name: title; margin-top: 1rem; }
.prose { padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(4rem, 10vw, 8rem); display: grid; gap: 2rem; }
@media (min-width: 60rem) { .prose { grid-template-columns: 1fr 2fr; } .prose > * { grid-column: 2; } .prose > .label-col { grid-column: 1; grid-row: 1 / span 20; } }
.prose h2 { font-size: 1.5rem; letter-spacing: -0.03em; margin: 1rem 0 0; }
.prose p { margin: 0; max-width: 62ch; }
.prose .lede { max-width: 40ch; }
.facts { margin: 0; border-top: 1px solid var(--line-strong); }
.facts div { display: grid; gap: 0.25rem 2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 40rem) { .facts div { grid-template-columns: 14rem 1fr; } }
.facts dt { font: 500 0.75rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.facts dd { margin: 0; }
.big-mail { font-weight: 650; letter-spacing: -0.045em; font-size: clamp(2rem, 7vw, 5.5rem); line-height: 1; text-decoration: none; word-break: break-word; }
.big-mail:hover { color: var(--accent); }
address { font-style: normal; }
.button { display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none; padding: 0.95rem 1.4rem; font: 500 0.85rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }
.button:hover { background: var(--accent); color: var(--on-accent); }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line-strong); padding: 2rem var(--gutter) 1.5rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; font: 400 0.8rem/1.6 var(--mono); color: var(--muted); }
@media (min-width: 52rem) { .foot { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); } }
.foot p { margin: 0; }
.foot strong { color: var(--ink); font-weight: 600; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; }
.foot ul a { display: inline-flex; align-items: center; min-height: 2.25rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot .huge { grid-column: 1 / -1; font: 650 clamp(4rem, 21vw, 22rem)/0.78 var(--sans); letter-spacing: -0.07em; color: var(--ink); margin: 1rem 0 0 -0.04em; user-select: none; white-space: nowrap; overflow: hidden; padding-bottom: 0.04em; }

/* ---------- Scroll-driven reveals (progressive) ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
    .wall { animation: wall-in linear both; animation-timeline: view(); animation-range: entry 10% cover 35%; }
    .foot .huge { animation: huge-in linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .progress { position: fixed; left: var(--frame); top: var(--frame); height: 2px; width: calc(100% - 2 * var(--frame)); background: var(--accent); transform-origin: left; z-index: 55; animation: grow linear both; animation-timeline: scroll(root); }
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(3rem); } }
@keyframes wall-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes huge-in { from { letter-spacing: 0.04em; opacity: 0.2; } }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- Cross-document view transitions ---------- */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
::view-transition-old(root) { animation: 0.35s var(--ease) both vt-out; }
::view-transition-new(root) { animation: 0.5s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-1.5rem); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(2rem); } }
.ink { color: var(--ink); }
