/* ================================================
   SAI® Company — style.css
   Dark / Light theme · Amber brand · Logo fixed
   ================================================ */

/* ---- Google Fonts ---- */
/* Loaded in HTML head */

/* ================================================
   THEME VARIABLES
   :root = light mode (default)
   [data-theme="dark"] = dark mode
   ================================================ */
:root {
  /* Surfaces */
  --bg:         #fafafa;
  --bg-2:       #f0f0f0;
  --bg-3:       #e8e8e8;
  --bg-card:    #ffffff;

  /* SAI Brand Amber/Gold — per original site */
  --amber:       #e8a000;
  --amber-hi:    #f5b830;
  --amber-mid:   #c47f00;
  --amber-lo:    #7a4f00;
  --amber-dim:   rgba(232,160,0,0.12);
  --amber-glow:  rgba(232,160,0,0.25);

  /* Text */
  --text:        #111111;
  --text-2:      #444444;
  --text-3:      #888888;
  --text-4:      #bbbbbb;
  --white:       #ffffff;

  /* Borders */
  --border:      rgba(0,0,0,0.08);
  --border-2:    rgba(0,0,0,0.14);

  /* Scrollbar */
  --sb-bg:       #e0e0e0;

  /* Logo filter — keep original colours, no bg bleed */
  --logo-filter: drop-shadow(0 0 0 transparent);
  --logo-blend:  normal;

  /* Fonts */
  --ff-sans:    'DM Sans', system-ui, sans-serif;
  --ff-serif:   'DM Serif Display', Georgia, serif;
  --ff-mono:    'Space Grotesk', monospace;

  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --nav-h:      68px;
  --max:        1200px;
  --pad:        clamp(1.25rem, 4vw, 3rem);
}

/* ---- DARK THEME ---- */
[data-theme="dark"] {
  --bg:         #0d0d0d;
  --bg-2:       #141414;
  --bg-3:       #1c1c1c;
  --bg-card:    #181818;

  --text:        #f0f0f0;
  --text-2:      #b0b0b0;
  --text-3:      #666666;
  --text-4:      #3a3a3a;
  --white:       #ffffff;

  --border:      rgba(255,255,255,0.07);
  --border-2:    rgba(255,255,255,0.12);

  --sb-bg:       #1a1a1a;
  --logo-blend:  multiply;
}

/* ================================================
   RESET
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--ff-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background 0.35s ease, color 0.35s ease;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font: inherit; }
::selection { background: var(--amber); color: #000; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--sb-bg); }
::-webkit-scrollbar-thumb { background: var(--amber); border-radius: 2px; }

/* ================================================
   SCROLL PROGRESS BAR
   ================================================ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--amber-mid), var(--amber), var(--amber-hi));
  width: 0%;
  z-index: 9999;
  transition: width 0.08s linear;
  transform-origin: left;
}

/* ================================================
   GRAIN OVERLAY (dark mode only)
   ================================================ */
.grain-overlay {
  position: fixed;
  inset: -200%;
  width: 400%; height: 400%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9997;
  opacity: 0.15;
  animation: grain 8s steps(2) infinite;
}

[data-theme="dark"] .grain-overlay { opacity: 0.55; }

@keyframes grain {
  0%  { transform: translate(0,0); }
  10% { transform: translate(-2%,-3%); }
  20% { transform: translate(3%,2%); }
  30% { transform: translate(-1%,4%); }
  40% { transform: translate(4%,-1%); }
  50% { transform: translate(-3%,3%); }
  60% { transform: translate(2%,-4%); }
  70% { transform: translate(-4%,1%); }
  80% { transform: translate(3%,3%); }
  90% { transform: translate(-2%,-2%); }
  100%{ transform: translate(0,0); }
}



/* ================================================
   THEME TOGGLE BUTTON
   ================================================ */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--bg-2);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
  flex-shrink: 0;
  cursor: pointer !important;
  position: relative;
}

.theme-toggle:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* In light mode (default) → show moon, hide sun */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }

/* In dark mode → show sun, hide moon */
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ================================================
   NAVBAR
   ================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  transition: background .4s var(--ease-out), border-color .4s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(250,250,250,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: var(--border);
}

[data-theme="dark"] .site-header.scrolled {
  background: rgba(13,13,13,0.9);
  border-color: var(--border);
}

.nav {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ---- Logo ---- */
.nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 38px;
  width: auto;
  display: block;
  transition: opacity .2s ease;
}
.nav-logo-img:hover { opacity: 0.8; }

/* In dark mode, if the logo is too dark against dark theme, we can make it pop using a subtle brightness/contrast filter or drop-shadow */
[data-theme="dark"] .nav-logo-img,
:root:not([data-theme="light"]) .nav-logo-img {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.45)) brightness(1.1);
}

[data-theme="light"] .nav-logo-img {
  filter: none;
}

/* ---- Pakistan flag chip ---- */
.nav-flag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding-left: .85rem;
  margin-left: .1rem;
  border-left: 1px solid var(--border);
}
.nav-flag svg {
  width: 28px;
  height: 19px;
  display: block;
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--border);
}

/* ---- Nav List ---- */
.nav-list {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin: 0 auto;   /* center the links between logo and controls */
}

/* nl-link: the <span> child slides up/down for the text-swap hover */
.nl-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .75rem;
  font-size: .825rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 6px;
  overflow: hidden;
  transition: background .2s ease, color .2s ease;
  text-decoration: none;
}

/* The visible text span slides up on hover */
.nl-link span {
  display: inline-block;
  transition: transform .28s var(--ease-out), opacity .2s ease;
}

/* A pseudo-element clone slides in from below */
.nl-link::after {
  content: attr(data-text);
  position: absolute;
  left: .75rem; right: .75rem;
  text-align: left;
  color: var(--amber);
  font-weight: 600;
  font-size: .825rem;
  transform: translateY(120%);
  opacity: 0;
  transition: transform .28s var(--ease-out), opacity .2s ease;
  pointer-events: none;
}

.nl-link:hover span,
.nl-link.active span { transform: translateY(-120%); opacity: 0; }

.nl-link:hover::after,
.nl-link.active::after { transform: translateY(0); opacity: 1; }

.nl-link:hover,
.nl-link.active { background: rgba(232,160,0,0.08); }

/* Active state colour on the pseudo-element already set above */


/* Dropdown */
.has-sub { position: relative; }
.nl-drop {
  color: var(--text-2); font-size: .825rem;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .75rem; border-radius: 6px;
  transition: background .2s ease, color .2s ease;
  cursor: pointer !important;
}
.nl-drop:hover { background: rgba(232,160,0,0.08); color: var(--amber); }
.drop-arrow { transition: transform .2s ease; flex-shrink: 0; }
.has-sub:hover .drop-arrow { transform: rotate(180deg); }

.sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: .5rem;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity .22s ease, visibility .22s ease, transform .22s var(--ease-out);
  box-shadow: 0 20px 48px rgba(0,0,0,0.4);
  z-index: 200;
}

.has-sub:hover .sub-menu {
  opacity: 1; visibility: visible; pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.sub-menu li a {
  display: block;
  padding: .5rem .9rem;
  font-size: .8rem;
  color: var(--text-2);
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.sub-menu li a:hover { background: rgba(232,160,0,0.1); color: var(--amber); }


/* Contact CTA */
.nav-contact {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1.1rem;
  font-size: .825rem;
  font-weight: 700;
  color: #000;
  background: var(--amber);
  border-radius: 7px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background .2s ease, box-shadow .2s ease;
}
.nav-contact:hover { background: var(--amber-hi); box-shadow: 0 4px 18px var(--amber-glow); color: #000; }

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: .5rem;
  cursor: pointer !important;
}
.burger span {
  display: block; width: 22px; height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}
.burger.open span:first-child { transform: rotate(45deg) translate(4px,4px); }
.burger.open span:last-child  { transform: rotate(-45deg) translate(4px,-4px); }


/* ================================================
   HERO
   ================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-h);
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  background: url('hero_bg.png') center/cover no-repeat;
  will-change: transform;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(250,250,250,0.92) 35%, rgba(250,250,250,0.55) 100%),
    linear-gradient(to bottom, rgba(250,250,250,0.2) 0%, rgba(250,250,250,0.9) 100%);
  z-index: 1;
  transition: background .4s ease;
}

[data-theme="dark"] .hero-vignette {
  background:
    linear-gradient(to right, rgba(13,13,13,0.93) 35%, rgba(13,13,13,0.4) 100%),
    linear-gradient(to bottom, rgba(13,13,13,0.2) 0%, rgba(13,13,13,0.88) 100%);
}


.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 5rem var(--pad) 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

/* Eyebrow */
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--ff-mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.75rem;
}

.dot-pulse {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--amber-glow);
  animation: dpulse 2s infinite;
}
@keyframes dpulse {
  0%  { box-shadow: 0 0 0 0 var(--amber-glow); }
  70% { box-shadow: 0 0 0 8px rgba(232,160,0,0); }
  100%{ box-shadow: 0 0 0 0 rgba(232,160,0,0); }
}

/* Headline */
.hero-h1 {
  font-family: var(--ff-serif);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.75rem;
  overflow: hidden;  /* clips the sliding lines */
}


.h1-line {
  display: block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform .9s var(--ease-out), opacity .9s ease;
}
.h1-line.italic { font-style: italic; color: var(--amber); }
.h1-line.revealed { transform: translateY(0); opacity: 1; }

.hero-body {
  font-size: 1.025rem;
  color: var(--text-2);
  max-width: 480px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s ease .6s, transform .8s var(--ease-out) .6s;
}
.hero-body.revealed { opacity: 1; transform: none; }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s ease .75s, transform .8s var(--ease-out) .75s;
}
.hero-actions.revealed { opacity: 1; transform: none; }

/* Buttons */
.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  background: var(--amber);
  color: #000;
  font-size: .875rem;
  font-weight: 700;
  border-radius: 7px;
  letter-spacing: .01em;
  transition: background .2s ease, box-shadow .2s ease;
}
.btn-solid:hover { background: var(--amber-hi); box-shadow: 0 6px 20px var(--amber-glow); color: #000; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.25rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-2);
  transition: color .2s ease, border-color .2s ease;
}
.btn-ghost:hover { color: var(--text); border-color: var(--amber); }
.btn-ghost svg { transition: transform .2s var(--ease-out); }
.btn-ghost:hover svg { transform: translateX(4px); }

.magnetic { position: relative; }

/* Hero Right */
.hero-right { display: flex; flex-direction: column; gap: 1.5rem; }

.hero-stats-panel {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .hero-stats-panel {
  background: rgba(255,255,255,0.03);
}

.hsp-item { flex: 1; text-align: center; }
.hsp-num  { font-family: var(--ff-mono); font-size: 2.75rem; font-weight: 700; color: var(--amber); line-height: 1; }
.hsp-suffix { font-family: var(--ff-mono); font-size: 1.5rem; font-weight: 700; color: var(--amber-hi); }
.hsp-label { font-size: .75rem; color: var(--text-3); margin-top: .4rem; line-height: 1.4; text-transform: uppercase; letter-spacing: .05em; }
.hsp-divider { width: 1px; height: 50px; background: var(--border); flex-shrink: 0; }

/* Typewriter */
.hero-type-box {
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
[data-theme="dark"] .hero-type-box { background: rgba(255,255,255,0.03); }

.htb-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: .5rem; font-family: var(--ff-mono); }
.htb-type  { font-family: var(--ff-mono); font-size: 1rem; font-weight: 600; color: var(--amber-hi); min-height: 1.4em; }
.typed-cursor { display: inline-block; width: 2px; height: 1em; background: var(--amber); margin-left: 2px; vertical-align: middle; animation: blink .7s step-end infinite; }
@keyframes blink { 0%,100%{ opacity:1; } 50%{ opacity:0; } }

/* Scroll cue */
.hero-scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: var(--pad);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--text-3);
}
.hsc-line { display: block; width: 40px; height: 1px; background: var(--text-3); animation: lineExp 2s var(--ease-out) infinite alternate; transform-origin: left; }
@keyframes lineExp { from { transform: scaleX(.3); opacity:.3; } to { transform: scaleX(1); opacity:1; } }
.hsc-text { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; font-family: var(--ff-mono); }

/* ================================================
   MARQUEE STRIP
   ================================================ */
.marquee-strip {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  padding: .9rem 0;
  user-select: none;
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 2rem;
  width: max-content;
  animation: marqueeRun 30s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-track span { font-family: var(--ff-mono); font-size: .78rem; font-weight: 500; letter-spacing: .05em; color: var(--text-3); text-transform: uppercase; white-space: nowrap; transition: color .2s ease; }
.marquee-track span:hover { color: var(--amber); }
.marquee-track .sep { color: var(--amber) !important; font-size: .6rem; opacity: .5; }
@keyframes marqueeRun { 0% { transform:translateX(0); } 100% { transform:translateX(-50%); } }

/* ================================================
   SHARED SECTION STYLES
   ================================================ */
.section { padding: clamp(4rem,9vw,8rem) 0; scroll-margin-top: var(--nav-h); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.sec-head { margin-bottom: 4rem; }

.sec-eyebrow {
  font-family: var(--ff-mono);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--amber); margin-bottom: .75rem;
}

.sec-title {
  font-family: var(--ff-serif);
  font-size: clamp(2.2rem,5vw,3.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1rem;
}
.sec-title em { font-style: italic; color: var(--amber); }

.sec-body { font-size: 1rem; color: var(--text-2); max-width: 580px; line-height: 1.75; }
.sec-cta-line { margin-top: 3rem; font-size: .9rem; color: var(--text-3); text-align: center; }
.ul-link { color: var(--amber); border-bottom: 1px solid rgba(232,160,0,0.4); transition: border-color .2s ease; }
.ul-link:hover { border-color: var(--amber); }

/* Stagger reveal */
.stagger-parent .stagger-child,
.stagger-child {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .65s var(--ease-out), transform .65s var(--ease-out);
}
.stagger-parent.in-view .stagger-child,
.stagger-child.in-view { opacity: 1; transform: none; }

/* ================================================
   MISSION — Bento
   ================================================ */
.mission-sec { background: var(--bg); }

.mission-bento {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.mb-card { background: var(--bg-2); padding: 2.25rem 2rem; transition: background .3s ease; position: relative; }
.mb-card:hover { background: var(--bg-3); }
.mb-large { background: var(--bg-3); }
.mb-accent {
  background: var(--amber-dim);
  border: 1px solid rgba(232,160,0,0.15);
}
.mb-accent:hover { background: rgba(232,160,0,0.18); }


.mb-number { display: block; font-family: var(--ff-mono); font-size: .7rem; font-weight: 700; letter-spacing: .1em; color: var(--amber); margin-bottom: 1rem; opacity: .7; }
.mb-card h3 { font-family: var(--ff-serif); font-size: 1.2rem; font-weight: 400; color: var(--text); margin-bottom: .75rem; line-height: 1.3; }
.mb-card p  { font-size: .875rem; color: var(--text-2); line-height: 1.7; }

/* ---- Mission statement lead (short = headline, full = supporting) ---- */
.mission-lead {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  margin-bottom: clamp(3.5rem, 7vw, 5.5rem);
}

.ml-statement { position: relative; padding-top: 1.5rem; }
.ml-mark {
  position: absolute; top: -1.2rem; left: -0.4rem;
  font-family: var(--ff-serif); font-size: 6rem; line-height: 1;
  color: var(--amber); opacity: .28;
}
.ml-quote {
  position: relative;
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.8vw, 2.3rem);
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--text);
}
.ml-quote em { font-style: italic; color: var(--amber); }

.ml-supporting { border-left: 1px solid var(--border); padding-left: clamp(1.5rem, 3vw, 2.5rem); }
.ml-supporting p { font-size: .95rem; color: var(--text-2); line-height: 1.8; }
.ml-supporting p + p { margin-top: 1.1rem; }

.ml-pillars-label {
  font-family: var(--ff-mono);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 1.5rem;
}

/* ================================================
   HSE POLICY
   ================================================ */
.hse-sec { background: var(--bg); }
.hse-sec .sec-body { max-width: 640px; }

.hse-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.hse-statement p { font-size: .95rem; color: var(--text-2); line-height: 1.8; }
.hse-statement p + p { margin-top: 1.25rem; }

.hse-aside { position: sticky; top: calc(var(--nav-h) + 1.5rem); display: flex; flex-direction: column; gap: 1.75rem; }

.hse-pledge {
  position: relative;
  background: var(--amber-dim);
  border: 1px solid rgba(232,160,0,0.18);
  border-radius: 16px;
  padding: 2.5rem 2rem 2rem;
}
.hse-pledge-mark {
  position: absolute; top: .4rem; left: 1.1rem;
  font-family: var(--ff-serif); font-size: 4rem; line-height: 1;
  color: var(--amber); opacity: .4;
}
.hse-pledge p {
  position: relative;
  font-family: var(--ff-serif);
  font-size: 1.3rem; line-height: 1.4;
  color: var(--text);
}

.hse-pillars { list-style: none; display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.hse-pillars li { background: var(--bg-2); padding: 1.1rem 1.4rem; font-size: .85rem; color: var(--text-2); line-height: 1.6; }
.hsp-tag { display: block; font-family: var(--ff-mono); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin-bottom: .3rem; }

/* ================================================
   HISTORY — Timeline
   ================================================ */
.history-sec { background: var(--bg-2); }
.history-sec .sec-body { max-width: 600px; }

.timeline { position: relative; padding-left: 2rem; margin-top: 3rem; }
.timeline::before {
  content: ''; position: absolute;
  top: 6px; left: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, var(--amber), rgba(232,160,0,0.05));
}

.tl-item {
  position: relative;
  padding: 0 0 3rem 3rem;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.tl-node {
  position: absolute;
  left: -4px; top: 8px;
  width: 9px; height: 9px;
  background: var(--amber);
  border-radius: 50%;
  border: 2px solid var(--bg-2);
  transition: box-shadow .3s ease;
}
.tl-item:hover .tl-node { box-shadow: 0 0 0 5px rgba(232,160,0,0.2); }
.tl-year { font-family: var(--ff-mono); font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: var(--amber); padding-top: .1rem; line-height: 1.4; }
.tl-body h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .5rem; }
.tl-body p  { font-size: .875rem; color: var(--text-2); line-height: 1.75; }
.tl-body em { font-style: italic; color: var(--text); }

/* ================================================
   ACTIVITY — Bento
   ================================================ */
.activity-sec { background: var(--bg); }

.act-bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.act-card {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  transition: background .3s ease, border-color .3s ease, transform .3s var(--ease-out);
  color: inherit;
  position: relative;
  overflow: hidden;
}
.act-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 20%, var(--amber-dim) 0%, transparent 60%);
  opacity: 0; transition: opacity .4s ease;
}
.act-card:hover { background: var(--bg-3); border-color: rgba(232,160,0,0.3); transform: translateY(-3px); }
.act-card:hover::before { opacity: 1; }

.act-card-inner { display: flex; flex-direction: column; gap: 1rem; height: 100%; }
.act-icon { width: 44px; height: 44px; color: var(--amber); flex-shrink: 0; }
.act-card h3 { font-family: var(--ff-serif); font-size: 1.5rem; font-weight: 400; color: var(--text); }
.act-card p  { font-size: .875rem; color: var(--text-2); line-height: 1.7; flex: 1; }

.act-arrow {
  display: inline-flex;
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  align-items: center; justify-content: center;
  align-self: flex-end;
  transition: background .2s ease, border-color .2s ease, transform .3s var(--ease-out);
}
.act-arrow svg { width: 14px; height: 14px; color: var(--text); }
.act-card:hover .act-arrow { background: var(--amber); border-color: var(--amber); transform: rotate(45deg) scale(1.1); }
.act-card:hover .act-arrow svg { color: #000; }

/* ================================================
   PRODUCTS
   ================================================ */
.products-sec { background: var(--bg-2); }

.prod-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.prod-cat { background: var(--bg-2); padding: 2rem; transition: background .3s ease; }
.prod-cat:hover { background: var(--bg-3); }

.pc-head { display: flex; align-items: baseline; gap: .75rem; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.pc-num { font-family: var(--ff-mono); font-size: .65rem; font-weight: 700; color: var(--amber); letter-spacing: .06em; opacity: .7; }
.pc-head h3 { font-size: .875rem; font-weight: 600; color: var(--text); line-height: 1.3; }

.prod-cat ul { display: flex; flex-direction: column; gap: .45rem; }
.prod-cat ul li { font-size: .8rem; color: var(--text-2); padding-left: .9rem; position: relative; line-height: 1.45; }
.prod-cat ul li::before { content: '—'; position: absolute; left: 0; color: rgba(232,160,0,0.5); font-size: .65rem; top: 1px; }

/* ================================================
   SERVICES — Accordion
   ================================================ */
.services-sec { background: var(--bg); }

.svc-accordion {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.svc-item { border-bottom: 1px solid var(--border); }
.svc-item:last-child { border-bottom: none; }

.svc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 2rem;
  background: var(--bg-2);
  transition: background .2s ease;
  text-align: left;
  cursor: pointer !important;
}
.svc-trigger:hover,
.svc-item.open .svc-trigger { background: var(--bg-3); }

.svc-num { font-family: var(--ff-mono); font-size: .68rem; font-weight: 700; letter-spacing: .08em; color: var(--amber); opacity: .7; flex-shrink: 0; width: 22px; }
.svc-name { font-size: .95rem; font-weight: 600; color: var(--text); flex: 1; }
.svc-chevron { width: 16px; height: 10px; color: var(--text-3); flex-shrink: 0; transition: transform .3s var(--ease-out); }
.svc-item.open .svc-chevron { transform: rotate(180deg); color: var(--amber); }

/* Panel: purely CSS height transition — no hidden attr needed */
.svc-panel {
  max-height: 0;
  overflow: hidden;
  background: var(--bg-2);
  transition: max-height .45s var(--ease-out);
}
.svc-item.open .svc-panel { max-height: 700px; }

.svc-list-inner {
  padding: 1rem 2rem 1.75rem 4.25rem;
}

.svc-list-inner ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.svc-list-inner ul li {
  font-size: .84rem;
  color: var(--text-2);
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.55;
}
.svc-list-inner ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--amber);
  font-size: .7rem;
  opacity: 0.65;
}


/* ================================================
   PRINCIPALS
   ================================================ */
.principals-sec { background: var(--bg-2); }

.principals-cloud { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.pc-tag { display: inline-block; padding: .4rem .9rem; font-size: .78rem; color: var(--text-2); border: 1px solid var(--border); border-radius: 6px; background: var(--bg-3); transition: border-color .2s ease, color .2s ease, background .2s ease; cursor: default; }
.pc-tag:hover { border-color: rgba(232,160,0,0.35); color: var(--text); background: var(--amber-dim); }
.pc-tag--hi { border-color: rgba(232,160,0,0.25); color: var(--text); background: rgba(232,160,0,0.07); }

/* ================================================
   CLIENTS
   ================================================ */
.clients-sec { background: var(--bg); }

.clients-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.ct-col { padding: 2.5rem 2rem; background: var(--bg-2); }
.ct-col:first-child { border-right: 1px solid var(--border); }
.ct-col ul { display: flex; flex-direction: column; }
.ct-col ul li { font-size: .865rem; color: var(--text-2); padding: .65rem 0; border-bottom: 1px solid var(--border); transition: color .15s ease, padding-left .2s var(--ease-out); }
.ct-col ul li:last-child { border-bottom: none; }
.ct-col ul li:hover { color: var(--text); padding-left: 4px; }
.clients-and-more { text-align: center; margin-top: 1.5rem; font-size: .85rem; color: var(--text-3); font-style: italic; }

/* ================================================
   SUBSIDIARIES
   ================================================ */
.subs-sec { background: var(--bg-2); }

.subs-row {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.sub-card { background: var(--bg-2); padding: 2.5rem 2rem; transition: background .3s ease; }
.sub-card:hover { background: var(--bg-3); }
.sub-index { font-family: var(--ff-mono); font-size: .68rem; font-weight: 700; letter-spacing: .1em; color: var(--amber); opacity: .6; margin-bottom: 1rem; }
.sub-card h3 { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: .6rem; }
.sub-card p  { font-size: .85rem; color: var(--text-2); margin-bottom: 1.25rem; line-height: 1.65; }
.sub-link { font-family: var(--ff-mono); font-size: .78rem; font-weight: 600; color: var(--amber); border-bottom: 1px solid rgba(232,160,0,0.3); transition: border-color .2s ease; }
.sub-link:hover { border-color: var(--amber); }

/* ================================================
   CONTACT
   ================================================ */
.contact-sec { background: var(--bg); }

.contact-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 5rem; align-items: start; }
.contact-left .sec-title { margin-bottom: 1.25rem; }
.contact-details { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.cd-row { display: flex; align-items: flex-start; gap: .875rem; font-size: .9rem; color: var(--text-2); }
.cd-row svg { flex-shrink: 0; margin-top: 2px; color: var(--amber); }
.cd-row a { color: var(--text-2); transition: color .2s ease; }
.cd-row a:hover { color: var(--amber); }

/* Form */
.contact-form { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 2.5rem; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cf-field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.cf-field label { font-size: .75rem; font-weight: 600; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }
.cf-field input,
.cf-field textarea { background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; color: var(--text); font-size: .9rem; width: 100%; outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
.cf-field input::placeholder,
.cf-field textarea::placeholder { color: var(--text-4); }
.cf-field input:focus,
.cf-field textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-dim); }
.cf-field textarea { resize: vertical; min-height: 120px; }
.contact-form .btn-solid { width: 100%; justify-content: center; padding: .9rem; margin-top: .5rem; }
.cf-status { margin-top: .875rem; font-size: .83rem; text-align: center; min-height: 18px; color: var(--text-3); }
.cf-status.ok  { color: #34d399; }
.cf-status.err { color: #f87171; }

/* ================================================
   FOOTER
   ================================================ */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 4rem 0 2rem; }
.footer-top { display: flex; justify-content: space-between; gap: 3rem; margin-bottom: 4rem; align-items: flex-start; }

/* Footer logo */
.ft-logo-img {
  display: block;
  height: 42px;
  width: auto;
  margin-bottom: 1.25rem;
  opacity: 0.95;
}
[data-theme="dark"] .ft-logo-img,
:root:not([data-theme="light"]) .ft-logo-img {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.45)) brightness(1.1);
}
[data-theme="light"] .ft-logo-img {
  filter: none;
}


.ft-tagline { font-size: .85rem; color: var(--text-2); line-height: 1.65; }
.ft-nav { display: flex; gap: 4rem; }
.ft-col-head { font-family: var(--ff-mono); font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 1rem; }
.ft-col ul { display: flex; flex-direction: column; gap: .6rem; }
.ft-col ul li,
.ft-col ul li a { font-size: .83rem; color: var(--text-2); transition: color .15s ease; }
.ft-col ul li a:hover { color: var(--amber); }

.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; border-top: 1px solid var(--border); gap: 1rem; flex-wrap: wrap; }
.footer-bottom p { font-size: .78rem; color: var(--text-3); }
.ft-webmaster { font-size: .78rem; color: var(--text-3); border-bottom: 1px solid var(--border); transition: color .2s ease, border-color .2s ease; }
.ft-webmaster:hover { color: var(--amber); border-color: rgba(232,160,0,0.4); }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
  .hero-inner  { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 4rem; }
  .hero-right  { display: none; }
  .hero-h1     { font-size: clamp(2.5rem,8vw,4rem); }
  .mission-bento { grid-template-columns: 1fr 1fr; }
  .mission-lead  { grid-template-columns: 1fr; gap: 2rem; }
  .ml-supporting { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 1.75rem; }
  .hse-layout    { grid-template-columns: 1fr; gap: 2.5rem; }
  .hse-aside     { position: static; }
  .prod-grid   { grid-template-columns: 1fr 1fr; }
  .act-bento   { grid-template-columns: 1fr 1fr; }
  .contact-layout { grid-template-columns: 1fr; gap: 3rem; }
  .footer-top  { flex-direction: column; }
  .ft-nav      { gap: 2.5rem; flex-wrap: wrap; }
  .timeline::before { display: none; }
  .tl-item { padding-left: 0; }
  .tl-node { display: none; }
}

@media (max-width: 768px) {
  .nav-list, .nav-contact { display: none; }
  .burger { display: flex; }
  .theme-toggle { order: 3; }  /* keep toggle always visible */

  .nav-list.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.5rem var(--pad);
    gap: .25rem;
    border-bottom: 1px solid var(--border);
    z-index: 999;
  }

  .nav-list.mobile-open .nl-link {
    width: 100%; padding: .875rem .75rem;
    overflow: visible;  /* let text show without clip */
  }
  /* On mobile don't use the text-swap trick */
  .nav-list.mobile-open .nl-link span { transform: none !important; opacity: 1 !important; }
  .nav-list.mobile-open .nl-link::after { display: none; }

  .nav-list.mobile-open .sub-menu {
    position: static;
    transform: none !important;
    opacity: 1; visibility: visible; pointer-events: all;
    background: var(--bg-3);
    box-shadow: none;
    border-radius: 8px;
    margin: .25rem 0;
  }


  .mission-bento { grid-template-columns: 1fr; }
  .act-bento     { grid-template-columns: 1fr; }
  .prod-grid     { grid-template-columns: 1fr; }
  .clients-table { grid-template-columns: 1fr; }
  .ct-col:first-child { border-right: none; border-bottom: 1px solid var(--border); }
  .subs-row      { grid-template-columns: 1fr; }
  .cf-row        { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .tl-item       { grid-template-columns: 60px 1fr; gap: 1rem; }

  /* Tighter rhythm on phones */
  .sec-head      { margin-bottom: 2.5rem; }
  .mission-lead  { margin-bottom: 2.5rem; }
  .ml-mark       { font-size: 4.5rem; top: -0.8rem; }
  .hse-pledge p  { font-size: 1.15rem; }
  .hero-actions  { gap: .75rem; }
  .hero-actions .btn-solid,
  .hero-actions .btn-ghost { flex: 1 1 auto; justify-content: center; }
  .hero-scroll-cue { display: none; }
}

@media (max-width: 480px) {
  .hero-h1       { font-size: 2.25rem; }
  .sec-title     { font-size: 2rem; }
  .contact-form  { padding: 1.5rem; }
  .ft-nav        { gap: 1.5rem; }

  .ml-quote      { font-size: 1.4rem; }
  .ml-statement  { padding-top: 1rem; }
  .mb-card       { padding: 1.75rem 1.5rem; }
  .hse-pledge    { padding: 2.25rem 1.5rem 1.75rem; }
  .ml-supporting p, .hse-statement p { font-size: .9rem; }
  .nav-logo-img  { width: 140px; }
}
