/* The landing page: the hero and its objects, the eight tiles, the two offers and the contact section. */
:root { --bar: var(--accent2); }

/* Hero: the stage fills it; the words sit over its left */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 320px; overflow: hidden; }
.obj { display: none; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.copy { position: absolute; z-index: 1; left: var(--pad); top: 50%; transform: translateY(-58%); max-width: 46vw; display: grid; gap: 20px; justify-items: start; }
h1 { font: 700 clamp(2.3rem, 5.2vw, 5.5rem)/1.02 var(--display); font-stretch: 112%; letter-spacing: -0.015em; text-wrap: balance; }
h1 span { display: block; white-space: nowrap; } /* two set lines, one colour: the accent belongs to the object and the button */
.copy p { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.2rem); max-width: 24em; }

/* The rail: the eight objects; the one growing shows its progress */
.rail { position: absolute; z-index: 1; left: var(--pad); right: var(--pad); bottom: 22px; align-items: start; min-height: 2.6rem; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.rail button { width: 100%; text-align: left; display: grid; gap: 7px; padding: 0 0 4px; color: var(--muted); font: 600 0.74rem/1.2 var(--display); font-stretch: 108%; letter-spacing: 0.04em; }
.rail button::before { content: ""; height: 2px; border-radius: 1px; background: linear-gradient(to right, var(--bar) calc(var(--p, 0) * 100%), var(--rule) 0); }
.rail button[aria-current="true"] { color: var(--ink); }
@media (hover: hover) { .rail button:hover { color: var(--ink); } }
.rail .t { text-wrap: balance; }

/* All eight, each growing on its own */
.all { padding: clamp(40px, 7vw, 88px) var(--pad) clamp(32px, 5vw, 64px); display: grid; gap: 22px; border-top: 1px solid var(--rule); }
.grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid > canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tile { position: relative; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; display: block; width: 100%; text-align: left; }
.tile i { display: block; aspect-ratio: 1; }
.tile span { position: absolute; left: 14px; bottom: 12px; font: 600 0.78rem/1.2 var(--display); font-stretch: 108%; letter-spacing: 0.04em; color: var(--muted); }
@media (hover: hover) { .tile:hover span { color: var(--ink); } }

/* The two offers and the contact section */
.work { padding: clamp(40px, 7vw, 88px) var(--pad); display: grid; gap: clamp(28px, 4vw, 48px); border-top: 1px solid var(--rule); }
.offers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 5vw, 72px); }
.offers div { display: grid; gap: 12px; align-content: start; padding-top: 18px; border-top: 4px solid var(--accent); }
.offers div + div { border-top-color: var(--accent2); }
.offers p { color: var(--muted); max-width: 34em; font-size: 1.05rem; }
.contact { padding: clamp(40px, 7vw, 88px) var(--pad); display: grid; gap: clamp(22px, 3vw, 36px); border-top: 1px solid var(--rule); }
.contact h2 { font-size: clamp(1.7rem, 3.4vw, 2.8rem); }

/* Short and wide (a phone on its side): the words and the object stay side by side, smaller, without the rail. */
@media (max-height: 500px) and (min-aspect-ratio: 1/1) {
  h1 { font-size: clamp(1.4rem, 9vh, 2.3rem); }
  .copy { transform: translateY(-38%); gap: 10px; max-width: 40vw; }
  .copy p { font-size: 0.95rem; }
  .rail { display: none; }
}
/* Upright (phones, tablets held upright): a column. The object takes the room that is left between the header and the
   words, and is fitted to it by the script; the rail is one caption, the field now showing. */
@media (max-aspect-ratio: 1/1) {
  .hero { display: flex; flex-direction: column; height: auto; min-height: 100vh; min-height: 100svh; padding: 70px var(--pad) 14px; gap: 14px; }
  .obj { display: block; flex: 1 1 0; min-height: 160px; }
  .copy { position: relative; top: auto; left: auto; transform: none; max-width: none; gap: 12px; }
  h1 { font-size: clamp(1.4rem, 9.4vw, 3.2rem); }
  .rail { position: relative; left: auto; right: auto; bottom: auto; display: block; min-height: 0; }
  .rail li:not(.on) { display: none; }
  .rail button { min-height: 44px; align-content: center; font-size: 0.8rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .offers { grid-template-columns: minmax(0, 1fr); }
}
/* Upright and very short: the words go first and the object below them. */
@media (max-aspect-ratio: 1/1) and (max-height: 540px) { .copy { order: -1; } }
