:root {
  --navy: #1f2e3d;
  --navy-deep: #16212c;
  --blue: #5b7c93;
  --pale: #a8c2cd;
  --ink: #1c1c1c;
  --ink-soft: #5c5f63;
  --paper: #ffffff;
  --paper-alt: #f4f6f7;
  --line: #e2e6e8;
  --max: 1280px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: "Montserrat", -apple-system, sans-serif;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--navy);
}

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 40px; }
@media (max-width: 640px) { .wrap { padding: 0 24px; } }

/* ===== Loader ===== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .8s cubic-bezier(.4,0,.2,1), visibility .8s;
}
#loader.loader-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#loader .loader-mark {
  width: 130px;
  height: auto;
  margin-bottom: 34px;
  animation: loader-pulse 1.8s ease-in-out infinite;
}
#loader .loader-count {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--blue);
}
#loader .loader-bar {
  width: 220px; height: 1px;
  background: rgba(31,46,61,0.12);
  margin-top: 22px; overflow: hidden;
}
#loader .loader-bar-fill {
  height: 100%; width: 0%;
  background: var(--navy);
  transition: width .12s linear;
}
@keyframes loader-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.94); opacity: 0.7; }
}
body.loading { overflow: hidden; }

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1s cubic-bezier(.22,1,.36,1), transform 1s cubic-bezier(.22,1,.36,1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .12s; }
.reveal.d2 { transition-delay: .24s; }
.reveal.d3 { transition-delay: .36s; }
.reveal.d4 { transition-delay: .48s; }

/* ===== Header ===== */
header.site {
  position: fixed;
  top: 34px; left: 0; right: 0;
  z-index: 100;
  transition: background .45s ease, box-shadow .45s ease, padding .45s ease;
  padding: 10px 0;
}
header.site.over-hero {
  background: transparent;
}
header.site.over-hero .logo { color: #fff; }
header.site.over-hero .logo img { filter: brightness(0) invert(1); }
header.site.over-hero nav.links a { color: rgba(255,255,255,0.82); }
header.site.over-hero nav.links a:hover,
header.site.over-hero nav.links a.active { color: #fff; border-color: #fff; }
header.site.over-hero .menu-btn { color: #fff; }

header.site.solid {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}

.nav-row {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
@media (max-width: 640px) { .nav-row { padding: 14px 24px; } }

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: "Montserrat", sans-serif;
  font-size: 22px;
  letter-spacing: 0.24em;
  font-weight: 400;
  color: var(--navy);
  transition: color .45s ease;
}
.logo img { height: 52px; width: auto; transition: filter .45s ease, height .45s ease; }
@media (max-width: 640px) {
  .logo { font-size: 17px; letter-spacing: 0.18em; gap: 10px; }
  .logo img { height: 40px; }
}

nav.links {
  display: flex;
  gap: 38px;
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
nav.links a {
  color: var(--ink-soft);
  padding-bottom: 5px;
  border-bottom: 1px solid transparent;
  transition: color .3s, border-color .3s;
}
nav.links a:hover, nav.links a.active { color: var(--navy); border-color: var(--blue); }

.menu-btn { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--navy); transition: color .45s; }

@media (max-width: 880px) {
  nav.links {
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(255,255,255,0.98); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    flex-direction: column; gap: 0; display: none;
  }
  nav.links.open { display: flex; }
  nav.links a { padding: 18px 32px; border-bottom: 1px solid var(--line); color: var(--ink-soft) !important; }
  .menu-btn { display: block; }
}

/* ===== Cinematic hero ===== */
.hero-cine {
  position: relative;
  height: 100vh;
  min-height: 620px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--navy-deep);
}
.hero-cine .hero-media {
  position: absolute; inset: 0;
  overflow: hidden;
}
.hero-cine .hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: kenburns 22s ease-out forwards;
  will-change: transform;
}
@keyframes kenburns {
  0%   { transform: scale(1.14) translate3d(1%, 1%, 0); }
  100% { transform: scale(1) translate3d(0, 0, 0); }
}
.hero-cine .hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,17,24,0.62) 0%, rgba(10,17,24,0.28) 30%, rgba(10,17,24,0.72) 70%, rgba(10,17,24,0.92) 100%),
    linear-gradient(90deg, rgba(10,17,24,0.72) 0%, rgba(10,17,24,0.30) 45%, rgba(10,17,24,0) 78%);
}
.hero-cine .hero-inner {
  position: relative;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 130px 40px 96px;
  color: #fff;
}
@media (max-width: 640px) { .hero-cine .hero-inner { padding: 0 24px 70px; } }

.hero-cine .eyebrow { color: rgba(255,255,255,0.72); }
.hero-cine h1 {
  color: #fff;
  font-size: clamp(34px, 5.4vw, 68px);
  line-height: 1.05;
  font-weight: 200;
  max-width: 15ch;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 30px rgba(0,0,0,0.35);
}
.hero-cine p.lead {
  color: rgba(255,255,255,0.9);
  font-size: clamp(15px, 1.4vw, 18px);
  max-width: 48ch;
  margin-top: 20px;
  font-weight: 300;
  text-shadow: 0 1px 18px rgba(0,0,0,0.4);
}
.hero-cine .cta-row { margin-top: 32px; }
.hero-cine .eyebrow { text-shadow: 0 1px 14px rgba(0,0,0,0.5); margin-bottom: 18px; }
.hero-cine .btn-outline { border-color: rgba(255,255,255,0.7); color: #fff; }
.hero-cine .btn-outline:hover { background: #fff; color: var(--navy); border-color: #fff; }
.hero-cine .btn-primary { background: #fff; color: var(--navy); }
.hero-cine .btn-primary:hover { background: var(--pale); color: var(--navy); }

.scroll-hint {
  position: absolute;
  bottom: 34px; right: 40px;
  color: rgba(255,255,255,0.7);
  font-family: "Montserrat", sans-serif;
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
}
.scroll-hint::after {
  content: ""; width: 1px; height: 44px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), transparent);
  animation: hint 2.2s ease-in-out infinite;
}
@keyframes hint { 0%,100% { opacity: .35; transform: scaleY(.6); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } }
@media (max-width: 880px) { .scroll-hint { display: none; } }

/* Interior page hero */
.hero {
  padding: 190px 0 90px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 11px;
  color: var(--blue);
  font-weight: 600;
  font-family: "Montserrat", sans-serif;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(36px, 5.6vw, 68px);
  line-height: 1.06;
  max-width: 17ch;
  font-weight: 200;
  letter-spacing: -0.025em;
}
.hero p.lead { font-size: 18px; color: var(--ink-soft); max-width: 50ch; margin-top: 24px; font-weight: 300; }

.cta-row { display: flex; gap: 16px; margin-top: 40px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 16px 36px;
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 0;
  transition: all .35s cubic-bezier(.4,0,.2,1);
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--blue); transform: translateY(-2px); }
.btn-outline { border: 1px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; transform: translateY(-2px); }

/* ===== Sections ===== */
section { padding: 120px 0; }
section.alt { background: var(--paper-alt); }
section.dark { background: var(--navy-deep); color: rgba(255,255,255,0.78); }
section.dark h2, section.dark h3, section.dark h4 { color: #fff; }
section.dark .eyebrow { color: var(--pale); }
section.dark .card { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); }
section.dark .stat { color: #fff; }
section.dark .stat-label { color: rgba(255,255,255,0.6); }
section.tight { padding: 80px 0; }

.section-head { margin-bottom: 60px; max-width: 62ch; }
.section-head h2 { font-size: clamp(28px, 4vw, 46px); font-weight: 200; line-height: 1.12; }
.section-head p { color: var(--ink-soft); font-size: 17px; margin-top: 18px; font-weight: 300; }
section.dark .section-head p { color: rgba(255,255,255,0.66); }

.grid { display: grid; gap: 36px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--paper); border: 1px solid var(--line); padding: 40px 34px; transition: transform .4s, box-shadow .4s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 20px 50px -28px rgba(31,46,61,0.35); }

.stat { font-family: "Montserrat", sans-serif; font-size: 54px; font-weight: 200; color: var(--navy); margin-bottom: 8px; letter-spacing: -0.03em; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-soft); font-family: "Montserrat", sans-serif; }

/* ===== Cinematic project rows ===== */
.cine-row {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--navy-deep);
}
.cine-row .cine-media { position: absolute; inset: 0; }
.cine-row .cine-media img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.06);
  transition: transform 1.6s cubic-bezier(.22,1,.36,1);
}
.cine-row:hover .cine-media img { transform: scale(1); }
.cine-row .cine-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10,17,24,0.92) 0%, rgba(10,17,24,0.58) 50%, rgba(10,17,24,0.18) 100%);
}
.cine-row.flip .cine-scrim {
  background: linear-gradient(270deg, rgba(10,17,24,0.92) 0%, rgba(10,17,24,0.58) 50%, rgba(10,17,24,0.18) 100%);
}
.cine-row .cine-inner {
  position: relative;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 90px 40px;
  color: #fff;
}
.cine-row.flip .cine-inner { display: flex; justify-content: flex-end; }
.cine-row .cine-copy { max-width: 46ch; }
.cine-row .cine-index {
  font-family: "Montserrat", sans-serif;
  font-size: 12px; letter-spacing: 0.3em;
  color: var(--pale); margin-bottom: 18px;
}
.cine-row h3 {
  color: #fff; font-size: clamp(26px, 3.4vw, 44px);
  font-weight: 200; line-height: 1.1; letter-spacing: -0.02em;
}
.cine-row .cine-meta {
  display: flex; gap: 34px; flex-wrap: wrap;
  margin: 22px 0 18px;
  font-size: 13px; color: rgba(255,255,255,0.82);
}
.cine-row .cine-meta div span {
  display: block; font-family: "Montserrat", sans-serif;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--pale); margin-bottom: 4px;
}
.cine-row p { color: rgba(255,255,255,0.8); font-weight: 300; }
@media (max-width: 780px) {
  .cine-row .cine-scrim,
  .cine-row.flip .cine-scrim { background: linear-gradient(180deg, rgba(12,20,28,0.4), rgba(12,20,28,0.9)); }
  .cine-row.flip .cine-inner { justify-content: flex-start; }
  .cine-row { min-height: 68vh; }
  .cine-row .cine-inner { padding: 70px 24px; }
}

/* ===== Portfolio grid cards ===== */
.proj-card { display: block; position: relative; overflow: hidden; background: var(--navy); }
.proj-card img { width: 100%; height: 380px; object-fit: cover; opacity: 0.92; transition: transform .9s cubic-bezier(.22,1,.36,1), opacity .5s; }
.proj-card:hover img { transform: scale(1.07); opacity: 1; }
.proj-info {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 30px 28px;
  background: linear-gradient(180deg, transparent, rgba(12,20,28,0.88));
  color: #fff;
}
.proj-info .tag { font-family: "Montserrat", sans-serif; font-size: 10px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--pale); }
.proj-info h3 { color: #fff; font-size: 20px; margin-top: 8px; font-weight: 300; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }
.filters button {
  padding: 10px 22px; border: 1px solid var(--line); background: transparent;
  font-family: "Montserrat", sans-serif; font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em; cursor: pointer;
  border-radius: 0; color: var(--ink-soft); transition: all .3s;
}
.filters button:hover { border-color: var(--navy); color: var(--navy); }
.filters button.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.proj-detail {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 60px;
  padding: 70px 0; border-bottom: 1px solid var(--line); align-items: start;
}
.proj-detail:last-child { border-bottom: none; }
@media (max-width: 900px) { .proj-detail { grid-template-columns: 1fr; gap: 32px; } }
.proj-meta { display: flex; gap: 36px; margin: 22px 0 22px; font-size: 13px; flex-wrap: wrap; }
.proj-meta div span { display: block; text-transform: uppercase; letter-spacing: 0.16em; color: var(--blue); font-family: "Montserrat", sans-serif; font-size: 10px; margin-bottom: 4px; }
.proj-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.proj-thumbs img { height: 100px; object-fit: cover; transition: opacity .3s; }
.proj-thumbs img:hover { opacity: .78; }

/* ===== Timeline ===== */
.timeline { border-left: 1px solid var(--line); padding-left: 40px; }
.timeline .item { margin-bottom: 48px; position: relative; }
.timeline .item::before {
  content: ""; position: absolute; left: -45px; top: 8px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--blue);
  box-shadow: 0 0 0 5px rgba(91,124,147,0.14);
}
.timeline .item h4 { margin-bottom: 10px; font-size: 20px; font-weight: 400; }
.timeline .item p { color: var(--ink-soft); font-weight: 300; }

/* ===== Steps ===== */
.steps { counter-reset: step; }
.step { display: flex; gap: 26px; padding: 28px 0; border-top: 1px solid var(--line); }
.step:last-child { border-bottom: 1px solid var(--line); }
.step .num { font-family: "Montserrat", sans-serif; font-size: 22px; font-weight: 200; color: var(--blue); min-width: 46px; }
section.dark .step { border-color: rgba(255,255,255,0.14); }
section.dark .step .num { color: var(--pale); }
section.dark .step p { color: rgba(255,255,255,0.7); }

/* ===== News ===== */
.news-card { border-bottom: 1px solid var(--line); padding: 36px 0; }
.news-date { font-family: "Montserrat", sans-serif; font-size: 11px; color: var(--blue); text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600; }

/* ===== Contact ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 44px; } }
form.contact-form input, form.contact-form textarea {
  width: 100%; padding: 16px 18px; border: 1px solid var(--line);
  background: var(--paper); font-family: inherit; font-size: 15px; margin-bottom: 18px;
  transition: border-color .3s;
}
form.contact-form input:focus, form.contact-form textarea:focus { outline: none; border-color: var(--blue); }
form.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-item { margin-bottom: 26px; }
.contact-item .label { font-family: "Montserrat", sans-serif; font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--blue); margin-bottom: 6px; }
.contact-item .value { font-size: 19px; font-weight: 300; }

/* ===== Footer ===== */
footer.site { background: var(--navy-deep); color: #97a8b4; padding: 70px 0 30px; }
footer.site .foot-row {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px;
  padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
footer.site a { color: #97a8b4; transition: color .3s; }
footer.site a:hover { color: #fff; }
footer.site .logo { color: #fff; }
footer.site .logo img { filter: brightness(0) invert(1); height: 46px; }
footer.site .fine {
  padding-top: 28px; display: flex; justify-content: space-between;
  font-family: "Montserrat", sans-serif; font-size: 11px; letter-spacing: 0.08em;
  color: #64798a; flex-wrap: wrap; gap: 10px;
}

.beta-flag {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--navy-deep); color: rgba(255,255,255,0.75); text-align: center;
  font-family: "Montserrat", sans-serif; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 9px 16px; line-height: 1.4;
  z-index: 130;
}

/* stagger children inside grids */
.grid > .reveal:nth-child(2) { transition-delay: .10s; }
.grid > .reveal:nth-child(3) { transition-delay: .20s; }
.grid > .reveal:nth-child(4) { transition-delay: .06s; }
.grid > .reveal:nth-child(5) { transition-delay: .16s; }
.grid > .reveal:nth-child(6) { transition-delay: .26s; }
