/* ===================================================================
   main.css — patched: prevent horizontal scrolling on mobile
   =================================================================== */

/* Theme variables */
:root {
  --ink: #fff;
  --bg: linear-gradient(135deg, #000428, #004e92);
  --muted: #bdbdbd;
}

/* Basic layout */
/* Prevent any accidental horizontal overflow at the root */
html, body {
  max-width: 100vw;     /* clamp layout to viewport width */
  /* overflow-x: hidden;    */
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Poppins", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
  /* keep overflow-x hidden here too as a belt+braces */
  overflow-x: hidden;
}

/* Brand logo */
.brand-logo {
  position: fixed;
  top: 20px;      /* adjust to align visually */
  left: 30px;
  z-index: 1200;
}

.brand-logo img {
  height: 50px;   /* adjust logo size */
  width: auto;
  display: block;
}

.menu-wrap {
  display: none !important;
}


/* ===== Top-right Menu ===== */
.menu-wrap {
  position: fixed;
  top: 50px;
  right: 30px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  user-select: none;
  /* avoid overflow from large menu text */
  max-width: calc(100vw - 60px);
}

.menu-btn {
  width: auto;
  height: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: none;
}
.menu-btn:hover { transform: none; border: none; }

/* Menu label */
.menu-text {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hamburger icon */
.icon {
  width: 22px;
  height: 12px;
  position: relative;
}
.icon span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}
.icon .l1 { top: 2px; }
.icon .l2 { display: none; }
.icon .l3 { top: 8px; }

body.menu-open .icon .l1 {
  top: 5.5px;
  transform: rotate(45deg);
}
body.menu-open .icon .l3 {
  top: 5.5px;
  transform: rotate(-45deg);
}

/* ===== Fullscreen Center Overlay (menu) ===== */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s;
  /* avoid tiny horizontal overflow inside overlay */
  overflow-x: hidden;
}
body.menu-open .menu-overlay {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

/* Scope Six Caps font ONLY to menu and hero (do not use !important) */
.menu-list,
.menu-list a,
.menu-list a > span,
.menu-list a::before,
.hero-title {
  font-family: "Six Caps", sans-serif;
  font-weight: 400;
  letter-spacing: 0.1em;
}

/* Menu visual and roll-hover (unchanged but scoped) */
.menu-list {
  text-align: center;
  padding: 0 1rem;
  /* ensure long text wraps instead of overflowing */
  word-break: break-word;
  overflow-wrap: break-word;
}
.menu-list a {
  position: relative;
  display: block;
  text-decoration: none;
  color: #fff;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 1.05;
  overflow: hidden;
  letter-spacing: 0.1em;
  white-space: normal; /* allow wrapping rather than forcing one long line */
}
.menu-list a + a { margin-top: 0.35em; }
.menu-list a > span {
  display: block;
  transform: translateY(0%);
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.menu-list a::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  text-align: center;
  color: #fff;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.45s ease;
  transform: translateY(0%);
  will-change: transform, opacity;
}
.menu-list a { opacity: 0.9; }
.menu-list a:hover { opacity: 1; }
.menu-list a:hover > span { transform: translateY(-100%); }
.menu-list a:hover::before { transform: translateY(-100%); }

/* ===== Hero / demo sections ===== */
.hero {
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: center;  /* center vertically */
  padding-top: 0;       /* remove top push */
  border-bottom: 1px solid rgba(255,255,255,0.08);
  max-width: 100vw;
  overflow: hidden;     /* <-- updated */
  box-sizing: border-box;
}


/* Hero title uses Six Caps but remains scoped to .hero-title only */
.hero-title {
  font-family: 'Kaiju', sans-serif;
  font-weight: 400;      /* Kaiju ignores this, but keep for safety */
  font-size: 12vw;
  line-height: 1;
  letter-spacing: 0.08em;
  color: #e9e9e9;
  transform: scaleX(0.80);   /* squeeze width → looks thinner */
  display: inline-block;     /* required for transform to work */
}

.hero-content {
  text-align: center;
}

/* ===== HERO IMAGE REVEAL (pop-in zoom) ===== */
.hero-image {
  max-width: 80%;
  height: auto;
  display: block;
  margin: 0 auto;

  opacity: 0;               /* start invisible */
  transform: scale(0);      /* start small */
  transition: transform 0.8s ease-out, opacity 0.6s ease-out;
}

.hero-image.in {
  opacity: 1;
  transform: scale(1.98); /* small zoom, doesn’t break layout */
  max-width: 300px;       /* keep logo size reasonable */
}



/* inside main.css, extend hero section */
.hero-content {
  text-align: center;
}

.hero-divider {
  width: 600px;
  border: none;
  border-top: 2px solid #fff;
  margin: 16px auto;
}

.hero-subtitle {
  font-family: "Poppins", sans-serif; /* you already load this */
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  color: #fff;
  margin: 0;
}


/* small accessibility: if user prefers reduced motion, skip animations */
@media (prefers-reduced-motion: reduce) {
  .hero-title__mask { transform: translateX(100%); transition: none; }
  .hero-title .char { transform: none; opacity: 1; transition: none; }
}


/* Restore sane defaults for site sections' headings:
   This prevents main.css from forcing Six Caps on all H2s */
/* Apply big section layout to content sections only, not footer */
main > section {
  min-height: 92svh;
  display: grid;
  place-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  max-width: 100vw;
}

/* Reset footer sections */
.site-footer-sssp section {
  min-height: auto;
  display: block;
  border: none;
}

section h2 {
  /* use Playfair Display for large headings (kept from fonts loaded in index.html) */
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  color: #fff;
  letter-spacing: 0.02em;
  margin: 0;
}

/* ===== Bottom Rail Navigation (mobile friendly, fixed) ===== */
.rail-nav {
  position: absolute;          /* IMPORTANT: make it stick to viewport bottom */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;            /* above other elements (brand/menu have 1200 too; adjust if needed) */
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* desktop fallback */
  background: linear-gradient(135deg, #000428, #004e92);
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  width: 100vw;             /* enforce exact viewport width */
  box-sizing: border-box;
  overflow: hidden;         /* clip any internal overflow */
  padding-bottom: env(safe-area-inset-bottom); /* handle iPhone bottom inset */
}

/* make each rail cell stable and not grow tall */
.rail-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;      /* tighter padding so 4 items occupy less height */
  min-height: 56px;        /* stable tap target */
  text-decoration: none;
  box-sizing: border-box;
  font-size: 15px;
}
.rail-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.rail-link + .rail-link { border-left: none; }
.rail-label { font-family: "Poppins", sans-serif; color: white; position: relative; z-index: 1; transition: transform 0.35s ease; }
.rail-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  color: #fff;
  opacity: 0;
  transform: translateX(-16px) scale(0.8);
  transition: opacity 0.35s ease, transform 0.35s ease;
  margin-left: 8px;
}
.rail-arrow { font-size: 16px; line-height: 1; }

.rail-link:hover { color: #fff; background: rgba(255,255,255,0.035); }
.rail-link:hover .rail-label { transform: translateX(-8px); }
.rail-link:hover .rail-circle { opacity: 1; transform: translateX(0) scale(1); }

/* === MOBILE NAV + HERO — keep heights unchanged, nudge second-row labels up === */
@media (max-width: 640px) {
  /* Hero */
  .hero {
    padding-top: 6vh;
    min-height: 75svh;
  }

  .hero-image.in {
    transform: scale(1.6);
    max-width: 180px;
  }

  /* NAV container: 2x2 grid, very tight row gap */
  .rail-nav {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(44px, auto);
    gap: 2px 0;                /* tightened vertical gap between rows */
    width: 100%;
    margin-top: 30px !important;
    background: linear-gradient(135deg, #000428, #004e92);
    padding: 4px 0;
    text-align: center;
    box-sizing: border-box;
  }

  /* NAV items — keep heights comfortable but slightly reduced */
  .rail-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    min-height: 66px;          /* tappable area preserved */
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.045);
    box-sizing: border-box;
    position: relative;        /* allows moving label without changing box size */
  }

  /* column separators */
  .rail-link:nth-child(odd) {
    border-right: 1px solid rgba(255,255,255,0.06);
  }
  .rail-link:nth-child(2n) {
    border-right: none;
  }
  .rail-link:last-child {
    border-bottom: none;
  }

  .rail-label {
    font-family: "Poppins", sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.4px;
    color: #fff;
    line-height: 1.1;
    display: inline-block;     /* transform affects text only */
    transition: transform 160ms ease;
    transform: translateY(0);
    -webkit-transform: translateY(0);
  }

  /* hide decorative circles on mobile */
  .rail-circle { display: none !important; }

  /* 
    Move the second-row labels slightly up (subtle), but move the first-row labels DOWN
    so the top row visually sits closer to the bottom row.
  */
  .rail-link:nth-child(n+3) .rail-label {
    transform: translateY(-2px);
    -webkit-transform: translateY(-2px);
  }

  /* target first two items (About Us / Services) — push their label down a bit */
  .rail-link:nth-child(-n+2) .rail-label {
    transform: translateY(6px);
    -webkit-transform: translateY(6px);
  }

  /* prevent horizontal scroll */
  html, body { max-width: 100vw; overflow-x: hidden; }

  /* keep main padding neutral */
  main { padding-bottom: 0; }
}






/* Small helpers & resets to avoid other global CSS breaking things */
* { box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg { max-width: 100%; height: auto; display: block; }

/* ===== HERO REVEAL (pop-in zoom) ===== */
.hero-title .char {
  display: inline-block;
  opacity: 0;
  transform: scale(0);   /* start completely shrunk */
  will-change: transform, opacity;
  transition: transform 0.6s ease-out, opacity 0.4s ease-out;
}

.hero-title .char.in {
  opacity: 1;
  transform: scale(1);   /* grows to normal size */
}



/* === Logo color switch on scroll === */
.brand-logo img {
  transition: filter 0.3s ease;
}

body.light-bg .brand-logo img {
  filter: invert(1) brightness(0.2); /* makes white logo appear dark */
}

/* End of patched main.css */
