/* === Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f1ede6;
  --bg-dark: #0f0f0f;
  --ink: #111;
  --ink-soft: #555;
  --line: #d8d2c6;
  --accent: #1a1a1a;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 100px;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; }

.eyebrow,
.label,
.btn-arrow,
.nav-home,
.counter,
.pcard-label,
.cookies-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.btn-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border: 1px solid currentColor;
  font-weight: 500;
  transition: background .25s, color .25s;
}
.btn-arrow:hover { background: currentColor; }
.btn-arrow:hover { color: var(--bg); }

/* === Hero — scroll-scrubbed canvas === */
.hero-scrub {
  position: relative;
  width: 100%;
  height: 100vh; /* fallback for older browsers */
  height: 100svh; /* small viewport height = stable while pinned; prevents address-bar jitter */
  background: #0a0a0a;
  color: #fff;
  overflow: hidden;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-dark {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.35) 50%, rgba(0,0,0,.85) 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

/* Loading progress bar (top of hero) */
.hero-progress {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  z-index: 6;
  background: rgba(255,255,255,.08);
}
.hero-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,.6);
  transition: width .2s ease;
}
.hero-progress.is-done { opacity: 0; transition: opacity .4s ease .3s; }

/* Text content — fades in at the end of scrub */
.hero-scrub-content {
  position: absolute;
  left: 6vw;
  right: 6vw;
  bottom: 14vh;
  z-index: 3;
  max-width: 1200px;
  opacity: 0;
  pointer-events: none;
}
.hero-scrub-content.is-revealed { pointer-events: auto; }

.hero-scrub-eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,.7);
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(20px);
}

.hero-scrub-title {
  font-size: clamp(36px, 6vw, 88px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 36px;
}
.hero-scrub-title .line {
  display: block;
  overflow: hidden;
}
.hero-scrub-title .line > i {
  display: inline-block;
  font-style: normal;
  transform: translateY(110%);
  will-change: transform;
}

.hero-scrub-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 60px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
}
.hero-scrub-meta p {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255,255,255,.78);
  max-width: 460px;
}
.hero-scrub-actions {
  display: flex;
  gap: 14px;
}
.btn-arrow.light {
  color: #fff;
  border-color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
}
.btn-arrow.light:hover { background: #fff; color: #000; }
.btn-arrow.ghost {
  color: #fff;
  border-color: rgba(255,255,255,.4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
}
.btn-arrow.ghost:hover { background: rgba(255,255,255,.1); }

.hero-scrub-hint {
  position: absolute;
  top: 32px;
  right: 6vw;
  z-index: 4;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,.6);
  animation: scrollHint 2s ease-in-out infinite;
}
@keyframes scrollHint {
  0%, 100% { transform: translateY(0); opacity: .6; }
  50%      { transform: translateY(4px); opacity: 1; }
}
.hero-scrub-content.is-revealed ~ .hero-scrub-hint,
.hero-scrub.is-end .hero-scrub-hint { opacity: 0; transition: opacity .4s ease; }

/* === Reveal section (pinned, scroll-driven video) === */
.reveal-pin {
  position: relative;
  width: 100%;
  height: 100vh; /* fallback */
  height: 100svh; /* small viewport height = stable; avoids pin-spacer shifting as the mobile address bar moves */
  background: #0d0d0d;
  color: #fff;
  overflow: hidden;
}
.reveal-pin::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 6vw;
  right: 6vw;
  height: 1px;
  background: rgba(255,255,255,.12);
  z-index: 4;
}
.reveal-eyebrow {
  position: absolute;
  top: 32px;
  left: 6vw;
  z-index: 5;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #cfc8b9;
}

/* Video frame — fills the section; GSAP scales it 0.8 → 1.0 on scroll */
.reveal-video-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scale(0.8) translateZ(0);
  transform-origin: center center;
  overflow: hidden;
  z-index: 2;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.reveal-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.reveal-scrim {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 78%, rgba(0,0,0,.35) 100%),
    linear-gradient(180deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,.4) 100%);
}

/* Text overlays — fixed at viewport edges */
.reveal-overlay-left {
  position: absolute;
  top: 50%;
  left: 6vw;
  transform: translateY(-50%);
  z-index: 5;
  max-width: 580px;
}
.reveal-title {
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #fff;
}
.reveal-overlay-right {
  position: absolute;
  top: 50%;
  right: 6vw;
  transform: translateY(-50%);
  z-index: 5;
  text-align: right;
  color: #fff;
}
.reveal-overlay-right .label {
  display: block;
  margin-bottom: 12px;
  color: #cfc8b9;
}
.reveal-overlay-right p {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 24px;
}
.reveal-overlay-right .btn-arrow {
  color: #fff;
  border-color: rgba(255,255,255,.5);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
}
.reveal-overlay-right .btn-arrow:hover { background: #fff; color: #000; }

.reveal-play-btn {
  position: absolute;
  bottom: 90px;
  right: 6vw;
  z-index: 5;
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  padding: 14px 32px;
  letter-spacing: 0.2em;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: background .25s, color .25s;
}
.reveal-play-btn:hover { background: #fff; color: #000; }

.reveal-thumb {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 5;
  width: 160px;
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,.25);
  padding: 6px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}
.reveal-thumb img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}

/* === Services === */
.services {
  padding: 180px 6vw 220px;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  align-items: start;
}
.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.service-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.service-img {
  position: relative;
  overflow: hidden;
}
.service-img img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  transition: transform .8s ease;
}
.service-img:hover img { transform: scale(1.04); }
.service-img figcaption {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 8%;
  color: #fff;
  font-size: clamp(17px, 1.7vw, 26px);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 20px rgba(0,0,0,.35);
  overflow-wrap: break-word;
  hyphens: auto;
}
.service-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 360px;
}
.card-attic      { transform: translateY(40px); }
.card-additional { transform: translateY(-20px); }
.card-structural { transform: translateY(50px); }
.card-windows    { transform: translateY(-10px); }

/* === Stats (dark) === */
.principles {
  position: relative;
  background: var(--bg-dark);
  color: #f0ece4;
  padding: 160px 6vw;
}
.stats-eyebrow {
  display: block;
  color: #cfc8b9;
  margin-bottom: 100px;
}
.stats-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 36px;
  border-top: 1px solid rgba(255,255,255,.18);
}
.stat-value {
  font-size: clamp(64px, 10vw, 144px);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #fff;
}
.stat-star {
  font-size: 0.6em;
  margin-left: 4px;
  vertical-align: 0.18em;
  color: #fff;
}
.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #b8b3a8;
}

/* === Showroom === */
.showroom {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding: 140px 6vw;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: center;
}
.showroom-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}
.showroom-img.tall img  { aspect-ratio: 3/4; object-fit: cover; width: 100%; }
.showroom-img.wide img  { aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.showroom-text .eyebrow { color: var(--ink-soft); }
.showroom-text h2 {
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 400;
  line-height: 1.2;
  margin: 18px 0 22px;
  max-width: 420px;
}
.showroom-text p {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 28px;
  max-width: 420px;
}

/* === Featured projects (fluid.glass-style hover list) === */
.projects {
  position: relative;
  background: #f5f2ed;
  padding: 140px 6vw 160px;
  overflow: hidden;
}
.projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.projects-head .eyebrow { color: var(--ink-soft); }
.projects-cta {
  background: #111;
  color: #f5f2ed;
  border-color: #111;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
}
.projects-cta:hover { background: #000; color: #fff; }

.projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #e0ddd8;
}
.project-row {
  border-bottom: 1px solid #e0ddd8;
}
.project-link {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) 2fr 24px;
  align-items: center;
  gap: 48px;
  padding: 32px 0;
  color: #b3aea5;
  text-decoration: none;
  transition: color .35s ease;
}
.project-link:hover { color: #111; }
.project-name {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
}
.project-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 8px 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  white-space: nowrap;
  transition: color .35s ease, border-color .35s ease;
}
.project-arrow {
  font-size: 18px;
  text-align: right;
  transition: transform .35s ease;
}
.project-link:hover .project-arrow { transform: translateX(4px); }

/* Floating preview that follows the cursor over a row */
.project-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 220px;
  height: 300px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) translateY(20px);
  transition: opacity .3s ease, transform .3s ease;
  z-index: 10;
  overflow: hidden;
  will-change: transform, opacity;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
}
.project-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-preview.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

@media (max-width: 960px) {
  .projects { padding: 100px 6vw 120px; }
  .projects-head { flex-direction: column; align-items: flex-start; }
  .project-link {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 0;
  }
  .project-arrow { display: none; }
  .project-preview { display: none; }
}

/* Touch devices never fire :hover, so the project rows would stay stuck in
   their muted resting colour and read as disabled. Show them at full ink. */
@media (hover: none) {
  .project-link { color: var(--ink); }
}

/* === Stories === */
.stories {
  padding: 140px 6vw;
  border-top: 1px solid var(--line);
  position: relative;
}
.stories-head {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 80px;
}
.stories-head .counter { color: var(--ink-soft); }
.story-nav { margin-left: auto; display: flex; gap: 10px; }
.story-nav button {
  width: 44px; height: 44px;
  border: 1px solid var(--ink);
  font-size: 16px;
  transition: background .2s;
}
.story-nav button:hover { background: var(--ink); color: var(--bg); }

.story {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 60px;
  align-items: flex-start;
}
.story-photo img {
  width: 200px;
  height: 240px;
  object-fit: cover;
  filter: grayscale(1);
}
.story blockquote {
  font-size: clamp(28px, 3.6vw, 56px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  position: relative;
  max-width: 1100px;
}
.quote-mark {
  font-family: Georgia, serif;
  font-size: 1.4em;
  color: var(--ink-soft);
  margin-right: 10px;
}
.story footer {
  margin-top: 40px;
  font-size: 14px;
  font-weight: 400;
}
.story footer strong { display: block; font-weight: 500; margin-bottom: 4px; }
.story footer span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
.google-score {
  margin-top: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}
.g-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  color: #4285f4;
  border: 1px solid var(--line);
}
.google-score a {
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* === Contact === */
.contact {
  padding: 140px 6vw;
  border-top: 1px solid var(--line);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: flex-start;
}
.contact .eyebrow { color: var(--ink-soft); }
.contact h2 {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-top: 16px;
  max-width: 480px;
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.contact-info .label { color: var(--ink-soft); display: block; margin-bottom: 6px; }
.contact-info p { font-size: 18px; }

/* === Bottom nav === */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  background: #2a2a2a;
  color: #fff;
  padding: 10px 14px;
  gap: 28px;
  border-radius: 6px;
  z-index: 50;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.nav-logo {
  display: flex; align-items: center; justify-content: center;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 4px;
}
.nav-logo img {
  height: 22px;
  width: auto;
  display: block;
  filter: invert(1) brightness(2.2) contrast(1.1);
}
.nav-home {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  padding: 0 32px;
}
.nav-menu {
  width: 42px; height: 42px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  color: #fff;
}
.nav-menu span {
  display: block;
  width: 18px; height: 1.5px;
  background: currentColor;
  transition: transform .3s ease, opacity .3s ease;
}
.nav-menu.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-menu.is-open span:nth-child(2) { opacity: 0; }
.nav-menu.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* === Slide-in nav drawer === */
.nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  z-index: 70;
}
.nav-drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 90vw);
  background: #1a1a1a;
  color: #f0ece4;
  padding: 28px 32px;
  z-index: 80;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.nav-drawer.is-open {
  transform: translateX(0);
}
.nav-drawer-close {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
  color: #f0ece4;
  background: transparent;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  cursor: pointer;
  margin-bottom: 32px;
  transition: background .25s ease, color .25s ease;
}
.nav-drawer-close:hover { background: #f0ece4; color: #1a1a1a; }
.nav-drawer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-drawer-list li {
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-drawer-list a {
  display: block;
  padding: 18px 0;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: #f0ece4;
  transition: color .2s ease, padding-left .2s ease;
}
.nav-drawer-list a:hover { color: #fff; padding-left: 8px; }
.nav-drawer-meta {
  margin-top: auto;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #b8b3a8;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.nav-drawer-meta a {
  color: #f0ece4;
}
.nav-drawer-meta a:hover { color: #fff; }
.nav-drawer-meta p { margin-top: 4px; }

/* Lock body scroll when drawer is open */
body.is-drawer-open { overflow: hidden; }

/* === Cookies === */
.cookies {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 22px;
  z-index: 60;
}
.cookies[hidden] { display: none !important; animation: none !important; }
.cookies-head {
  margin-bottom: 14px;
  font-weight: 500;
}
.cookies p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.cookies-actions {
  display: flex;
  gap: 10px;
}
.btn-cookie {
  flex: 1;
  padding: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  border: 1px solid var(--ink);
  transition: background .2s, color .2s;
}
.btn-cookie.accept { background: var(--ink); color: var(--bg); }
.btn-cookie.accept:hover { background: #000; }
.btn-cookie.deny:hover { background: var(--ink); color: var(--bg); }

/* === Animations === */

/* Reveal mask animation for images */
.reveal-img {
  position: relative;
  overflow: hidden;
}
.reveal-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  transform: translateX(0);
  transition: transform 1.2s cubic-bezier(.7, 0, .2, 1);
  z-index: 2;
}
.reveal-img.dark-mask::after { background: var(--bg-dark); }
.reveal-img.in-view::after { transform: translateX(101%); }
.reveal-img img {
  transform: scale(1.15);
  transition: transform 1.6s cubic-bezier(.2, .6, .2, 1);
}
.reveal-img.in-view img { transform: scale(1); }

/* Text line reveal — each span becomes a masked line */
.reveal-text > span {
  display: block;
  overflow: hidden;
}
.reveal-text > span > i {
  display: inline-block;
  font-style: inherit;
  transform: translateY(110%);
  transition: transform 1s cubic-bezier(.4, 0, .2, 1);
}
.reveal-text.in-view > span > i { transform: translateY(0); }
.reveal-text > span:nth-of-type(2) > i { transition-delay: .12s; }
.reveal-text > span:nth-of-type(3) > i { transition-delay: .24s; }
.reveal-text br { display: none; }

/* Generic fade-up */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .6, .2, 1);
}
.fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .6, .2, 1);
}
.stagger.in-view > *:nth-child(1) { transition-delay: .05s; }
.stagger.in-view > *:nth-child(2) { transition-delay: .15s; }
.stagger.in-view > *:nth-child(3) { transition-delay: .25s; }
.stagger.in-view > *:nth-child(4) { transition-delay: .35s; }
.stagger.in-view > * {
  opacity: 1;
  transform: translateY(0);
}

.hero-video {
  animation: heroVideoIn 2s ease forwards;
  opacity: 0;
}
@keyframes heroVideoIn { to { opacity: .55; } }

/* Service cards float on scroll */
.service-card {
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 1s ease, transform 1.2s cubic-bezier(.2, .6, .2, 1);
}
.service-card.in-view { opacity: 1; }
.card-attic.in-view      { transform: translateY(40px); }
.card-additional.in-view { transform: translateY(-20px); }
.card-structural.in-view { transform: translateY(50px); }
.card-windows.in-view    { transform: translateY(-10px); }
.service-card:nth-child(2) { transition-delay: .12s; }
.service-card:nth-child(3) { transition-delay: .24s; }
.service-card:nth-child(4) { transition-delay: .36s; }
.service-card figcaption {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease .6s, transform .8s ease .6s;
}
.service-card.in-view figcaption {
  opacity: 1;
  transform: translateY(0);
}

/* Principle cards hover lift */
.pcard {
  transition: transform .5s cubic-bezier(.2, .6, .2, 1), border-color .3s;
}
.pcard:hover {
  transform: translateY(-8px);
  border-color: rgba(255,255,255,.2);
}
.pcard img { transition: transform .8s ease; }
.pcard:hover img { transform: scale(1.05); }

/* Quote mark pulse */
.quote-mark {
  display: inline-block;
  animation: quotePulse 3s ease-in-out infinite;
}
@keyframes quotePulse {
  0%, 100% { transform: scale(1); opacity: .6; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* Bottom nav floats in */
.bottom-nav {
  opacity: 0;
  transform: translateX(-50%) translateY(120%);
  animation: navIn .8s cubic-bezier(.2, .6, .2, 1) 1.2s forwards;
}
@keyframes navIn {
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Cookie banner slide in */
.cookies {
  animation: cookieIn .6s cubic-bezier(.2, .6, .2, 1) 1.8s both;
}
@keyframes cookieIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Story nav button hover */
.story-nav button {
  position: relative;
  overflow: hidden;
}
.story-nav button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.7, 0, .2, 1);
  z-index: -1;
}
.story-nav button:hover::before { transform: translateY(0); }

/* Subtle parallax for hero video */
.hero-video {
  will-change: transform;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Palvelut page === */
.palvelut-hero {
  background: var(--bg);
  padding: 200px 6vw 120px;
  border-bottom: 1px solid var(--line);
}
.palvelut-hero-inner {
  max-width: 1400px;
  margin: 0 auto;
}
.palvelut-hero-eyebrow {
  display: block;
  color: var(--ink-soft);
  margin-bottom: 36px;
}
.palvelut-hero-title {
  font-size: clamp(56px, 11vw, 180px);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.palvelut-hero-lede {
  margin-top: 40px;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.palvelut-services {
  background: var(--bg);
  padding: 40px 0 80px;
}
.palvelut-service {
  padding: 80px 6vw 80px;
  border-top: 1px solid var(--line);
}
.palvelut-service:first-child { border-top: 0; }
.palvelut-service-img {
  position: relative;
  width: 100%;
  margin-bottom: 56px;
  overflow: hidden;
  transform: scale(0.8);
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.palvelut-service-img img {
  width: 100%;
  aspect-ratio: 21/9;
  object-fit: cover;
  display: block;
}
.palvelut-service-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
.palvelut-service-head {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.palvelut-service-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}
.palvelut-service-name {
  font-size: clamp(40px, 6vw, 88px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.palvelut-service-meta {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 14px;
}
.palvelut-service-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 520px;
}
.palvelut-service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.palvelut-service-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  font-weight: 400;
  color: var(--ink);
}
.palvelut-service-list li::before {
  content: '↳';
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-soft);
}

/* === CTA strip === */
.palvelut-cta {
  position: relative;
  background-color: var(--bg-dark);
  background-image:
    linear-gradient(180deg, rgba(10,10,10,.82) 0%, rgba(10,10,10,.78) 50%, rgba(10,10,10,.88) 100%),
    url('images/rl-hesperiankatu7.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #f0ece4;
  padding: 120px 6vw;
  border-top: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}
.palvelut-cta-inner { position: relative; z-index: 1; }
.palvelut-cta-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 60px;
  flex-wrap: wrap;
}
.palvelut-cta-eyebrow {
  display: block;
  color: #cfc8b9;
  margin-bottom: 28px;
}
.palvelut-cta h2 {
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 720px;
}
.palvelut-cta .btn-arrow {
  color: #fff;
  border-color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  padding: 18px 30px;
  white-space: nowrap;
}
.palvelut-cta .btn-arrow:hover { background: #fff; color: var(--bg-dark); }

@media (max-width: 960px) {
  .palvelut-hero { padding: 140px 6vw 80px; }
  .palvelut-service { padding: 60px 6vw; }
  .palvelut-service-img { margin-bottom: 36px; }
  .palvelut-service-img img { aspect-ratio: 16/9; }
  .palvelut-service-body { grid-template-columns: 1fr; gap: 36px; }
  .palvelut-service-meta { padding-top: 0; }
  .palvelut-cta { padding: 80px 6vw; }
  .palvelut-cta-inner { flex-direction: column; align-items: flex-start; gap: 32px; }
}

@media (max-width: 600px) {
  .palvelut-hero { padding: 120px 5vw 60px; }
  .palvelut-hero-lede { font-size: 15px; margin-top: 28px; }
  .palvelut-service { padding: 50px 5vw; }
  .palvelut-service-img img { aspect-ratio: 4/3; }
  .palvelut-service-list li { font-size: 15px; padding: 14px 0; }
  .palvelut-cta { padding: 70px 5vw; }
}

/* === Referenssit page === */
.referenssit-page {
  background: #f5f2ed;
  padding: 140px 6vw 100px;
  min-height: 70vh;
}
.referenssit-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  margin-bottom: 56px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0ddd8;
}
.referenssit-bar-label {
  color: var(--ink-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.referenssit-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.filter-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 18px;
  border: 1px solid #c9c3b6;
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.filter-pill:hover { border-color: var(--ink); }
.filter-pill.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.referenssit-suodata {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  color: var(--ink-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.referenssit-suodata:hover { color: var(--ink); }

/* Row-major responsive grid — reads left-to-right, top-to-bottom */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.project-card {
  margin-bottom: 0;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: opacity .3s ease;
}
.project-card.is-hidden {
  display: none;
}
.project-card-img {
  position: relative;
  overflow: hidden;
  background: #e8e3da;
  border-radius: 2px;
}
.project-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter .35s ease, transform .8s ease;
}
.project-card:hover .project-card-img img {
  filter: brightness(0.82);
  transform: scale(1.02);
}
.project-card-view {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15,15,15,.92);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
  backdrop-filter: blur(6px);
}
.project-card:hover .project-card-view {
  opacity: 1;
  transform: translateY(0);
}
.project-card-name {
  font-size: 20px;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 14px 4px 4px;
  color: var(--ink);
}

/* Uniform card image height across the grid (h-* variants kept in markup
   but normalised so rows align and read in order) */
.project-card .project-card-img {
  height: auto;
  aspect-ratio: 4 / 5;
}

@media (max-width: 960px) {
  .referenssit-page { padding: 110px 5vw 60px; }
  .referenssit-bar {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
  }
  .referenssit-filters { justify-content: flex-start; }
  .referenssit-suodata { justify-self: start; }
  .filter-pill { padding: 8px 14px; font-size: 10px; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === Responsive === */
@media (max-width: 960px) {
  /* Reveal section — overlays drop below the frame on mobile */
  .reveal-overlay-left,
  .reveal-overlay-right {
    position: absolute;
    left: 6vw; right: 6vw;
    text-align: left;
    transform: none;
    top: auto;
    max-width: none;
  }
  .reveal-overlay-left { top: 80px; }
  /* Keep the address block clear of the floating bottom-nav (~86px tall at its
     24px offset) so it doesn't sit behind the bar or run off-screen. */
  .reveal-overlay-right { bottom: 124px; text-align: left; }
  .reveal-title { font-size: clamp(24px, 6vw, 36px); }
  .reveal-thumb { width: 110px; }
  .reveal-play-btn { bottom: 24px; right: 24px; padding: 10px 18px; }

  .services-grid,
  .showroom,
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .principles { padding: 100px 6vw; }
  .stats-eyebrow { margin-bottom: 60px; }
  .card-attic, .card-additional, .card-structural, .card-windows { transform: none; }
  .card-attic.in-view, .card-additional.in-view, .card-structural.in-view, .card-windows.in-view { transform: none; }
  .showroom-grid { grid-template-columns: 1fr 1fr; }
  .hero-meta {
    position: static;
    transform: none;
    align-items: flex-start;
    text-align: left;
    margin-top: 40px;
  }
  .hero-content { justify-content: flex-end; padding-bottom: 60px; }
  .story { grid-template-columns: 1fr; }
  /* Cookies sit ABOVE the bottom-nav on mobile so they don't overlap.
     Nav height ~62px + 24px bottom offset + 12px gap = ~98px. */
  .cookies { right: 12px; left: 12px; width: auto; bottom: 98px; }
  .bottom-nav { width: calc(100% - 24px); justify-content: space-between; gap: 0; }
}

/* === Phone-specific tightening (≤600px) === */
@media (max-width: 600px) {
  body { padding-bottom: 140px; }

  /* Hero typography */
  .hero-scrub-content { left: 5vw; right: 5vw; bottom: 12vh; }
  .hero-scrub-eyebrow { font-size: 10px; margin-bottom: 18px; }
  /* Smaller cap so long single words (e.g. "Korjausrakentamisen") never
     clip inside the overflow:hidden reveal lines on narrow phones. */
  .hero-scrub-title { font-size: clamp(24px, 7.5vw, 40px); margin-bottom: 24px; }
  .hero-scrub-meta { gap: 24px; }
  .hero-scrub-meta p { font-size: 14px; }
  .hero-scrub-actions { flex-direction: column; gap: 10px; align-items: stretch; }
  .hero-scrub-actions .btn-arrow { justify-content: center; }
  .hero-scrub-hint { top: 24px; right: 5vw; }

  /* Single-column cards have room — restore a bolder caption */
  .service-img figcaption { font-size: clamp(24px, 7vw, 34px); }

  /* Section padding */
  .services { padding: 100px 5vw 120px; }
  .principles { padding: 90px 5vw; }
  .showroom { padding: 90px 5vw; gap: 40px; }
  .stories { padding: 90px 5vw; }
  .contact { padding: 90px 5vw 60px; }
  .projects { padding: 80px 5vw 100px; }

  /* Stats grid: 2x2 -> single column on small phones */
  .stats-grid { grid-template-columns: 1fr; gap: 32px; }
  .stat { padding-top: 28px; gap: 16px; }
  .stat-value { font-size: clamp(56px, 16vw, 96px); }

  /* Reveal section overlays sit closer on phone */
  .reveal-overlay-left { top: 64px; }
  .reveal-overlay-right { bottom: 120px; }
  .reveal-title { font-size: clamp(22px, 7vw, 32px); }
  .reveal-overlay-right p { font-size: 14px; }

  /* Showroom grid: stack two-image collage vertically */
  .showroom-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Stories */
  .stories-head { flex-wrap: wrap; gap: 16px; margin-bottom: 40px; }
  .story blockquote { font-size: clamp(22px, 6vw, 32px); }
  .story-photo img { width: 140px; height: 168px; }
  .google-score { margin-top: 40px; justify-content: flex-start; }

  /* Project list rows on tiny phones */
  .project-name { font-size: clamp(20px, 6vw, 26px); }
  .project-tags { gap: 6px; }
  .tag { padding: 6px 12px; font-size: 10px; }

  /* Contact */
  .contact h2 { font-size: clamp(28px, 8vw, 40px); }
  .contact-info { gap: 22px; }
  .contact-info p { font-size: 16px; }

  /* Bottom-nav fits a phone */
  .bottom-nav { padding: 8px 10px; gap: 8px; }
  .nav-logo { height: 38px; padding: 0 10px; }
  .nav-logo img { height: 18px; }
  .nav-home { padding: 0 12px; font-size: 11px; }
  .nav-menu { width: 38px; height: 38px; }

  /* Section labels read smaller on phone */
  .eyebrow, .label, .pcard-label, .counter, .nav-home {
    font-size: 10px;
  }
}


/* === YRITYS — company text over image (added: client brief "kuva pohjalle teksti") === */
.yritys {
  position: relative;
  padding: 140px 6vw;
  background: var(--bg-dark);
  color: #fff;
  overflow: hidden;
}
.yritys-bg { position: absolute; inset: 0; }
.yritys-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .28;
  filter: grayscale(100%) contrast(1.05);
}
.yritys::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,15,15,.55) 0%, rgba(15,15,15,.82) 100%);
}
.yritys-inner {
  position: relative; z-index: 2;
  max-width: 1400px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 80px;
  align-items: start;
}
.yritys-eyebrow { grid-column: 1 / -1; display: block; color: rgba(255,255,255,.65); margin-bottom: 32px; }
.yritys-title {
  font-size: clamp(32px, 4.2vw, 62px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.yritys-body { display: flex; flex-direction: column; gap: 22px; }
.yritys-body p { color: rgba(255,255,255,.78); font-size: 16px; line-height: 1.7; max-width: 60ch; }
.yritys-body .btn-arrow { align-self: flex-start; margin-top: 10px; }

@media (max-width: 900px) {
  .yritys { padding: 90px 6vw; }
  .yritys-inner { grid-template-columns: 1fr; gap: 28px; }
  .yritys-eyebrow { margin-bottom: 16px; }
}

/* === FOOTER LOGO — large brand lockup (client request: "get it bigger somewhere") === */
.footer-logo {
  margin: 0 0 72px;
  padding: 0 0 56px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s ease, transform .8s ease;
}
.footer-logo.in-view { opacity: 1; transform: translateY(0); }
.footer-logo img {
  width: 100%;
  max-width: 620px;
  height: auto;
  margin-left: 0;
}
@media (max-width: 700px) {
  .footer-logo { margin-bottom: 48px; padding-bottom: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .footer-logo { opacity: 1; transform: none; transition: none; }
}

/* === YHTEYSTIEDOT page === */
.yhteys-hero { padding: 180px 6vw 80px; border-bottom: 1px solid var(--line); }
.yhteys-hero-inner { max-width: 1400px; margin: 0 auto; }
.yhteys-hero-title {
  font-size: clamp(44px, 8vw, 128px);
  font-weight: 300; line-height: .95; letter-spacing: -0.03em;
  margin: 28px 0 32px;
}
.yhteys-hero-lede { max-width: 62ch; font-size: 17px; line-height: 1.7; color: var(--ink-soft); }

.yhteys-people { padding: 90px 6vw; border-bottom: 1px solid var(--line); }
.yhteys-people-inner { max-width: 1400px; margin: 0 auto; }
.yhteys-people h2 {
  font-size: clamp(26px, 3vw, 40px); font-weight: 300;
  letter-spacing: -0.02em; margin: 24px 0 56px;
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.person { background: var(--bg); padding: 36px 32px; display: flex; flex-direction: column; gap: 10px; }
.person-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft);
}
.person-name { font-size: 21px; font-weight: 400; letter-spacing: -0.01em; }
.person a { font-size: 15px; color: var(--ink-soft); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; width: fit-content; }
.person a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.laskutus { padding: 90px 6vw; border-bottom: 1px solid var(--line); background: var(--bg-dark); color: #fff; }
.laskutus-inner { max-width: 1400px; margin: 0 auto; }
.laskutus h2 { font-size: clamp(26px, 3vw, 40px); font-weight: 300; letter-spacing: -0.02em; margin: 24px 0 48px; }
.laskutus .eyebrow { color: rgba(255,255,255,.6); }
.laskutus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px 56px;
}
.laskutus-item .label { display: block; color: rgba(255,255,255,.5); margin-bottom: 10px; }
.laskutus-item p { font-size: 17px; color: #fff; line-height: 1.55; }
.laskutus-item p.todo { color: #d9a441; }
.laskutus-note { margin-top: 48px; font-size: 14px; color: rgba(255,255,255,.55); max-width: 60ch; line-height: 1.65; }

.yhteys-map { padding: 0; border-bottom: 1px solid var(--line); }
.yhteys-map iframe { display: block; width: 100%; height: 460px; border: 0; filter: grayscale(100%) contrast(1.05); }

.rekry { padding: 90px 6vw; border-bottom: 1px solid var(--line); }
.rekry-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 32px; align-items: end; justify-content: space-between; }
.rekry h2 { font-size: clamp(24px, 2.6vw, 36px); font-weight: 300; letter-spacing: -0.02em; margin-top: 20px; max-width: 22ch; }

@media (max-width: 700px) {
  .yhteys-hero { padding: 130px 6vw 60px; }
  .yhteys-people, .laskutus, .rekry { padding: 64px 6vw; }
  .yhteys-map iframe { height: 320px; }
}

/* Project card caption line (referenssit) */
.project-card-desc {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 34ch;
}
