/* CSS Reset & Optimization */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  overflow-x: hidden;
  position: relative;
}

body {
  margin: 0;
  font-family: serif;
  color: white;
  transition: color 0.3s ease;
  background: #d41e22;
}

/* LOGO */
.logo {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  transform-origin: center top;
  width: 420px;
  height: auto;
  color: white;
  transition:
    top 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  max-width: 420px;
}

/* SECTIONS */
.section {
  width: 100%;
  position: relative;
}

/* All red sections should be full height */
.section.red {
  min-height: 100vh;
  height: 100vh;
}

.red {
  background: #d41e22;
}

.white {
  background: white;
}

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  pointer-events: none;
  z-index: 9;
}

/* Add background when scrolled */
body.scrolled .navbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

/* Change link color when scrolled */
body.scrolled .nav-links a {
  color: #111;
}

/* NAV LINKS */
.nav-links {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 28px;
  pointer-events: auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.nav-links a {
  text-decoration: none;
  font-size: 15px;
  color: inherit;
  transition: opacity 0.2s ease;
}

.nav-links a:hover {
  opacity: 0.6;
}

/* HERO SECTION - Logo only */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* DEBUG OVERLAY */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../assets/grain1-optim.jpg");
  background-repeat: repeat;
  mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 10%,
    rgba(0,0,0,0) 55%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 50%,
    rgba(0,0,0,0) 85%
  );
  filter: blur(0px);
  opacity: 0.12;
  transition:
    opacity 0.4s ease,
    filter 0.4s ease,
    mask-position 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

/* MOTTO SECTION - Full height text section */
.motto-section {
  display: flex;
  align-items: center;
  justify-content: center;
}

.motto-block {
  max-width: 920px;
  text-align: center;
  padding: 0 20px;
}

.motto-line {
  font-size: 52px;
  line-height: 1.2;
  margin-bottom: 14px;
}

.motto-sub {
  margin-top: 28px;
  font-size: 22px;
  line-height: 1.6;
  opacity: 0.9;
}

/* SERVICES SECTION - White section after motto */
.services-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 48px;
  min-height: 100vh; /* Make it full height too */
  position: relative;
}

.services-layout {
  max-width: 1100px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
}

/* LEFT COLUMN */
.services-intro h2 {
  font-size: 44px;
  font-weight: 400;
  margin-bottom: 24px;
  color: #111;
}

.services-intro h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  background: #d41e22;
  margin-top: 16px;
}

.services-intro p {
  font-size: 20px;
  line-height: 1.6;
  color: #555;
  max-width: 420px;
}

/* RIGHT COLUMN */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.service-item h3 {
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 8px;
  color: #d41e22;
}

.service-item p {
  font-size: 17px;
  line-height: 1.6;
  color: #555;
}

.white {
  background: #fafafa;
  position: relative;
  z-index: 2;
}

.service-item {
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.service-item:last-child {
  border-bottom: none;
}

.transition-blur {
  position: absolute;
  top: -180px;
  left: 0;
  width: 100%;
  height: 180px;
  background: radial-gradient(
    ellipse at center,
    rgba(250,250,250,0.9) 0%,
    rgba(250,250,250,0.7) 40%,
    rgba(250,250,250,0.4) 65%,
    rgba(250,250,250,0.0) 100%
  );
  pointer-events: none;
  z-index: 3;
}

.section.white {
  position: relative;
  background: #fafafa;
}

/* RED → WHITE DISSOLVE - FIXED HEIGHT */
.dissolve-transition {
  position: absolute;
  top: -180px;
  left: 0;
  width: 100%;
  height: 180px;
  background: linear-gradient(
    to bottom,
    rgba(212, 30, 33, 0.0) 0%,
    rgba(212, 30, 33, 0.08) 12%,
    rgba(212, 30, 33, 0.16) 22%,
    rgba(212, 30, 33, 0.26) 32%,
    rgba(212, 30, 33, 0.36) 42%,
    rgba(220, 190, 190, 0.55) 55%,
    rgba(235, 225, 225, 0.75) 70%,
    rgba(245, 240, 240, 0.9) 85%,
    rgb(255, 252, 252) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* FOOTER - DESKTOP */
.site-footer {
  background-color: #ffffff;
  border-top: 2px solid #d41e22;
  padding: 80px 0 40px;
  color: #111;
  position: relative;
  z-index: 5;
  width: 100%;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 80px;
  padding: 0 48px;
}

.footer-col h3 {
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 16px;
  font-style: italic;
}

.footer-col h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #333;
}

.footer-col p,
.footer-col li {
  font-size: 16px;
  color: #555;
  line-height: 1.7;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 12px;
}

.footer-col a {
  text-decoration: none;
  color: #111;
  transition: opacity 0.3s ease;
}

.footer-col a:hover {
  opacity: 0.6;
}

.footer-motto {
  margin-bottom: 20px;
  font-size: 17px;
  color: #444;
  max-width: 280px;
}

.footer-meta {
  font-size: 15px;
  color: #777;
  margin-top: 8px;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */

/* Mobile: Responsive Logo */
.logo {
  width: min(420px, 85vw);
}

/* PHONE STYLES (max-width: 768px) */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  /* Fix Safari vh issues */
  .section.red {
    min-height: calc(var(--vh, 1vh) * 100);
    height: auto;
  }

  /* Logo mobile behavior */
  .logo {
    width: min(300px, 80vw);
  }
  
  body.scrolled .logo {
    top: 20px;
    left: 20px;
    transform: translateX(0) translateY(0);
    width: 100px;
  }
  
  /* Navbar mobile */
  .navbar {
    height: 70px;
  }
  
  .nav-links {
    right: 20px;
    gap: 20px;
  }
  
  .nav-links a {
    font-size: 14px;
    white-space: nowrap;
  }
  
  .nav-links a:hover {
    opacity: 0.6;
  }
  
  /* Adjust navbar to accommodate logo */
  body.scrolled .navbar {
    height: 80px;
  }
  
  /* Adjust nav links position when logo is in header */
  body.scrolled .nav-links {
    top: 25px;
    transform: translateY(0);
  }
  
  /* Mobile hero sections */
  .hero {
    overflow: hidden;
  }
  
  /* Mobile motto section */
  .motto-section {
    padding: 0 20px;
  }
  
  .motto-block {
    max-width: min(920px, 90vw);
  }
  
  .motto-line {
    font-size: clamp(32px, 8vw, 52px);
  }
  
  .motto-sub {
    font-size: clamp(18px, 4vw, 22px);
    margin-top: 20px;
    padding: 0 10px;
  }
  
  /* Mobile services section */
  .services-section {
    padding: 60px 20px;
    display: block;
    min-height: auto; /* Don't force full height on mobile */
  }
  
  .services-layout {
    display: block;
    max-width: 1100px;
    width: 100%;
  }
  
  .services-intro h2 {
    font-size: clamp(32px, 6vw, 44px);
    text-align: center;
    margin-bottom: 20px;
  }
  
  .services-intro h2::after {
    margin: 16px auto 0;
  }
  
  .services-intro p {
    font-size: clamp(16px, 4vw, 20px);
    max-width: 100%;
    text-align: center;
    margin: 0 auto 40px;
  }
  
  .services-list {
    gap: 30px;
  }
  
  .service-item {
    padding-bottom: 20px;
    margin-bottom: 30px;
    text-align: center;
  }
  
  .service-item h3 {
    font-size: clamp(18px, 4vw, 22px);
  }
  
  .service-item p {
    font-size: clamp(15px, 3.5vw, 17px);
  }
  
  .transition-blur {
    top: -150px;
    height: 150px;
  }
  
  .dissolve-transition {
    top: -150px;
    height: 150px;
  }
  
  /* Mobile footer */
  .site-footer {
    padding: 40px 20px 20px;
  }
  
  .footer-inner {
    display: block;
    padding: 0;
    gap: 40px;
  }
  
  .footer-col {
    text-align: center;
    margin-bottom: 40px;
  }
  
  .footer-col:last-child {
    margin-bottom: 0;
  }
  
  .footer-col h3 {
    font-size: 24px;
  }
  
  .footer-col h4 {
    font-size: 15px;
    margin-bottom: 20px;
  }
  
  .footer-col p,
  .footer-col li {
    font-size: 15px;
  }
  
  .footer-motto {
    margin: 0 auto 16px;
    text-align: center;
    max-width: 100%;
  }
  
  .footer-meta {
    font-size: 13px;
    text-align: center;
  }
  
  .footer-col ul {
    text-align: center;
  }
}

/* Very small phones (max-width: 360px) */
@media (max-width: 360px) {
  .logo {
    width: 280px;
  }
  
  body.scrolled .logo {
    width: 90px;
    left: 15px;
    top: 20px;
  }
  
  .nav-links {
    right: 15px;
    gap: 15px;
  }
  
  .nav-links a {
    font-size: 13px;
  }
  
  body.scrolled .nav-links {
    top: 30px;
  }
  
  .motto-line {
    font-size: 24px;
  }
  
  .motto-sub {
    font-size: 15px;
  }
  
  .services-intro h2 {
    font-size: 28px;
  }
  
  .services-intro p {
    font-size: 15px;
  }
  
  .footer-col h3 {
    font-size: 22px;
  }
}

/* Tablet (768px and up) - Desktop styles */
@media (min-width: 769px) {
  body.scrolled .logo {
    width: 300px;
  }
  
  /* Make services section full height on desktop */
  .services-section {
    min-height: 100vh;
  }
}

/* Landscape mode on phones */
@media (max-height: 500px) and (orientation: landscape) {
  .logo {
    width: 320px;
  }
  
  body.scrolled .logo {
    width: 100px;
    left: 15px;
    top: 15px;
  }
  
  .navbar {
    height: 60px;
  }
  
  /* Reduce section heights in landscape */
  .section.red,
  .services-section {
    min-height: 100vh;
    height: auto;
  }
  
  body.scrolled .nav-links {
    top: 25px;
  }
}

/* High DPI screens optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero::after {
    background-size: 200px 200px;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .logo {
    transition: none;
  }
}
/* PHONE STYLES (max-width: 768px) */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  /* Fix Safari vh issues using CSS custom property */
  .section.red {
    min-height: calc(var(--vh, 1vh) * 100);
    height: auto;
  }
  
  .hero {
    min-height: calc(var(--vh, 1vh) * 100);
    height: auto;
  }
  
  /* ... rest of your mobile styles ... */
}