/* ============================================================
   Talsu arhitektu birojs — design system
   Cloned design language from hba.com (structure/motion/type),
   tailored palette + original content. Single grotesque type,
   warm cream + deep ink, brass accent, generous whitespace.
   ============================================================ */

:root {
  --cream:    #F3EEEA;   /* page background (HBA warm cream) */
  --cream-2:  #EAE3DC;   /* slightly deeper cream for panels */
  --ink:      #091D1E;   /* deep desaturated teal-black */
  --ink-soft: #2A3637;   /* softened ink for body text */
  --paper:    #FBFBF9;   /* near-white (text on dark) */
  --brass:    #8A7355;   /* architectural brass accent (sparingly) */
  --brass-dk: #6F5C43;   /* darker brass — AA on cream */
  --brass-lt: #BCA079;   /* lighter brass — AA on ink/dark */
  --line:     #D7CFC6;   /* hairline borders on cream */
  --line-dk:  rgba(251,251,249,0.16);
  --muted:    #635D53;   /* secondary text on cream — AA on cream (~5.6:1) */

  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1320px;
  --gut: clamp(20px, 5vw, 88px);     /* page side gutter */
  --sp:  clamp(72px, 12vh, 168px);   /* vertical section rhythm */

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Lenis handles smoothness; keep native fallback off to avoid double-smoothing */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--ink); color: var(--paper); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 12px 18px;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* ---------- Typography ------------------------------------ */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }

.eyebrow {
  font-size: 12px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.22em; color: var(--muted);
}
.display {
  font-weight: 500; line-height: 0.98; letter-spacing: -0.03em;
  font-size: clamp(2.6rem, 7.2vw, 6.4rem);
}
.section-title {
  font-weight: 500; line-height: 1.04; letter-spacing: -0.025em;
  font-size: clamp(1.9rem, 4vw, 3.4rem);
}
.lead {
  font-size: clamp(1.15rem, 1.7vw, 1.5rem); line-height: 1.4;
  font-weight: 400; letter-spacing: -0.012em; color: var(--ink-soft);
}
.caption {
  font-size: 12px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--muted);
}

/* ---------- Buttons --------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.14em; padding: 16px 28px; border-radius: 999px;
  border: 1px solid var(--ink); color: var(--ink); background: transparent;
  cursor: pointer; transition: background .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease), transform .5s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--brass); border-color: var(--brass); }
.btn--ghost { border-color: rgba(9,29,30,0.28); }
.btn--on-dark { border-color: var(--line-dk); color: var(--paper); }
.btn--on-dark:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--block { width: 100%; justify-content: center; }
.btn--small { padding: 11px 18px; }

/* ---------- Nav ------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gut); color: var(--paper);
  transition: background .6s var(--ease), color .45s var(--ease), padding .5s var(--ease), box-shadow .6s var(--ease);
}
.nav--solid { background: rgba(243,238,234,0.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--ink); padding-block: 16px; box-shadow: 0 1px 0 var(--line); }
.nav__logo { font-weight: 600; font-size: 16px; letter-spacing: 0.02em; white-space: nowrap; }
.nav__logo b { font-weight: 600; }
.nav__links { display: flex; gap: clamp(20px, 2.4vw, 40px); }
.nav__link {
  font-size: 12.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.16em;
  position: relative; padding-block: 4px; opacity: .92;
}
.nav__link::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 1px; background: currentColor; transition: width .4s var(--ease); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { width: 100%; }
.nav__right { display: flex; align-items: center; gap: 20px; }
.nav__menu-btn {
  display: none; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer;
  color: inherit; font-family: inherit; font-size: 12.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.16em;
}
.nav__menu-btn span { display: inline-block; width: 22px; height: 1px; background: currentColor; position: relative; }
.nav__menu-btn span::before, .nav__menu-btn span::after { content: ""; position: absolute; left: 0; width: 22px; height: 1px; background: currentColor; }
.nav__menu-btn span::before { top: -6px; } .nav__menu-btn span::after { top: 6px; }
/* Collapsed mode (HBA: links → MENU on scroll) */
.nav--collapsed .nav__links { display: none; }
.nav--collapsed .nav__menu-btn { display: inline-flex; }

/* ---------- Full-screen overlay menu ---------------------- */
.menu {
  position: fixed; inset: 0; z-index: 170; background: var(--ink); color: var(--paper);
  display: grid; grid-template-rows: auto 1fr auto; padding: 22px var(--gut) var(--gut);
  clip-path: inset(0 0 100% 0); pointer-events: none;
  transition: clip-path .8s var(--ease);
}
.menu--open { clip-path: inset(0 0 0 0); pointer-events: auto; }
.menu__top { display: flex; align-items: center; justify-content: space-between; }
.menu__close { background: none; border: 0; color: inherit; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.16em; }
.menu__links { align-self: center; display: flex; flex-direction: column; gap: clamp(8px, 1.4vh, 18px); }
.menu__link {
  font-size: clamp(2.4rem, 8vw, 5.2rem); font-weight: 500; line-height: 1.02; letter-spacing: -0.03em;
  opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease), color .4s;
}
.menu--open .menu__link { opacity: 1; transform: none; }
.menu--open .menu__link:nth-child(1) { transition-delay: .12s; }
.menu--open .menu__link:nth-child(2) { transition-delay: .19s; }
.menu--open .menu__link:nth-child(3) { transition-delay: .26s; }
.menu--open .menu__link:nth-child(4) { transition-delay: .33s; }
.menu__link:hover { color: var(--brass); }
.menu__meta { display: flex; flex-wrap: wrap; gap: 8px 40px; color: rgba(251,251,249,0.7); font-size: 14px; }
.menu__meta a:hover { color: var(--paper); }

/* ---------- Hero (full-bleed cinematic) ------------------- */
.hero { position: relative; isolation: isolate; min-height: 100svh; display: flex; align-items: flex-end; color: var(--paper); overflow: hidden; background: var(--ink); }
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
.hero__veil { position: absolute; inset: 0; z-index: 1; background:
  linear-gradient(180deg, rgba(9,29,30,0.45) 0%, rgba(9,29,30,0.05) 30%, rgba(9,29,30,0.55) 100%); }
.hero__inner { position: relative; z-index: 2; padding: 0 var(--gut) clamp(56px, 9vh, 120px); max-width: 1100px; }
.hero__eyebrow { color: rgba(251,251,249,0.82); margin-bottom: 22px; }
.hero__title { font-weight: 500; line-height: 0.98; letter-spacing: -0.03em; font-size: clamp(2.8rem, 7.4vw, 6.6rem); }
.hero__lede { margin-top: 26px; max-width: 620px; color: rgba(251,251,249,0.9); }
.hero__actions { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero__trust { margin-top: 24px; font-size: 13px; letter-spacing: 0.04em; color: rgba(251,251,249,0.85); }
.hero__scroll { position: absolute; z-index: 2; right: var(--gut); bottom: clamp(40px,7vh,90px); writing-mode: vertical-rl; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(251,251,249,0.7); }

/* ---------- Inner-page header ----------------------------- */
.page-hero { padding: clamp(124px, 20vh, 220px) 0 clamp(36px, 6vh, 72px); border-bottom: 1px solid var(--line); }
.page-hero__eyebrow { display: block; margin-bottom: 22px; }
.page-hero__title { font-weight: 500; line-height: 0.98; letter-spacing: -0.03em; font-size: clamp(2.4rem, 6.4vw, 5.4rem); }
.page-hero__lede { margin-top: 26px; max-width: 60ch; }

/* ---------- Statement (big-type editorial) ---------------- */
.statement { padding: var(--sp) 0; }
.statement__text {
  font-weight: 500; line-height: 1.08; letter-spacing: -0.025em;
  font-size: clamp(1.7rem, 3.6vw, 3.2rem); max-width: 18ch;
}
.statement__text .dim { color: var(--muted); }
.statement--wide .statement__text { max-width: 24ch; }

/* ---------- Editorial offset grid (HBA signature) --------- */
.editorial { padding: clamp(20px,4vh,60px) 0 var(--sp); }
.editorial__row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 90px); align-items: start; }
.editorial__item--low { margin-top: clamp(80px, 18vh, 220px); }
.editorial__media { overflow: hidden; }
.editorial__media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; transition: transform 1.4s var(--ease); }
.editorial__media--wide img { aspect-ratio: 16/10; }
.editorial__item:hover .editorial__media img { transform: scale(1.04); }
.editorial__cap { margin-top: 16px; display: flex; justify-content: space-between; gap: 16px; }

/* ---------- Full-bleed band ------------------------------- */
.band { position: relative; height: clamp(60vh, 80vh, 92vh); overflow: hidden; }
.band__media { position: absolute; inset: 0; }
.band__media img { width: 100%; height: 100%; object-fit: cover; }
.band__cap { position: absolute; left: var(--gut); bottom: 28px; color: var(--paper); }

/* ---------- Generic section ------------------------------- */
.section { padding: var(--sp) 0; }
.section__head { max-width: 760px; margin-bottom: clamp(40px, 7vh, 90px); }
.section__head .eyebrow { margin-bottom: 20px; display: block; }
.section--dark { background: var(--ink); color: var(--paper); }
.section--dark .eyebrow { color: rgba(251,251,249,0.55); }
.section--dark .lead { color: rgba(251,251,249,0.82); }

/* ---------- Projects grid --------------------------------- */
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(28px, 4vw, 64px) clamp(24px, 4vw, 56px); }
.pcard { display: block; }
.pcard__media { overflow: hidden; background: var(--cream-2); }
.pcard__media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform 1.4s var(--ease); }
.pcard:hover .pcard__media img { transform: scale(1.045); }
.pcard__cap { margin-top: 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.pcard__title { font-size: clamp(1.15rem, 1.7vw, 1.5rem); font-weight: 500; letter-spacing: -0.015em; }
.pcard__meta { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); white-space: nowrap; }
.pcard--tall .pcard__media img { aspect-ratio: 3/4; }

/* ---------- Expertise list (editorial rows) --------------- */
.exlist { border-top: 1px solid var(--line); }
.exrow { display: grid; grid-template-columns: 90px 1fr 1.1fr; gap: clamp(16px,3vw,48px); align-items: start;
  padding: clamp(28px,4.5vh,52px) 0; border-bottom: 1px solid var(--line); transition: background .5s var(--ease); }
.exrow:hover { background: rgba(138,115,85,0.05); }
.exrow__num { font-size: 13px; color: var(--brass-dk); font-weight: 600; letter-spacing: 0.04em; padding-top: 8px; }
.section--dark .exrow__num { color: var(--brass-lt); }
.exrow__title { font-size: clamp(1.5rem, 2.8vw, 2.4rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; }
.exrow__text { color: var(--ink-soft); max-width: 52ch; }

/* ---------- Process timeline ------------------------------ */
.proc { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(16px,2vw,32px); counter-reset: step; }
.proc__step { position: relative; padding-top: 28px; border-top: 1px solid var(--line); }
.proc__step::before { content: ""; position: absolute; top: -1px; left: 0; height: 2px; width: 0; background: var(--brass); }
.proc__step.is-in::before { width: 38px; transition: width .7s var(--ease); }
.proc__num { font-size: 12px; color: var(--brass-lt); font-weight: 600; letter-spacing: 0.1em; }
.proc__title { font-size: 1.15rem; font-weight: 500; margin: 8px 0 8px; letter-spacing: -0.01em; }
.proc__text { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.5; }
.section--dark .proc__text { color: rgba(251,251,249,0.82); }
.section--dark .proc__step { border-color: var(--line-dk); }

/* ---------- Review ---------------------------------------- */
.review { padding: var(--sp) 0; text-align: center; }
.review__quote { font-size: clamp(1.6rem, 3.4vw, 3rem); font-weight: 500; line-height: 1.18; letter-spacing: -0.02em; max-width: 22ch; margin: 0 auto; }
.review__cite { margin-top: 28px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.review__author { font-weight: 500; }
.review__src { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }

/* ---------- About ----------------------------------------- */
.about { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(28px, 6vw, 96px); align-items: center; }
.about__media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.about__portrait-ph { aspect-ratio: 4/5; background: var(--cream-2); border: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.about__copy p { margin-top: 18px; color: var(--ink-soft); }
.about__copy .section-title { color: var(--ink); }

/* ---------- CTA band + contact ---------------------------- */
.cta-band { padding: var(--sp) 0; }
.cta-band__title { font-weight: 500; line-height: 1.02; letter-spacing: -0.03em; font-size: clamp(2.2rem, 5.4vw, 4.6rem); max-width: 16ch; }
.cta-band__sub { margin-top: 24px; max-width: 46ch; color: var(--ink-soft); }
.cta-band__actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 90px); align-items: start; }
.contact-info p { margin-top: 14px; color: var(--ink-soft); }
.contact-info a:hover { color: var(--brass); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 16px; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--line); padding: 12px 2px; border-radius: 0;
  transition: border-color .4s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field textarea { resize: vertical; min-height: 80px; }
.form .field--full .btn { margin-top: 6px; }
.form__note { grid-column: 1/-1; font-size: 13px; color: var(--muted); }

/* ---------- Footer ---------------------------------------- */
.footer { background: var(--ink); color: var(--paper); padding: clamp(56px,8vh,110px) 0 40px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(24px,4vw,64px); }
.footer__brand { font-size: clamp(1.4rem,2.4vw,2rem); font-weight: 500; letter-spacing: -0.02em; }
.footer__col .footer__h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(251,251,249,0.62); margin-bottom: 16px; font-weight: 500; }
.footer__col a, .footer__col p { display: block; color: rgba(251,251,249,0.82); margin-bottom: 8px; }
.footer__col a:hover { color: var(--paper); }
.footer__bottom { margin-top: clamp(48px,7vh,90px); padding-top: 24px; border-top: 1px solid var(--line-dk);
  display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; font-size: 12.5px; color: rgba(251,251,249,0.6); }

/* ---------- Cookie ---------------------------------------- */
.cookie { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 160; max-width: 420px;
  background: var(--ink); color: var(--paper); padding: 18px 20px; border-radius: 14px;
  display: flex; gap: 14px; align-items: center; box-shadow: 0 18px 50px rgba(0,0,0,0.3); font-size: 13.5px; }
.cookie p { color: rgba(251,251,249,0.85); }

/* ---------- Placeholder marker (review before send) ------- */
.ph { background: rgba(138,115,85,0.14); border-bottom: 1px dashed var(--brass);
  padding: 0 4px; border-radius: 2px; }

/* ---------- Reveal animation defaults (fail-safe) ---------
   Hidden state ONLY applies when JS confirmed (html.js). No JS
   or JS failure => content is fully visible. Never invisible. */
html.js .reveal { opacity: 0; transform: translateY(28px); }
html.js .reveal.is-in { opacity: 1; transform: none; transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
html.js .reveal--img { clip-path: inset(0 0 100% 0); }
html.js .reveal--img.is-in { clip-path: inset(0 0 0 0); transition: clip-path 1.1s var(--ease); }

/* ---------- Responsive ------------------------------------ */
@media (max-width: 880px) {
  .nav__links { display: none; }
  .nav__menu-btn { display: inline-flex; }
  .editorial__row { grid-template-columns: 1fr; gap: 48px; }
  .editorial__item--low { margin-top: 0; }
  .pgrid { grid-template-columns: 1fr; }
  .exrow { grid-template-columns: 40px 1fr; }
  .exrow__text { grid-column: 1 / -1; max-width: none; }
  .proc { grid-template-columns: 1fr 1fr; }
  .about, .contact-grid { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .proc { grid-template-columns: 1fr; }
  .hero { min-height: 92svh; }
  .cookie { left: 10px; right: 10px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal--img { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .hero__media img { transform: none; }
  * { scroll-behavior: auto !important; }
}
