/* ═══════════════════════════════════════════════════════
   KREUPAS CONSTRUCTION — Global Design System
   ═══════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --ink: #171512;
  --paper: #f4f0e8;
  --paper-2: #e8e1d5;
  --stone: #b9aea0;
  --moss: #58694f;
  --clay: #9c6248;
  --clay-light: #c4865e;
  --gold: #d4a76a;
  --steel: #253039;
  --night: #0d1114;
  --line: rgba(23, 21, 18, .16);
  --line-light: rgba(244, 240, 232, .22);
  --shadow: 0 24px 80px rgba(13, 17, 20, .24);
  --shadow-sm: 0 8px 32px rgba(13, 17, 20, .12);
  --serif: "Montserrat", sans-serif;
  --sans: "Inter", system-ui, sans-serif;
  --max: 1440px;
  --gutter: clamp(16px, 3vw, 40px);
  --section-y: clamp(72px, 10vw, 130px);
  --radius: 4px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-elastic: cubic-bezier(.68, -.55, .265, 1.55);
  --loader-font: var(--sans);
  --loader-color: #ffffff;
  --loader-color-muted: rgba(255, 255, 255, 0.18);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
  min-width: 320px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
::selection { background: var(--clay); color: #fff; }
.split-text {
  overflow: visible;
  display: block;
}
.split-line {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.split-line > span {
  display: inline-block;
  will-change: transform;
}

/* ── Premium Typographic Loader ── */
.page-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: #0d1114;
  transition: transform 1s cubic-bezier(0.85, 0, 0.15, 1);
}
.loader-hiding .page-loader {
  transform: translateY(-100%);
}
.page-loader.hidden {
  display: none;
}
.loader-svg { width: 1400px; height: 200px; max-width: 95vw; }
.loader-text {
  font-family: var(--loader-font); font-size: 72px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  fill: var(--loader-color);
  stroke-dasharray: 2500; stroke-dashoffset: 2500;
}
.loader-text--bg {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1px;
  opacity: 0.35;
  animation: drawText 3s ease forwards;
}
.loader-text--fg {
  stroke: var(--loader-color);
  stroke-width: 1.5px;
  animation: drawText 2.5s 0.2s ease forwards, fillText 0.8s 2.5s ease forwards;
}
@keyframes drawText { 100% { stroke-dashoffset: 0; } }
@keyframes fillText { 100% { fill: var(--loader-color); stroke-width: 0; } }

/* ── Scroll Progress ── */
.progress { position: fixed; top: 0; left: 0; width: 0; height: 3px; background: linear-gradient(90deg, var(--clay), var(--gold)); z-index: 200; }

/* ── Custom Cursor ── */
.cursor {
  position: fixed; top: -20px; left: -20px;
  width: 40px; height: 40px;
  border: 1.5px solid rgba(244, 240, 232, .6);
  border-radius: 50%;
  pointer-events: none;
  transform: translate3d(-100px, -100px, 0);
  mix-blend-mode: difference;
  z-index: 201;
  transition: width .3s ease, height .3s ease, border-color .3s ease;
}
@media (max-width: 768px) { .cursor { display: none; } }

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 48px;
  background: #0d1114;
  box-shadow: 0 4px 30px rgba(0,0,0,0.35);
  transition: padding .3s ease, box-shadow .3s ease, background .3s ease;
}
.site-header.scrolled {
  padding: 8px 48px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
@media (max-width: 900px) {
  .site-header { 
    padding: 12px 20px; 
    background: rgba(13, 17, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    box-shadow: none;
  }
  .site-header.scrolled { 
    padding: 8px 20px; 
    background: rgba(13, 17, 20, 0.95);
  }
}

/* ── Brand / Logo ── */
.brand { display: flex; align-items: center; z-index: 10001; position: relative; }
.brand__logo { 
  height: 50px; 
  width: auto; 
  display: block; 
  border-radius: 0; 
  border: none; 
  object-fit: contain; 
}
@media (max-width: 900px) { 
  .brand__logo { 
    height: 40px; 
    width: 40px; 
    object-fit: cover; 
    border-radius: 50%; 
    border: 1.5px solid rgba(212, 167, 106, 0.5);
  } 
}

/* ── Desktop Nav ── */
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 18px;
  font-size: 14px; font-weight: 600; letter-spacing: .03em;
  color: rgba(255,255,255,0.8);
  border-radius: 100px;
  transition: color .25s ease, background .25s ease;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav a.active { color: var(--gold); }

/* ── Mobile Menu Overlay: Pure Black Full Screen ── */
@media (max-width: 900px) {
  .nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
  }
  .nav.active { display: block; }
  
  /* Hide desktop links when mobile nav is active */
  .nav > a { display: none !important; }
  
  .mobile-nav-overlay {
    position: absolute;
    inset: 0;
    background: #000000;
    opacity: 0;
  }
  
  .mobile-nav-bg { display: none; }

  /* Full screen black dropdown */
  .mobile-nav-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000 !important;
    display: flex;
    flex-direction: column;
    padding: 100px 32px 40px;
    z-index: 2;
    transform: translateX(100%);
  }

  .mobile-nav-links {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    flex: 1;
  }

  .mobile-nav-links a {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--serif);
    text-transform: uppercase;
    color: #ffffff !important;
    padding: 12px 0;
    border: none !important;
    transition: color 0.3s ease;
    text-align: left;
    display: block;
    width: 100%;
  }
  
  .mobile-nav-links a.active,
  .mobile-nav-links a:hover {
    color: var(--gold) !important;
    background: transparent !important;
  }

  .mobile-nav-footer {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: auto;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .mobile-nav-footer-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .mobile-nav-footer-col span {
    font-size: 11px;
    font-weight: 800;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.15em;
  }

  .mobile-nav-footer-col a {
    font-size: 15px;
    font-weight: 600;
    color: #fff !important;
    padding: 0;
    border: none;
    font-family: var(--sans);
    text-transform: none;
  }
}

/* Always hide mobile nav specific elements on desktop */
@media (min-width: 901px) {
  .mobile-nav-overlay { display: none !important; }
}




/* ── CTA Button ── */
.header-cta {
  display: inline-flex; align-items: center;
  padding: 10px 24px; border-radius: 100px;
  background: linear-gradient(135deg, var(--gold), var(--clay));
  color: #fff; font-size: 14px; font-weight: 700;
  letter-spacing: .02em; white-space: nowrap;
  transition: transform .3s ease, box-shadow .3s ease;
}
.header-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(156,98,72,.3); }
@media (max-width: 900px) { .header-cta { display: none; } }

/* ── Hamburger Toggle ── */
.menu-toggle {
  display: none; flex-direction: column; gap: 5px;
  padding: 10px;
  z-index: 10001;
  position: relative;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.menu-toggle span {
  width: 20px; height: 2px;
  background: #fff;
  display: block;
  transition: transform .3s ease, opacity .3s ease;
}
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }
@media (max-width: 900px) { .menu-toggle { display: flex; } }

/* ── Footer ── */
.footer {
  background: var(--night); color: var(--paper);
  border-top: 1px solid var(--line-light);
}
.footer__inner {
  max-width: var(--max); margin: 0 auto;
  padding: 80px var(--gutter) 32px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 48px;
}
@media (max-width: 900px) { .footer__inner { grid-template-columns: 1fr 1fr; gap: 36px; } }
@media (max-width: 560px) { .footer__inner { grid-template-columns: 1fr; gap: 32px; } }

.footer__brand { font-family: var(--serif); font-size: 24px; margin-bottom: 16px; }
.footer__desc { color: rgba(244,240,232,.6); font-size: 14px; line-height: 1.7; max-width: 320px; }
.footer__title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); margin-bottom: 20px; }
.footer__links a { display: block; padding: 6px 0; color: rgba(244,240,232,.65); font-size: 14px; transition: color .3s, padding-left .3s; }
.footer__links a:hover { color: #fff; padding-left: 8px; }
.footer__contact-item { display: flex; gap: 10px; margin-bottom: 14px; color: rgba(244,240,232,.65); font-size: 14px; align-items: flex-start; }
.footer__contact-item svg { flex-shrink: 0; margin-top: 2px; }
.footer__bottom {
  max-width: var(--max); margin: 0 auto;
  padding: 20px var(--gutter);
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: rgba(244,240,232,.45);
}
.footer__social { display: flex; gap: 16px; }
.footer__social a {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.12); border-radius: 50%;
  color: rgba(244,240,232,.6); transition: all .3s ease;
}
.footer__social a:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
@media (max-width: 560px) { .footer__bottom { flex-direction: column; gap: 12px; text-align: center; } }

/* ── Section Utilities ── */
.section { max-width: var(--max); margin: 0 auto; padding: var(--section-y) var(--gutter); }
.section__kicker {
  display: inline-block;
  margin-bottom: 16px; color: var(--clay);
  font-size: 12px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
}
.section__heading { margin-bottom: 48px; }
.section__heading h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 5.5vw, 72px);
  line-height: 1.1; max-width: 800px;
}
.section__heading p { max-width: 560px; margin-top: 16px; color: rgba(23,21,18,.6); font-size: 17px; line-height: 1.7; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 32px;
  font-size: 14px; font-weight: 700; letter-spacing: .04em;
  transition: all .35s var(--ease-out);
  position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  transform: translateX(-101%);
  transition: transform .4s var(--ease-out);
}
.btn:hover::before { transform: translateX(0); }
.btn span { position: relative; z-index: 1; }
.btn svg { position: relative; z-index: 1; transition: transform .3s ease; }
.btn:hover svg { transform: translateX(4px); }

.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary::before { background: var(--clay); }
.btn--primary:hover { color: #fff; }

.btn--outline { border: 1.5px solid var(--ink); color: var(--ink); background: transparent; }
.btn--outline::before { background: var(--ink); }
.btn--outline:hover { color: var(--paper); }

.btn--light { background: var(--paper); color: var(--night); }
.btn--light::before { background: var(--gold); }
.btn--light:hover { color: #fff; }

.circle-link {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 140px; aspect-ratio: 1;
  border: 1.5px solid rgba(255,255,255,.3); border-radius: 50%;
  font-size: 13px; font-weight: 700;
  transition: all .4s var(--ease-out);
}
.circle-link:hover { background: var(--paper); color: var(--night); border-color: var(--paper); }

/* ── Ticker ── */
.ticker {
  overflow: hidden; width: 100%;
  background: var(--steel);
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ticker__track {
  display: flex; width: max-content; gap: 40px;
  padding: 18px var(--gutter);
  animation: ticker 30s linear infinite;
}
.ticker__track span {
  font-family: var(--serif); font-size: clamp(20px, 3vw, 42px);
  color: var(--paper); white-space: nowrap; opacity: .8;
}
.ticker__track span::after { content: ' ✦'; color: var(--gold); font-size: .6em; margin-left: 12px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ── Animation Base States ── */
[data-animate], .split-text { opacity: 0; visibility: hidden; }
.gsap-ready [data-animate], .gsap-ready .split-text { opacity: 1; visibility: visible; }
.split-line { display: inline-block; overflow: hidden; vertical-align: top; }
.split-line > span { display: inline-block; }

/* ── Mobile Safety: Force all content visible ── */
@media (max-width: 900px) {
  [data-animate], .split-text { opacity: 1 !important; visibility: visible !important; }
  .split-line > span { transform: none !important; }
  .portfolio-filters { opacity: 1 !important; visibility: visible !important; }
  .portfolio-item { opacity: 1 !important; visibility: visible !important; transform: none !important; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .cursor { display: none; }
  [data-animate], .split-text { opacity: 1; }
}
