/* ============================================================
   NEXTERA — design tokens & bespoke animation system
   ============================================================ */

:root {
  color-scheme: dark;

  --pine-950: #08201A;
  --pine-900: #0B2A20;
  --pine-800: #0F382B;
  --pine-700: #154A38;
  --pine-600: #1E5C46;
  --pine-500: #2A7157;

  --hairline: rgba(228, 205, 148, 0.14);
  --hairline-strong: rgba(228, 205, 148, 0.28);

  --gold-200: #F6E8C7;
  --gold-300: #F0D9A0;
  --gold-400: #E4C077;
  --gold-500: #CD9E4C;
  --gold-600: #AD7C33;

  --alabaster: #F6F1E6;
  --alabaster-dim: #DCD4C2;
  --ink: #0B1F17;

  --success: #4ADE9C;
  --success-dim: #2C8A63;
  --risk: #E2695A;
  --risk-dim: #7A3A32;
  --warn: #E4B95A;

  --font-serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --shadow-soft: 0 1px 2px rgba(0,0,0,0.4), 0 24px 48px -16px rgba(0,0,0,0.55);
  --shadow-lift: 0 1px 1px rgba(0,0,0,0.5), 0 40px 80px -24px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; }

body {
  background: var(--pine-950);
  color: var(--alabaster);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--gold-500); color: var(--ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--pine-950); }
::-webkit-scrollbar-thumb { background: var(--pine-600); border-radius: 999px; border: 2px solid var(--pine-950); }

.font-serif-display { font-family: var(--font-serif); }
.font-sans-ui { font-family: var(--font-sans); }

/* Background texture: faint radiating lines echoing the mark, + grain */
.bg-nextera-field {
  position: relative;
  background:
    radial-gradient(ellipse 60% 50% at 85% -10%, rgba(228,192,119,0.10), transparent 60%),
    radial-gradient(ellipse 50% 40% at -10% 110%, rgba(42,113,87,0.35), transparent 60%),
    var(--pine-950);
}

.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Glass surfaces */
.glass {
  background: linear-gradient(180deg, rgba(246,241,230,0.08), rgba(246,241,230,0.03));
  border: 1px solid var(--hairline);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-soft);
}

.glass-strong {
  background: linear-gradient(180deg, rgba(246,241,230,0.11), rgba(246,241,230,0.045));
  border: 1px solid var(--hairline-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-lift);
}

.hairline { border-color: var(--hairline); }

/* Reveal-on-scroll: SAFE BY DEFAULT — resting state is fully visible (opacity:1).
   IntersectionObserver only *adds* a bounded, self-completing CSS animation;
   if JS never runs (slow load, error, link-preview screenshot), content still
   renders at full opacity immediately instead of staying invisible. */
.reveal { opacity: 1; }
.reveal.reveal-play {
  animation: revealIn 0.8s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes revealIn {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal.reveal-play, .fade-up-in, .fade-in { animation: none !important; }
  .float-y, .float-y-delay, .adv-progress::after { animation: none !important; }
}

:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3 { text-wrap: balance; }

/* Radiating ray motif (from the mark) */
.ray-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.ray-field span {
  position: absolute;
  left: 50%;
  top: 8%;
  width: 1px;
  height: 130%;
  background: linear-gradient(180deg, rgba(228,192,119,0.5), transparent 70%);
  transform-origin: top center;
}

/* Cinematic frame for hero and feature visuals */
.cine-frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  background:
    radial-gradient(120% 100% at 20% 0%, rgba(228,192,119,0.16), transparent 55%),
    radial-gradient(100% 90% at 85% 100%, rgba(42,113,87,0.55), transparent 60%),
    linear-gradient(155deg, #0C2A20, #081C16 70%);
  box-shadow: var(--shadow-lift);
}
.cine-frame::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 5px);
  mix-blend-mode: overlay;
  opacity: 0.5;
}
/* Hərəkətli vizual: video + poster, saytın zümrüd/qızıl palitrasına uyğunlaşdırılmış */
.mv { position: absolute; inset: 0; overflow: hidden; background: #0A1B30; }
.mv-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mv-grade { position: absolute; inset: 0; background: rgba(14, 74, 56, 0.34); mix-blend-mode: soft-light; }
.mv-shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 52%, rgba(8, 32, 26, 0.6) 100%),
    linear-gradient(180deg, rgba(8, 32, 26, 0.32) 0%, transparent 26%, transparent 60%, rgba(8, 32, 26, 0.66) 100%);
}

/* Floating glass stat chips */
.float-y { animation: floatY 6s ease-in-out infinite; }
.float-y-delay { animation: floatY 6s ease-in-out infinite; animation-delay: -3s; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Pill nav ---------- */
.pill-nav-item {
  position: relative;
  color: var(--alabaster-dim);
  transition: color 0.3s ease;
}
.pill-nav-item.is-active { color: var(--ink); }
.pill-nav-indicator {
  transition: transform 0.45s cubic-bezier(0.16,1,0.3,1), width 0.45s cubic-bezier(0.16,1,0.3,1);
}

/* ============================================================
   Solutions — 4 strategic simulations (hover-triggered, pure CSS)
   ============================================================ */
.sim-card { position: relative; }

/* Service cards share row tracks (stage / icon / title / tagline / list) so
   each part lines up across the row; the card's five children are its rows. */
.svc-card {
  display: grid;
  grid-row: span 5;
  grid-template-rows: subgrid;
  row-gap: 0;
}
.sim-stage {
  position: relative;
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(120% 100% at 50% 0%, rgba(228,192,119,0.07), transparent 60%), rgba(8,28,22,0.55);
  border: 1px solid var(--hairline);
}

/* -- Sim 1: Compliance laser scan -- */
.sim1-doc {
  position: absolute;
  width: 74px; height: 92px;
  border-radius: 6px;
  background: #EFE7D2;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
  transition: transform 0.9s cubic-bezier(0.16,1,0.3,1), opacity 0.6s ease;
}
.sim1-doc::before {
  content: "";
  position: absolute; left: 10px; right: 10px; top: 14px; height: 4px;
  background: rgba(11,31,23,0.18); border-radius: 2px;
  box-shadow: 0 10px 0 rgba(11,31,23,0.18), 0 20px 0 rgba(11,31,23,0.18), 0 30px 0 rgba(11,31,23,0.12);
}
.sim1-flag {
  position: absolute; top: -8px; right: -6px;
  width: 20px; height: 20px; border-radius: 999px;
  background: var(--risk);
  color: #2B0C08; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.4s ease 0.5s, transform 0.4s ease 0.5s;
}
.sim-stage .sim1-d1 { left: 18px; top: 70px; transform: rotate(-9deg); z-index: 3; }
.sim-stage .sim1-d2 { left: 46px; top: 56px; transform: rotate(4deg); z-index: 2; }
.sim-stage .sim1-d3 { left: 74px; top: 66px; transform: rotate(-3deg); z-index: 1; }
.sim1-beam {
  position: absolute; left: 0; right: 0; top: -20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-300), var(--gold-500), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sim1-shield {
  position: absolute; right: 20px; top: 50%;
  width: 84px; height: 84px;
  transform: translateY(-50%) scale(0.8);
  opacity: 0;
  transition: opacity 0.6s ease 0.7s, transform 0.6s cubic-bezier(0.16,1,0.3,1) 0.7s;
}
.sim-card:hover .sim1-beam { opacity: 1; animation: sim1Sweep 1.4s cubic-bezier(0.5,0,0.5,1) 1; }
.sim-card:hover .sim1-d1 { transform: translate(48px,-6px) rotate(0deg) scale(0.5); opacity: 0; }
.sim-card:hover .sim1-d2 { transform: translate(22px,4px) rotate(0deg) scale(0.5); opacity: 0; }
.sim-card:hover .sim1-d3 { transform: translate(-2px,-2px) rotate(0deg) scale(0.5); opacity: 0; }
.sim-card:hover .sim1-flag { background: var(--success); }
.sim-card:hover .sim1-shield { opacity: 1; transform: translateY(-50%) scale(1); }
@keyframes sim1Sweep { from { top: -20%; } to { top: 110%; } }

/* -- Sim 2: Risk timeline checkpoint -- */
.sim2-risk-drop {
  transition: opacity 0.5s ease 0.5s, transform 0.5s ease 0.5s;
}
.sim2-checkpoint {
  opacity: 0;
  transition: opacity 0.4s ease 0.35s, transform 0.4s cubic-bezier(0.16,1,0.3,1) 0.35s;
  transform: scale(0.5);
}
.sim2-safe-line { opacity: 0; transition: opacity 0.5s ease 0.6s; }
.sim2-risk-line { transition: opacity 0.4s ease 0.5s; }
.sim-card:hover .sim2-checkpoint { opacity: 1; transform: scale(1); }
.sim-card:hover .sim2-risk-drop { opacity: 0; transform: translateY(6px); }
.sim-card:hover .sim2-risk-line { opacity: 0; }
.sim-card:hover .sim2-safe-line { opacity: 1; }

/* -- Sim 3: Logistics magnetism -- */
.sim3-block {
  position: absolute;
  border-radius: 5px;
  background: linear-gradient(155deg, #2A7157, #154A38);
  border: 1px solid rgba(228,192,119,0.25);
  transition: transform 1s cubic-bezier(0.16,1,0.3,1), opacity 0.6s ease, border-radius 0.6s ease;
}
.sim3-b1 { left: 50%; top: 50%; width: 42px; height: 34px; margin: -17px 0 0 -21px; transform: translate(-64px,-38px) rotate(-18deg); }
.sim3-b2 { left: 50%; top: 50%; width: 30px; height: 44px; margin: -22px 0 0 -15px; transform: translate(58px,-46px) rotate(14deg); }
.sim3-b3 { left: 50%; top: 50%; width: 48px; height: 26px; margin: -13px 0 0 -24px; transform: translate(-70px,42px) rotate(9deg); }
.sim3-b4 { left: 50%; top: 50%; width: 34px; height: 40px; margin: -20px 0 0 -17px; transform: translate(62px,44px) rotate(-11deg); }
.sim-card:hover .sim3-b1 { transform: translate(0,0) rotate(0deg); }
.sim-card:hover .sim3-b2 { transform: translate(0,0) rotate(0deg); }
.sim-card:hover .sim3-b3 { transform: translate(0,0) rotate(0deg); }
.sim-card:hover .sim3-b4 { transform: translate(0,0) rotate(0deg); }
.sim3-cube {
  position: absolute; inset: 0; margin: auto;
  width: 56px; height: 56px;
  border-radius: 8px;
  border: 1.5px solid var(--gold-300);
  opacity: 0;
  transition: opacity 0.5s ease 0.7s;
}
.sim-card:hover .sim3-cube { opacity: 1; }
.sim3-barcode {
  opacity: 0;
  transition: opacity 0.5s ease 1.1s;
}
.sim-card:hover .sim3-barcode { opacity: 1; }

/* -- Sim 4: Orbit to engine core -- */
.sim4-orbit {
  position: absolute;
  transition: transform 1s cubic-bezier(0.16,1,0.3,1), opacity 0.7s ease;
}
.sim4-o1 { left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; transform: translate(-56px,-32px) rotate(-8deg); }
.sim4-o2 { left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; transform: translate(50px,-16px) rotate(10deg); }
.sim4-o3 { left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; transform: translate(-8px,50px) rotate(6deg); }
.sim-card:hover .sim4-o1 { transform: translate(-8px,-6px) scale(0.35); opacity: 0; }
.sim-card:hover .sim4-o2 { transform: translate(8px,4px) scale(0.35); opacity: 0; }
.sim-card:hover .sim4-o3 { transform: translate(-2px,8px) scale(0.35); opacity: 0; }
.sim4-core {
  position: absolute; inset: 0; margin: auto;
  width: 64px; height: 64px; border-radius: 999px;
  border: 1.5px solid var(--hairline-strong);
  background: radial-gradient(circle at 35% 30%, rgba(228,192,119,0.35), rgba(21,74,56,0.4));
  transition: transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.sim4-core img { transition: transform 0.7s cubic-bezier(0.16,1,0.3,1); }
.sim-card:hover .sim4-core { transform: rotate(120deg); }
.sim-card:hover .sim4-core img { transform: rotate(-120deg); }
.sim4-beam {
  position: absolute; left: 50%; bottom: 50%; width: 3px; height: 0;
  background: linear-gradient(180deg, transparent, var(--gold-300));
  transform: translateX(-50%);
  opacity: 0;
  transition: height 0.7s cubic-bezier(0.16,1,0.3,1) 0.5s, opacity 0.3s ease 0.5s;
}
.sim-card:hover .sim4-beam { height: 90px; opacity: 1; }

/* ============================================================
   Alətlər — Gömrük və Xarici Ticarət Müşaviri
   Matte surfaces, 1px gold-grey hairlines, no glow.
   ============================================================ */
.eyebrow {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.5;
}
.eyebrow-sm { font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; }

.adv-panel {
  display: flex;
  flex-direction: column;
  height: min(82vh, 820px);
  min-height: 540px;
  background: #0A261D;
  border: 1px solid var(--hairline-strong);
  border-radius: 22px;
  overflow: hidden;
}
.adv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 20px;
  background: rgba(8, 32, 26, 0.75);
  border-bottom: 1px solid var(--hairline);
}
.adv-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 18px; }
@media (min-width: 768px) { .adv-log { padding: 32px 34px; } }
.adv-compose { padding: 14px 16px 12px; background: rgba(8, 32, 26, 0.75); border-top: 1px solid var(--hairline); }
.adv-row { display: flex; align-items: flex-end; gap: 10px; }
.adv-input {
  flex: 1 1 auto; min-width: 0; resize: none;
  max-height: 140px;
  padding: 13px 16px;
  font: inherit; font-size: 15px; line-height: 1.5;
  color: var(--alabaster);
  background: rgba(8, 28, 22, 0.9);
  border: 1px solid var(--hairline-strong);
  border-radius: 16px;
  transition: border-color 0.25s ease;
}
.adv-input::placeholder { color: rgba(220, 212, 194, 0.42); }
.adv-input:focus { outline: none; border-color: rgba(228, 192, 119, 0.65); }
.adv-input:disabled { opacity: 0.55; cursor: not-allowed; }
.adv-send {
  flex: none; width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); background: var(--gold-400);
  border: 1px solid rgba(240, 217, 160, 0.7);
  border-radius: 14px;
  transition: background-color 0.25s ease, opacity 0.25s ease;
}
.adv-send:hover:not(:disabled) { background: var(--gold-300); }
.adv-send:disabled { opacity: 0.4; cursor: not-allowed; }
.adv-note { margin-top: 9px; font-size: 11.5px; line-height: 1.5; color: rgba(220, 212, 194, 0.6); }

.adv-starter {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; text-align: left;
  padding: 16px 18px;
  font-size: 14.5px; line-height: 1.5; color: var(--alabaster);
  background: rgba(246, 241, 230, 0.025);
  border: 1px solid var(--hairline-strong);
  border-radius: 16px;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.adv-starter:hover:not(:disabled) { border-color: rgba(228, 192, 119, 0.55); background: rgba(246, 241, 230, 0.05); }
.adv-starter:disabled { opacity: 0.5; cursor: not-allowed; }

.adv-user {
  align-self: flex-end;
  max-width: min(86%, 560px);
  padding: 12px 16px;
  font-size: 15px; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
  background: rgba(228, 192, 119, 0.07);
  border: 1px solid var(--hairline-strong);
  border-radius: 18px 18px 6px 18px;
}
.adv-answer { padding-left: 16px; border-left: 1px solid var(--hairline-strong); }
.adv-warn { font-size: 13.5px; line-height: 1.6; color: var(--alabaster-dim); }

.adv-progress { position: relative; height: 1px; overflow: hidden; background: var(--hairline); }
.adv-progress::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 34%;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
  animation: advSlide 1.7s ease-in-out infinite;
}
@keyframes advSlide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.adv-lead {
  padding: 22px 20px;
  background: #0C2B21;
  border: 1px solid var(--hairline-strong);
  border-radius: 18px;
}
@media (min-width: 768px) { .adv-lead { padding: 28px 30px; } }
.adv-label { display: block; margin-bottom: 7px; font-size: 11.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-300); }
.adv-field {
  width: 100%;
  padding: 12px 15px;
  font: inherit; font-size: 15px; color: var(--alabaster);
  background: rgba(8, 28, 22, 0.9);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  transition: border-color 0.25s ease;
}
.adv-field::placeholder { color: rgba(220, 212, 194, 0.38); }
.adv-field:focus { outline: none; border-color: rgba(228, 192, 119, 0.65); }
.adv-field[aria-invalid="true"],
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: rgba(226, 105, 90, 0.7); }
.adv-err { margin-top: 6px; font-size: 12.5px; color: #F0A097; }
.adv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Rendered markdown (answers) */
.adv-md { font-size: 15px; line-height: 1.72; color: var(--alabaster); overflow-wrap: anywhere; }
.adv-md p { margin: 0 0 12px; }
.adv-md > :last-child { margin-bottom: 0; }
.adv-md strong { font-weight: 600; color: var(--gold-200); }
.adv-md em { font-style: italic; }
.adv-md .adv-h {
  margin: 24px 0 9px; padding-top: 16px;
  font-family: var(--font-serif); font-size: 20px; font-weight: 400; line-height: 1.3;
  color: var(--gold-200);
  border-top: 1px solid var(--hairline);
}
.adv-md > .adv-h:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.adv-md ul, .adv-md ol { margin: 0 0 12px; padding: 0; }
.adv-md ul { list-style: none; }
.adv-md ul > li { position: relative; padding-left: 20px; }
.adv-md ul > li::before { content: ""; position: absolute; left: 0; top: 0.9em; width: 9px; height: 1px; background: var(--gold-500); }
.adv-md ol { padding-left: 1.4em; }
.adv-md ol > li::marker { color: var(--gold-400); }
.adv-md li { margin: 5px 0; }
.adv-md li > ul, .adv-md li > ol { margin: 4px 0 0; }
.adv-md blockquote {
  margin: 20px 0 0; padding-top: 12px;
  font-size: 12.5px; line-height: 1.6; color: rgba(220, 212, 194, 0.7);
  border-top: 1px solid var(--hairline);
}
.adv-md hr { margin: 18px 0; border: 0; border-top: 1px solid var(--hairline); }
.adv-md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; padding: 1px 5px; background: rgba(246, 241, 230, 0.08); border-radius: 4px; }
.adv-md a { color: var(--gold-300); text-decoration: underline; text-underline-offset: 3px; }
.adv-md .adv-table { overflow-x: auto; margin: 0 0 12px; }
.adv-md table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.adv-md th, .adv-md td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--hairline); }
.adv-md th { font-weight: 600; color: var(--gold-200); }

/* Scrollbar-safe marquee-less utility for section labels */
.tracked { letter-spacing: 0.14em; }

@media (max-width: 640px) {
  .sim-stage { height: 168px; }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes dash {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up-in { animation: fadeUpIn 0.6s cubic-bezier(0.16,1,0.3,1) both; }

@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.fade-in { animation: fadeIn 0.5s ease both; }
