/* ============================================================
   IISS — International Integrated Smart Solutions
   Custom styles. Tailwind utility classes + theme tokens (colors,
   fonts, shadows, container) are built from src/input.css into
   css/tailwind.css — this file holds everything Tailwind doesn't
   cover: animations, one-off components, the intro overlay.

   Tailwind's @theme block emits --color-navy, --color-ivory, etc.
   as real :root custom properties, so they're reused directly
   below instead of being redeclared.

   Everything below lives in @layer components, the slot Tailwind's
   own @layer order already reserves between its `base` and
   `utilities` layers. Per the CSS cascade-layers spec, an unlayered
   stylesheet always beats a layered one regardless of source order —
   so without this, plain rules here (e.g. .btn's `display`) would
   permanently win over Tailwind utilities like `hidden` or
   `lg:inline-flex` on the same element, no matter which link tag
   comes first in <head>.
   ============================================================ */

@layer components {

html { scroll-behavior: smooth; }

body {
  font-family: 'Marcellus', Georgia, serif;
  color: var(--color-espresso);
  background: var(--color-ivory);
  line-height: 1.7;
  letter-spacing: 0.01em;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Playfair Display', Georgia, serif;
  letter-spacing: -0.005em;
  line-height: 1.15;
}

.font-label { font-family: 'Tenor Sans', system-ui, sans-serif; }

::selection { background: var(--color-blush); color: var(--color-navy); }

/* Anchor targets land clear of the fixed navbar (h-16 logo + py-4 ≈ 96px) */
section[id] { scroll-margin-top: 6.5rem; }

/* Hero fills the viewport on every screen size */
.hero { min-height: 100vh; }
@supports (min-height: 100dvh) {
  .hero { min-height: 100dvh; }
}

/* Skip-to-content link — hidden until keyboard-focused */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  background: var(--color-blush);
  color: var(--color-navy);
  padding: 0.75rem 1.25rem;
  border-radius: 0.375rem;
  font-family: 'Tenor Sans', system-ui, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }

/* Eyebrow label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Tenor Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-blush);
}
.eyebrow.on-light { color: var(--color-espresso); }
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 34px;
  height: 1px;
  background: currentColor;
}
.eyebrow.on-light::before { background: var(--color-taupe); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.85rem;
  border-radius: 9999px;
  font-family: 'Tenor Sans', system-ui, sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
  will-change: transform;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-blush);
  color: var(--color-navy);
  box-shadow: 0 12px 30px -14px rgba(202, 170, 152, 0.7);
}
.btn-primary:hover { transform: translateY(-2px); background: #d8c0b0; }
.btn-ghost {
  background: transparent;
  color: var(--color-ivory);
  border: 1px solid rgba(247, 245, 243, 0.35);
}
.btn-ghost:hover { border-color: var(--color-blush); color: var(--color-blush); }
.btn-dark {
  background: var(--color-navy);
  color: var(--color-ivory);
}
.btn-dark:hover { background: var(--color-espresso); transform: translateY(-2px); }

/* Focus rings */
a, button, main[tabindex] { outline: none; }
a:focus-visible, button:focus-visible, main[tabindex]:focus-visible {
  box-shadow: 0 0 0 3px rgba(202, 170, 152, 0.6);
  border-radius: 6px;
}

/* Dot grid background */
.dot-grid {
  background-image: radial-gradient(rgba(202, 170, 152, 0.16) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Scroll reveal — gated on .js-reveal (set by js/main.js as its very first
   statement) so content stays visible by default. If the script never runs
   or throws, nothing below the hero is hidden. */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
}
.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.js-reveal .reveal[data-delay="1"] { transition-delay: .09s; }
.js-reveal .reveal[data-delay="2"] { transition-delay: .18s; }
.js-reveal .reveal[data-delay="3"] { transition-delay: .27s; }
.js-reveal .reveal[data-delay="4"] { transition-delay: .36s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
}

/* Navbar */
.nav-bar {
  transition: background-color .3s ease, box-shadow .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.nav-bar.scrolled {
  background-color: rgba(32, 41, 64, 0.92);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.6);
  border-bottom-color: rgba(202, 170, 152, 0.14);
}
.nav-link {
  font-family: 'Tenor Sans', system-ui, sans-serif;
  color: rgba(247, 245, 243, 0.72);
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: color .2s ease;
}
.nav-link:hover { color: var(--color-blush); }

/* Mobile menu */
.mobile-menu { transition: opacity .3s ease, visibility .3s ease; }
.mobile-menu[hidden] {
  opacity: 0;
  visibility: hidden;
  display: flex;
}
.mobile-menu:not([hidden]) { opacity: 1; visibility: visible; }

/* Cards */
.card-dark {
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border: 1px solid rgba(202, 170, 152, 0.16);
  border-radius: 0.5rem;
}
.card-light {
  background: #ffffff;
  border: 1px solid rgba(32, 41, 64, 0.09);
  border-radius: 0.5rem;
}

/* Icon bubbles */
.icon-bubble {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(202, 170, 152, 0.13);
  color: var(--color-blush);
  border: 1px solid rgba(202, 170, 152, 0.26);
}
.icon-bubble.on-light {
  background: rgba(32, 41, 64, 0.05);
  color: var(--color-navy);
  border: 1px solid rgba(32, 41, 64, 0.1);
}

/* Approach step connector (desktop) */
.approach-connector {
  background-image: linear-gradient(90deg, rgba(202, 170, 152, 0.6) 50%, transparent 50%);
  background-size: 10px 1px;
  background-repeat: repeat-x;
  background-position: 0 50%;
}

/* Industry pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.2rem;
  border-radius: 9999px;
  border: 1px solid rgba(202, 170, 152, 0.3);
  color: var(--color-ivory);
  font-size: 0.98rem;
  background: rgba(202, 170, 152, 0.05);
  transition: background .25s ease, transform .25s ease, border-color .25s ease;
}
.pill:hover { background: rgba(202, 170, 152, 0.13); border-color: rgba(202, 170, 152, 0.55); transform: translateY(-2px); }
.pill::before {
  content: '';
  width: 5px; height: 5px;
  background: var(--color-blush);
  border-radius: 9999px;
}

/* Service sub-list */
.sub-list li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.32rem 0;
  color: rgba(247, 245, 243, 0.8);
  font-size: 0.98rem;
}
.sub-list li::before {
  content: '';
  flex: none;
  margin-top: 0.7rem;
  width: 5px; height: 5px;
  background: var(--color-blush);
  border-radius: 9999px;
}

/* Section accents */
.section-arc {
  position: absolute;
  pointer-events: none;
  opacity: 0.6;
}
.arc-hero-a   { right: -120px; top: -120px; width: 520px; height: 520px; }
.arc-hero-b   { left: -160px; bottom: -200px; width: 560px; height: 560px; }
.arc-approach { right: -100px; top: 50%; transform: translateY(-50%); width: 380px; height: 380px; }
.arc-cta      { right: -100px; top: -100px; width: 340px; height: 340px; }

/* ============================================================
   Page-load intro overlay — cinematic staggered reveal (~2.5s)
   Plays once per browser session (see the inline decision script
   in <head>), which adds .intro-on to <html> before first paint.
   Without that class the overlay stays hidden and the hero paints
   immediately — this is what keeps LCP fast on every repeat view,
   every prefers-reduced-motion visit, and any sessionStorage
   failure (private browsing, etc).
   ============================================================ */
.intro { display: none; }
.intro-on .intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-navy);
  animation: introOut 2.5s ease forwards;
}

.skip-intro-btn {
  position: absolute;
  top: max(1.5rem, env(safe-area-inset-top, 0px));
  right: 1.5rem;
  z-index: 20;
  padding: 0.6rem 1.1rem;
  background: rgba(247, 245, 243, 0.08);
  border: 1px solid rgba(247, 245, 243, 0.28);
  color: var(--color-ivory);
  border-radius: 9999px;
  font-family: 'Tenor Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.skip-intro-btn:hover { background: rgba(247, 245, 243, 0.15); border-color: rgba(202, 170, 152, 0.6); }

/* Ambient background — dot-grid, soft glow, arc rings — with a slow drift */
.intro-ambient {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: introIn 0.55s ease-out .05s forwards,
             introDrift 2.5s linear forwards;
}
.intro-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(202, 170, 152, 0.13) 1px, transparent 1px);
  background-size: 26px 26px;
}
.intro-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 58% 48% at 50% 50%, rgba(202, 170, 152, 0.22), transparent 70%);
  animation: introBloom 2.5s ease-out forwards;
}
.intro-arc {
  position: absolute;
  pointer-events: none;
}
.intro-arc-a { top: -170px; right: -170px; width: 480px; height: 480px; }
.intro-arc-b { bottom: -210px; left: -210px; width: 560px; height: 560px; }

/* Cinematic vignette */
.intro-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 72% 62% at 50% 50%, transparent 48%, rgba(0, 0, 0, 0.52) 100%);
  opacity: 0;
  animation: introIn 0.7s ease-out .125s forwards;
}

/* Letterbox bars — slide in, hold, retract */
.intro-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 12vh;
  background: #12161f;
}
.intro-bar-top    { top: 0;    animation: introBarTop    2.5s cubic-bezier(.7, 0, .2, 1) forwards; }
.intro-bar-bottom { bottom: 0; animation: introBarBottom 2.5s cubic-bezier(.7, 0, .2, 1) forwards; }

/* Logo — gentle cinematic push-in */
.intro-logo {
  position: relative;
  width: min(720px, 88vw);
  aspect-ratio: 540 / 168;
  animation: introLogoDrift 2.5s linear forwards;
}
.intro-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.intro-wordmark  { animation: introWordmarkIn  0.55s cubic-bezier(.16, 1, .3, 1)  .425s forwards; }
.intro-underline { animation: introUnderlineIn 0.4s  cubic-bezier(.22, 1, .36, 1) .85s  forwards; }
.intro-name      { animation: introUnfurl      0.45s cubic-bezier(.16, 1, .3, 1)  .975s forwards; }
.intro-tagline   { animation: introUnfurl      0.45s cubic-bezier(.16, 1, .3, 1)  1.225s forwards; }

/* Hero content — visible immediately by default; only the .intro-on path
   (first view in a session) delays it behind the overlay hand-off. */
.hero-rise { opacity: 1; }
.intro-on .hero-rise {
  opacity: 0;
  animation: heroRise 0.5s cubic-bezier(.16, 1, .3, 1) 1.925s forwards;
}
.intro-on .hero-rise[data-delay="1"] { animation-delay: 2.0s; }
.intro-on .hero-rise[data-delay="2"] { animation-delay: 2.075s; }
.intro-on .hero-rise[data-delay="3"] { animation-delay: 2.15s; }
.intro-on .hero-rise[data-delay="4"] { animation-delay: 2.225s; }

@keyframes introIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes introDrift {
  from { transform: scale(1.03); }
  to   { transform: scale(1.18); }
}
@keyframes introBloom {
  0%   { opacity: .25; transform: scale(.8); }
  48%  { opacity: 1;   transform: scale(1.08); }
  100% { opacity: .9;  transform: scale(1); }
}
@keyframes introLogoDrift {
  from { transform: scale(.95); }
  to   { transform: scale(1.06); }
}
@keyframes introWordmarkIn {
  from { opacity: 0; transform: translateY(36px) scale(.96); filter: blur(10px); }
  to   { opacity: 1; transform: translateY(0) scale(1);      filter: blur(0); }
}
@keyframes introUnderlineIn {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}
@keyframes introUnfurl {
  from { opacity: 0; clip-path: inset(0 50% 0 50%); filter: blur(6px); }
  to   { opacity: 1; clip-path: inset(0 0 0 0);     filter: blur(0); }
}
@keyframes heroRise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes introBarTop {
  0%        { transform: translateY(-100%); }
  10%, 75%  { transform: translateY(0); }
  86%, 100% { transform: translateY(-100%); }
}
@keyframes introBarBottom {
  0%        { transform: translateY(100%); }
  10%, 75%  { transform: translateY(0); }
  86%, 100% { transform: translateY(100%); }
}
@keyframes introOut {
  0%, 78%  { opacity: 1; visibility: visible; }
  100%     { opacity: 0; visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .intro { display: none !important; }
  .hero-rise { opacity: 1 !important; animation: none !important; }
}

} /* @layer components */
