/* ==========================================================================
   NCOAM TECHNOLOGIES SDN BHD — SINGLE-SCREEN LANDING PAGE
   --------------------------------------------------------------------------
   TABLE OF CONTENTS
   1.  Design tokens  ← change colours, images and fonts HERE
   2.  Base & scaling
   3.  Shared components (label, buttons, icons)
   4.  Header & navigation
   5.  Hero
   6.  Service cards
   7.  Stats bar
   8.  About section
   9.  Pop-up panels (About / Services / Vision / Benefits / Contact)
   10. Responsive (tablet & mobile)
   11. Reduced motion

   SIZE UNITS: on desktop, 1rem = 1/10 of a 1536px-wide design, and the whole
   page scales with the browser window so it always fits ONE screen.
   So "4.2rem" ≈ 42px on a 1536px-wide screen. On mobile 1rem = 10px.
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* ---- Brand colours (taken from the NCOAM logo) ---- */
  --navy:  #0b1730;   /* dark sections, nav bar, stats bar */
  --gold:  #f5b800;   /* primary accent, buttons */
  --gold2: #ffca2c;   /* button hover */
  --red:   #c8102e;   /* small accents (bullets, icons in panels) */
  --ink:   #131b2e;   /* main text */
  --muted: #5b667a;   /* secondary text */
  --soft:  #f4f6fa;   /* light grey backgrounds */
  --line:  #e3e8f0;   /* thin borders */

  /* ---- Images: to swap a picture, replace the file in /assets
          (or point to a new filename here). Paths are relative to THIS file. ---- */
  --img-hero:  url("../assets/ncoam_banner.png");      /* big photo behind the hero      */
  --img-hero-ext: url("../assets/hero-ext.png"); /* blurred filler to the LEFT of the hero photo (desktop only) */
  --img-about: url("../assets/about-skyline.jpg");    /* skyline in the About section   */

  /* ---- Which part of each photo is visible (x y). 0% = left/top, 100% = right/bottom ---- */
  --img-about-pos: 46% center;

  /* ---- Font ---- */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  color-scheme: light;
}


/* ==========================================================================
   2. BASE & SCALING
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  /* Scales the entire layout to the window so everything fits one screen.
     The 6.4px floor stops text becoming unreadably small on tiny windows. */
  font-size: max(6.4px, min(calc(100vw / 153.6), calc(100dvh / 102.4)));
  background: var(--navy);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    display: none;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: 3.2rem; font-weight: 800; }
.gold { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* The page is a 4-row grid: hero | cards | stats | about.
   The hero (1fr) absorbs any extra height; the others keep fixed sizes. */
.page {
  display: grid;
  grid-template-rows: 1fr auto auto 27rem;   /* ← 27rem = height of the About row */
  height: calc(100dvh - 4.4rem);   /* ← 4.4rem = footer height (section 8b) so the page still fits one screen */
  min-height: 88rem;
}


/* ==========================================================================
   3. SHARED COMPONENTS
   ========================================================================== */
/* Small uppercase label with a gold line in front ("ABOUT US") */
.label {
  display: flex; align-items: center; gap: 1.2rem;
  font-size: 1.15rem; font-weight: 600;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--muted);
}
.label::before { content: ""; width: 3.4rem; height: 2px; background: var(--gold); }

/* Icons: inline SVG sprite, sized by the parent's font-size */
.ic {
  width: 1em; height: 1em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 1.2rem;
  padding: 1.2rem 2.6rem; border-radius: .6rem;
  font: 600 1.5rem var(--font);
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn .ic { font-size: 1.15em; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold2); transform: translateY(-2px); box-shadow: 0 .8rem 2rem rgba(245,184,0,.35); }
.btn-line { background: rgba(255,255,255,.6); border-color: var(--navy); color: var(--navy); }
.btn-line:hover { background: var(--navy); color: #fff; }

/* Round icon badge used on cards and panels */
.bub {
  flex: none; width: 6.4rem; height: 6.4rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 3rem;
  background: #fdf3d4; color: var(--gold);
}


/* ==========================================================================
   4. HEADER & NAVIGATION
   ========================================================================== */
header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: 6.6rem; padding-top: env(safe-area-inset-top, 0);
}
/* Dark band behind the nav (starts ~1/3 across, like the design) */
header::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 33%, rgba(11,23,48,.88) 45%);
}
.bar {
  position: relative; height: 100%;
  display: flex; justify-content: flex-end; align-items: center;
  gap: 4.4rem; padding: 0 6.3rem 0 0;
}
nav { display: flex; gap: 4.6rem; height: 100%; }
nav a {
  position: relative; display: flex; align-items: center;
  color: #fff; font-size: 1.4rem; font-weight: 500; cursor: pointer;
}
/* Gold underline on hover / active link */
nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1.6rem;
  height: 2px; background: var(--gold);
  transform: scaleX(0); transition: transform .25s;
}
nav a:hover::after, nav a.on::after { transform: scaleX(1); }

.cta  { padding: 1.2rem 2rem; font-size: 1.45rem; gap: 1.1rem; }   /* "Get in Touch" */
.menu { display: none; }                                            /* hamburger: mobile only */


/* ==========================================================================
   5. HERO
   ========================================================================== */
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 0; background: #fff; }

/* Background photo + white fade on the left so the text stays readable */
.hero-img {
  position: absolute; inset: 0;
}
/* The sharp, fully visible photo: full height, uncropped, anchored to the right.
   The aspect-ratio (1942 / 809) must match your hero image; change it if you use another shape.
   Its left edge fades into the blurred backdrop below. */
.hero-photo {
  position: absolute; top: 0; bottom: 0; right: 0; aspect-ratio: 1942 / 809;
  background: var(--img-hero) center / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%);
          mask-image: linear-gradient(90deg, transparent 0, #000 16%);
}

/* Blurred extension image: fills the empty space to the left of the hero photo so the two look
   connected. Hidden on tablet & phone (see section 10). Change the blur amount below. */
.hero-img::after {
  content: ""; position: absolute; inset: -3rem; z-index: -1;
  background: var(--img-hero-ext) center / cover no-repeat;
  filter: blur(1.8rem);
}
.hero-img::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.9) 0, rgba(255,255,255,.72) 26%, rgba(255,255,255,.2) 42%, transparent 52%);
}

/* Frosted-glass tile panel: currently HIDDEN so the hero photo shows untouched (display: none).
   Delete that one line to bring it back (it also blurs the labels baked into the photo). */
/* Frosted-glass panel on the right holding the six specialisation tiles.
   (It also blurs out the text that is baked into the original photo.) */
.glass {
  position: absolute; top: 0; right: 0; bottom: 0; width: 40%;
  padding: 8.2rem 3rem 2rem 5rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; align-content: center;
  background: linear-gradient(90deg, transparent, rgba(8,20,48,.5) 30%);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.glass { display: none; }   /* <- delete this line to show the tile panel again */
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; min-height: 11rem; padding: 1rem .6rem; text-align: center;
  color: #fff; font-size: 1.3rem; font-weight: 600; line-height: 1.25;
  border: 1px solid rgba(255,255,255,.3); border-radius: 1rem;
  background: rgba(255,255,255,.14); box-shadow: 0 1rem 3rem rgba(0,0,0,.25);
  animation: float 7s ease-in-out infinite;
}
.tile:nth-child(even) { animation-delay: -3.5s; }
.tile .ic { font-size: 3.4rem; }
@keyframes float { 50% { transform: translateY(-.6rem); } }

/* Left text column */
.hero-txt { position: relative; z-index: 2; max-width: 72rem; padding: 6.6rem 0 0 10.5rem; }
.logo { width: 40rem; height: auto; margin-bottom: 1.4rem; }   /* logo size */
.hero h1 { font-size: 4rem; font-weight: 800; margin: .9rem 0 1.1rem; }
.hero p  { max-width: 56rem; margin: 0; font-size: 1.5rem; color: #2c3650; }
.btns    { display: flex; gap: 1.4rem; margin-top: 1.6rem; }
.btns .btn { padding: 1.2rem 2.6rem; }

/* One-time entrance animation for the hero text */
.hero-txt > * { animation: rise .8s both; }
.hero-txt > :nth-child(n+2) { animation-delay: .12s; }
.hero-txt > :nth-child(n+4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(1.6rem); } }


/* ==========================================================================
   6. SERVICE CARDS (row of 4 under the hero)
   ========================================================================== */
.cards {
  background: var(--soft); padding: 1.3rem 9.2rem;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem;
}
.card {
  display: flex; gap: 1.8rem; padding: 2.2rem 2rem;
  background: #fff; border-radius: .8rem; cursor: pointer;
  box-shadow: 0 .4rem 1.8rem rgba(20,35,70,.07);
  transition: transform .2s;
}
.card:hover { transform: translateY(-.3rem); }
.card h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: .6rem; }
.card p  { margin: 0 0 1.2rem; font-size: 1.25rem; line-height: 1.45; color: var(--muted); }
.more { display: inline-flex; align-items: center; gap: .8rem; font-size: 1.3rem; font-weight: 700; }
.more .ic { transition: transform .2s; }
.card:hover .more .ic { transform: translateX(.5rem); }


/* ==========================================================================
   7. STATS BAR (dark strip with 4 company facts)
   ========================================================================== */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 12rem;
  color: #fff; background: var(--navy) radial-gradient(circle at 20% 0, #183066 0, transparent 55%);
}
.stat { display: flex; align-items: center; gap: 2rem; padding: 2.2rem 2.6rem; border-left: 1px solid rgba(255,255,255,.18); }
.stat:first-child { border: 0; }
.stat .ic { font-size: 5rem; color: var(--gold); }
.stat b    { display: block; font-size: 2.3rem; font-weight: 800; line-height: 1.1; }   /* big value  */
.stat span { font-size: 1.5rem; color: #cfd8ee; }                                        /* small label */


/* ==========================================================================
   8. ABOUT SECTION (text | slanted photo | navy fact panel)
   ========================================================================== */
.about { position: relative; overflow: hidden; background: #fff; display: grid; grid-template-columns: 40% 34% 26%; }

.about-txt { padding: 2.4rem 2rem 0 9.6rem; }
.about-txt h2 { font-size: 3.3rem; margin: 1rem 0; }
.about-txt p  { max-width: 56rem; margin: 0 0 1.8rem; font-size: 1.45rem; line-height: 1.5; color: var(--muted); }

/* Slanted photo with a gold stripe peeking out behind it */
.about-mid { position: relative; margin: 0 -7rem; z-index: 1; }
.about-mid::before, .about-mid div { position: absolute; inset: 0; clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%); }
.about-mid::before { content: ""; background: linear-gradient(120deg, #ffe38a, var(--gold)); transform: translateX(-2.6rem); }
.about-mid div { background: var(--img-about) var(--img-about-pos) / cover; }

/* Navy panel with the 4 facts */
.about-side {
  display: flex; flex-direction: column; justify-content: center; gap: 1.5rem;
  padding: 2rem 3rem 2rem 17%; color: #fff; background: var(--navy);
  clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%);
}
.fact { display: flex; gap: 1.6rem; }
.fact p    { margin: 0; }
.fact .ic  { font-size: 3rem; color: var(--gold); }
.fact b    { display: block; font-size: 1.5rem; }
.fact span { display: block; font-size: 1.2rem; line-height: 1.35; color: #c6d0e8; }


/* ==========================================================================
   8b. FOOTER (copyright bar below the About row)
   ========================================================================== */
.footer {
  display: flex; align-items: center; justify-content: center;
  height: 4.4rem; padding: 0 2rem;
  background: #060e1f; color: #fff; border-top: 1px solid rgba(255,255,255,.12);
  font-size: 1.2rem; text-align: center;
}
.footer p { margin: 0; }


/* ==========================================================================
   9. POP-UP PANELS (<dialog>) — opened from nav, cards and buttons
   ========================================================================== */
dialog {
  width: min(112rem, 94vw); max-height: 90dvh; overflow: auto; padding: 0;
  border: 0; border-radius: 1.2rem; background: #fff; color: var(--ink);
  animation: rise .3s both;overflow-y:auto;scrollbar-width: none;-ms-overflow-style: none;
}
dialog::backdrop { background: rgba(8,17,42,.72); backdrop-filter: blur(4px); }

.dh { /* panel title bar */
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.6rem 3rem; background: var(--navy); color: #fff;
}
.dh h2 { font-size: 2.2rem; }
.x { background: none; border: 0; color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer; }   /* close button */

.dc { padding: 3rem; }                                      /* panel body */
.dc > p { max-width: 80rem; margin: 0 0 1.6rem; font-size: 1.4rem; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }

/* Chips (list of specialisations in "About") */
.chips { display: flex; flex-wrap: wrap; gap: .8rem; margin: 0 0 2.4rem; padding: 0; list-style: none; }
.chips li { padding: .6rem 1.2rem; border-radius: 99px; background: var(--soft); border: 1px solid var(--line); font-size: 1.25rem; font-weight: 600; }

/* Services panel */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.8rem; }
.svc { padding: 2.6rem; background: #fff; border-radius: .8rem; border-top: .3rem solid var(--gold); box-shadow: 0 .4rem 1.8rem rgba(20,35,70,.08); }
.svc .bub { width: 4.8rem; height: 4.8rem; font-size: 2.2rem; margin-bottom: 1.4rem; }
.svc h3 { font-size: 1.6rem; font-weight: 700; margin-bottom: .8rem; }
.svc ul { margin: 0; padding-left: 1.8rem; font-size: 1.4rem; color: var(--muted); }
.svc li::marker { color: var(--red); }
.svc p  { margin: 0; font-size: 1.4rem; color: var(--muted); }

.other { display: grid; grid-template-columns: .8fr 1.4fr; gap: 3.2rem; margin-top: 1.8rem; padding: 3.4rem; border-radius: .8rem; background: var(--navy); color: #fff; }
.other h3 { font-size: 2.4rem; font-weight: 800; margin-bottom: 1rem; }
.other p  { margin: 0; font-size: 1.45rem; color: #c6d0e8; }
.other ul { display: grid; gap: 1.2rem; margin: 0; padding: 0; list-style: none; font-size: 1.4rem; color: #dfe6f6; }
.other li { display: flex; gap: 1.2rem; }
.other li .ic { margin-top: .3rem; font-size: 1.8rem; color: var(--gold); }

/* Benefits panel */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.8rem; }
.ben { padding: 2.8rem 2.4rem; border: 1px solid var(--line); border-radius: .8rem; }
.ben .bub { margin-bottom: 1.6rem; }
.ben h3 { font-size: 1.7rem; font-weight: 700; margin-bottom: .8rem; }
.ben p  { margin: 0; font-size: 1.4rem; color: var(--muted); }

/* Contact panel */
.info { padding: 1.4rem 2.8rem; border-radius: 1rem; background: #fff; box-shadow: 0 1.6rem 4rem rgba(11,23,48,.15); border: 1px solid var(--line); }
.row  { display: flex; gap: 1.6rem; padding: 1.6rem 0; border-bottom: 1px solid var(--line); }
.row:last-child { border: 0; }
.row .ic   { margin-top: .3rem; font-size: 2.2rem; color: var(--red); }
.row b     { display: block; font-size: 1.25rem; font-weight: 600; color: var(--muted); }
.row span  { font-size: 1.5rem; font-weight: 600; line-height: 1.5; }

/* Vision panel: quote + circular diagram */
.quote { margin: 0 0 1.4rem; font-size: 2.6rem; font-weight: 800; color: var(--red); }
.orb   { position: relative; width: 34rem; height: 33rem; margin: 0 auto; }
.orb i { position: absolute; left: 50%; top: 50%; width: 20rem; height: 20rem; margin: -10rem 0 0 -10rem; border: 1.5px dashed rgba(245,184,0,.6); border-radius: 50%; }
.core, .sat { position: absolute; display: grid; place-items: center; text-align: center; border-radius: 50%; font-weight: 700; }
.core { left: 50%; top: 50%; width: 15.6rem; height: 15.6rem; margin: -7.8rem 0 0 -7.8rem; font-size: 1.6rem; line-height: 1.2; background: #e6f2fb; color: #0b4f9c; box-shadow: 0 0 5rem rgba(80,150,255,.45); }
.core em { font-style: normal; color: #0f8a4b; }
.sat  { width: 11.2rem; height: 11.2rem; padding: 1rem; font-size: 1.25rem; line-height: 1.2; color: #fff; box-shadow: 0 .8rem 2.4rem rgba(0,0,0,.3); }
.sat .ic { font-size: 2.2rem; margin-bottom: .3rem; }
.s1 { left: 11.4rem; top: 0;    background: linear-gradient(#6b4fb3, #4a3590); }
.s2 { left: 0;       bottom: 0; background: linear-gradient(#1c8ad8, #0b62b3); }
.s3 { right: 0;      bottom: 0; background: linear-gradient(#18bfd4, #0a97ad); }


/* ==========================================================================
   10. RESPONSIVE
   Below 1000px wide the one-screen layout becomes a normal scrolling page.
   Here 1rem = 10px, so 1.5rem = 15px.
   ========================================================================== */
@media (max-width: 999px) {
  html { font-size: 10px; }
  .page { display: block; height: auto; min-height: 0; }

  /* Header becomes a solid bar with a hamburger */
  header { height: 6.4rem; background: var(--navy); }
  header::before { display: none; }
  .bar  { padding: 0 1.6rem; }
  .menu { display: block; background: none; border: 0; color: #fff; font-size: 2.8rem; cursor: pointer; }
  .cta  { display: none; }
  nav {
    position: fixed; top: calc(6.4rem + env(safe-area-inset-top, 0)); left: 0; right: 0;
    flex-direction: column; gap: 0; height: auto; padding: .6rem 2.4rem 1.6rem;
    background: var(--navy); transform: translateY(-130%); transition: transform .3s;
  }
  nav.open { transform: none; }
  nav a { padding: 1.4rem 0; font-size: 1.5rem; border-bottom: 1px solid rgba(255,255,255,.1); }
  nav a::after { display: none; }

  /* Hero: text first, photo underneath */
  .hero { display: flex; flex-direction: column; }
  .hero-txt { max-width: none; padding: 8.6rem 2rem 2.4rem; }
  .hero-img { position: relative; order: 2; height: 28rem; }
  .hero-img::before { background: linear-gradient(#fff, transparent 30%); }
  .hero-img::after { display: none; }   /* extension image: desktop only */
  .hero-photo { left: 0; aspect-ratio: auto; background: var(--img-hero) 0 center / cover no-repeat; -webkit-mask-image: none; mask-image: none; }
  .glass { display: none; }
  .logo { width: min(36rem, 80vw); }
  .hero h1 { font-size: 3rem; }
  .label { font-size: 1.05rem; }
  .btns { flex-wrap: wrap; }
  .btns .btn { width: 100%; justify-content: center; }

  .cards { padding: 2rem 1.6rem; grid-template-columns: 1fr 1fr; }
  .card h3 { font-size: 1.6rem; } .card p { font-size: 1.35rem; } .more { font-size: 1.4rem; }

  .stats { padding: 0 1.6rem; grid-template-columns: 1fr 1fr; }
  .stat  { padding: 1.8rem 1rem; border-left: 0; border-top: 1px solid rgba(255,255,255,.18); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat b { font-size: 1.8rem; } .stat span { font-size: 1.3rem; } .stat .ic { font-size: 3.4rem; }

  .about { display: block; }
  .about-txt { padding: 3.6rem 2rem 2.4rem; }
  .about-txt h2 { font-size: 2.6rem; } .about-txt p { font-size: 1.5rem; }
  .about-mid { margin: 0; height: 26rem; }
  .about-mid::before { display: none; }
  .about-mid div { clip-path: none; }
  .about-side { clip-path: none; padding: 3rem 2rem; }
  .fact b { font-size: 1.6rem; } .fact span { font-size: 1.35rem; }

  .footer { height: auto; min-height: 4.6rem; padding: 1.2rem 1.6rem; font-size: 1.3rem; }

  /* Panels stack into one column */
  .two, .grid3, .grid4, .other { grid-template-columns: 1fr; }
  .dc { padding: 2rem 1.6rem; }
  .dh { padding: 1.4rem 1.6rem; }
}
@media (max-width: 600px) {
  .cards, .stats { grid-template-columns: 1fr; }
  .stat:nth-child(2) { border-top: 1px solid rgba(255,255,255,.18); }
}


/* ==========================================================================
   11. REDUCED MOTION (respects the visitor's system setting)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
