/* ==========================================================================
   hero.css: page A-00, the measured headline + the mark as a construction drawing
   ========================================================================== */

.hero { position: relative; padding-top: var(--hdr); overflow-x: clip; }
.hero > .hero__in {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr auto; column-gap: var(--gap);
  min-height: calc(100vh - var(--hdr)); min-height: calc(100svh - var(--hdr)); padding-inline: var(--pad); padding-bottom: 0;
}

.hero__eyebrow { grid-column: 1 / span 7; grid-row: 1; align-self: end; display: grid; justify-items: start; gap: 10px; padding-top: 24px; color: var(--ink); letter-spacing: .08em; }
.hero__code { padding: 5px 8px 4px; background: var(--ink); color: var(--bg); letter-spacing: .08em; }
/* "building materials · Tbilisi": two deliberate lines on phones, one line with the interpunct from 600 px */
.eb { display: grid; gap: 3px; }
.eb__a, .eb__b { white-space: nowrap; }
.eb__b { color: var(--ink-2); }
.hero__reg { display: none; position: absolute; right: var(--pad); top: clamp(22px, 4.2vh, 48px); width: 26px; height: 26px; fill: none; stroke: var(--ink-3); stroke-width: 1; }   /* registration mark */

.hero__main { grid-column: 1 / -1; grid-row: 2; align-self: center; padding-block: 8px 28px; min-width: 0; }
.hbox { position: relative; width: fit-content; max-width: 100%; margin-top: 44px; }
#hero-title { display: flow-root; --fs-hero-m: clamp(3.3rem, 19.4vw, 9rem); font-size: var(--fs-hero-m); }
.ln { display: block; overflow: hidden; padding: .12em .05em .12em 0; margin: -.12em -.05em -.12em 0; }
.ln__in { display: block; white-space: nowrap; }
@supports (text-box: trim-both cap alphabetic) {
  .ln__in { text-box: trim-both cap alphabetic; }
  .ln + .ln { margin-top: .05em; }
  html[lang="en"] .ln + .ln { margin-top: .04em; }
}

.hero__lead { margin-top: clamp(32px, 5.6vh, 60px); max-width: 44ch; }
.hero__cta { display: grid; gap: 12px; margin-top: clamp(22px, 3.6vh, 40px); }

/* ---- dimension lines: the labels are the headline's real rendered size ---- */
.dim { position: absolute; color: var(--ink-3); pointer-events: none; visibility: hidden; }
html.js-dims .dim { visibility: visible; }   /* shown once the script has really measured the headline */
.dim::before, .dim::after { content: ""; position: absolute; background: currentColor; }
.dim__ln { position: absolute; background: var(--ink-2); }
.dim__tk { position: absolute; width: 13px; height: 1px; background: var(--ink); transform: rotate(-45deg); }
.dim__v {
  position: absolute; padding: 3px 7px; background: var(--bg); color: var(--ink); white-space: nowrap;
  font: 500 var(--fs-ann)/1 var(--font-mono); letter-spacing: .08em; font-variant-numeric: tabular-nums;
}
.dim__v::after { content: " px"; color: var(--ink-2); }

.dim--x { left: 0; right: 0; bottom: calc(100% + 9px); height: 25px; }
.dim--x::before, .dim--x::after { top: 0; bottom: 0; width: 1px; }
.dim--x::before { left: 0; }
.dim--x::after { right: 0; }
.dim--x .dim__ln { left: -7px; right: -7px; top: 7px; height: 1px; }
.dim--x .dim__tk { top: 7px; }
.dim--x .dim__tk:nth-of-type(2) { left: -6.5px; }
.dim--x .dim__tk:nth-of-type(3) { right: -6.5px; }
.dim--x .dim__v { left: 50%; top: 7.5px; transform: translate(-50%, -50%); }

.dim--y { top: 0; bottom: 0; left: calc(100% + 9px); width: 25px; }
.dim--y::before, .dim--y::after { left: 0; right: 0; height: 1px; }
.dim--y::before { top: 0; }
.dim--y::after { bottom: 0; }
.dim--y .dim__ln { top: -7px; bottom: -7px; left: 17px; width: 1px; }
.dim--y .dim__tk { left: 11px; }
.dim--y .dim__tk:nth-of-type(2) { top: -.5px; }
.dim--y .dim__tk:nth-of-type(3) { bottom: -.5px; }
.dim--y .dim__v { left: 17.5px; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); }

/* ---- the mark drawing ---- */
.hero__fig { grid-column: 8 / -1; grid-row: 1; align-self: end; justify-self: end; width: min(100%, 150px); padding-top: 20px; }
.hero__fig { background: radial-gradient(closest-side, var(--glow), transparent 78%); }
.mk { width: 100%; height: auto; overflow: visible; color: var(--ink); --u: .56; }   /* --u: viewBox units per CSS px (js/hero.js) */
.mk-thin path { fill: none; stroke: currentColor; stroke-width: calc(var(--u) * 1px); opacity: .7; }
.mk-thin .mk-cl { stroke-dasharray: 9 2.4 1.4 2.4; opacity: .55; }
.mk-thin .mk-dash { stroke-dasharray: 2.4 2.4; }
.mk-thin .mk-tri { fill: currentColor; stroke: none; opacity: .9; }
.mk-thin .mk-tk { stroke-width: calc(var(--u) * 1.5px); opacity: 1; }
.mk text {
  font: 500 calc(var(--u) * 11.5px)/1 var(--font-mono); letter-spacing: .05em; fill: currentColor; font-variant-numeric: tabular-nums;
  paint-order: stroke; stroke: var(--bg); stroke-width: calc(var(--u) * 5px); stroke-linejoin: round;
}
.mk-f { fill: var(--gold); }
.mk-sh { fill: var(--slab-shadow); }
.mk-o { fill: none; stroke: var(--mk-out); stroke-width: calc(var(--u) * 1.15px); stroke-linejoin: round; }
.mk text, .mk-ang, .mk-dims { display: none; }

/* crosshair that follows the pointer (desktop) */
.hero__cross { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .35s; }
.hero__cross.is-on { opacity: 1; }
.hero__cross i { position: absolute; left: 0; top: 0; background: var(--ink); opacity: .13; }
.hero__cross i:first-child { right: 0; height: 1px; transform: translateY(-10px); }   /* both moved by js/hero.js */
.hero__cross i:last-child { bottom: 0; width: 1px; transform: translateX(-10px); }

/* ---- foot: readout · scroll cue · title block ---- */
.hero__foot { grid-column: 1 / -1; grid-row: 3; display: grid; gap: 22px; padding-top: 4px; }
.hero__notes { display: none; }
/* the cue names what happens next; ▽ ±0.00 is the level the building will rise from */
.hero__scroll {
  --eh: repeating-linear-gradient(-45deg, var(--ink-2) 0 1px, transparent 1px 5px);   /* earth hatch */
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding-bottom: 14px; color: var(--ink);
  background:
    linear-gradient(var(--ink), var(--ink)) 0 calc(100% - 9px) / 100% 2px no-repeat,
    var(--eh) 3% 100% / 27px 9px no-repeat, var(--eh) 46% 100% / 27px 9px no-repeat, var(--eh) 97% 100% / 27px 9px no-repeat;
}
.hero__scroll .lvl { color: var(--gold-text); }
.hero__scroll svg { flex: none; width: 10px; height: 22px; margin-left: auto; }
.tblock { display: grid; grid-template-columns: 1fr auto; flex: 1; border: 1px solid var(--line-2); border-bottom: 0; background: var(--bg); }
.tblock > div { display: grid; gap: 4px; padding: 9px 12px 8px; border-bottom: 1px solid var(--line); min-width: 0; }
.tblock > div:nth-child(odd) { border-right: 1px solid var(--line); }
.tblock > div:nth-last-child(-n+2) { border-bottom: 0; }
.tblock dt { font: 500 var(--fs-ann)/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.tblock dd { font-size: .8125rem; line-height: 1.25; font-weight: 500; white-space: nowrap; }
.tblock dd.mono { font-size: .75rem; }

@media (min-width: 480px) {
  .hero__cta { display: flex; flex-wrap: wrap; }
}
@media (min-width: 600px) {
  .hero__fig { width: min(100%, 250px); }
  .hero__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; letter-spacing: .1em; }
  .eb { display: flex; }
  .eb__b { color: inherit; }
  .eb__b::before { content: "·"; margin-inline: .7em; }
  .mk text { display: block; }
  .hero__scroll { justify-content: space-between; }
  .hero__scroll svg { margin-left: 0; }
}
/* landscape phones: the headline comes first, the mark drawing waits for a taller screen */
@media (max-height: 520px) and (max-width: 899.98px) {
  .hero__fig { display: none; }
  .hero__eyebrow { grid-column: 1 / -1; }
  .hbox { margin-top: 36px; }
}

@media (min-width: 900px) {
  .hero__eyebrow { grid-column: 1 / -1; padding-top: clamp(24px, 4.6vh, 52px); }
  .hero__reg { display: block; }
  .hero__main { grid-column: 1 / span 8; padding-block: 0 clamp(16px, 3vh, 36px); }
  #hero-title { font-size: min(var(--fs-hero), 20.5vh); font-size: min(var(--fs-hero), 20.5svh); }
  .hero__fig { grid-column: 9 / -1; grid-row: 1 / span 2; align-self: center; justify-self: end; width: min(100%, 50vh); width: min(100%, 50svh); padding: 28px 0 0; }
  .mk-ang, .mk-dims { display: block; }
  .hero__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 8px; margin-right: calc(var(--pad) * -1); }
  .hero__notes { display: grid; gap: 6px; padding-bottom: 18px; }
  .hero__xy { visibility: hidden; }
  .hero__scroll { flex: 1; margin: 0 clamp(20px, 3.4vw, 56px) 14px; }
  .tblock { flex: none; border-right: 0; min-width: 330px; }
}
/* short laptop screens: keep the whole title sheet above the fold */
@media (min-width: 900px) and (max-height: 800px) {
  .hero__eyebrow { padding-top: 20px; }
  .hbox { margin-top: 36px; }
  #hero-title { font-size: min(var(--fs-hero), 19vh); font-size: min(var(--fs-hero), 19svh); }
  .hero__lead { margin-top: 32px; font-size: 1.0625rem; }
  .hero__cta { margin-top: 20px; }
  .hero__cta .btn--lg { min-height: 54px; }
  .hero__fig { width: min(100%, 46vh); width: min(100%, 46svh); }
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .hero__xy { visibility: visible; }
}

/* ---- load choreography (pure CSS: runs with or without the scripts) ---- */
@media (prefers-reduced-motion: no-preference) {
  .ln__in { animation: h-up 1.05s var(--ease) .08s both; }
  .ln + .ln .ln__in { animation-delay: .2s; }
  .hero__eyebrow, .hero__lead, .hero__cta, .hero__foot { animation: h-rise .9s var(--ease) both; }
  .hero__eyebrow { animation-delay: .05s; }
  .hero__lead { animation-delay: .5s; }
  .hero__cta { animation-delay: .62s; }
  .hero__foot { animation-delay: .9s; }
  .dim::before, .dim::after, .dim__tk, .dim__v { animation: h-fade .5s 1.25s both; }
  .dim--x .dim__ln { animation: h-sx .9s var(--ease-io) .75s both; }
  .dim--y .dim__ln { animation: h-sy .9s var(--ease-io) .9s both; }
  .dim--y::before, .dim--y::after, .dim--y .dim__tk, .dim--y .dim__v { animation-delay: 1.4s; }

  .mk-cl { animation: h-fade .7s .15s both; }
  .mk-o { stroke-dasharray: 1; animation: h-draw 1.1s var(--ease-io) both; animation-delay: calc(.3s + var(--n) * 70ms); }
  .mk-f, .mk-sh { animation: h-slab .7s var(--ease) both; animation-delay: calc(1.1s + var(--n) * 90ms); }
  .mk-l { animation: h-tick .5s var(--ease) both; animation-delay: calc(1.16s + var(--n) * 90ms); }
  .mk-ang, .mk-dims { animation: h-fade .8s 1.9s both; }
  .hero__scroll svg { animation: h-bob 2.4s var(--ease-io) 2.4s infinite; }
}
@keyframes h-up { from { transform: translateY(112%); } }
@keyframes h-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes h-fade { from { opacity: 0; } }
@keyframes h-sx { from { transform: scaleX(0); } }
@keyframes h-sy { from { transform: scaleY(0); } }
@keyframes h-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes h-slab { from { opacity: 0; transform: translateY(6px); } }
@keyframes h-tick { from { opacity: 0; transform: translateX(-7px); } }
@keyframes h-bob { 0%, 100% { transform: none; } 50% { transform: translateY(5px); } }
