/* ALMAi brand tokens — taken from the official palette (#153A6B / #F7C600) */
:root {
  --blue: #153a6b;
  --blue-900: #0b2347;
  --blue-950: #071731;
  --blue-700: #1e4f8f;
  --blue-100: #e7eef8;
  --yellow: #f7c600;
  --yellow-600: #d9ad00;
  --white: #ffffff;
  --paper: #f6f8fb;
  --ink: #0f2747;
  --muted: #5a6b85;
  --line: rgba(21, 58, 107, 0.12);

  --font-display: "Michroma", "Montserrat", sans-serif;
  --font-body: "Montserrat", system-ui, -apple-system, sans-serif;

  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 20px 50px -20px rgba(11, 35, 71, 0.35);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-loading { overflow: hidden; }

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

::selection { background: var(--yellow); color: var(--blue-950); }

.container { width: min(1200px, 100% - 48px); margin-inline: auto; }
.accent { color: var(--yellow); }
.brand { white-space: nowrap; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; gap: 28px; justify-items: center;
  background: var(--white);
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.loader__mark { width: 96px; animation: pulse 1.4s var(--ease) infinite; }
.loader__bar { width: 140px; height: 3px; background: var(--blue-100); border-radius: 3px; overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--blue), var(--yellow)); animation: load 1s var(--ease) infinite; }
body:not(.is-loading) .loader { opacity: 0; visibility: hidden; }

@keyframes pulse { 50% { transform: scale(1.08); filter: drop-shadow(0 0 18px rgba(247, 198, 0, 0.55)); } }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Cursor glow + progress ---------- */
.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 198, 0, 0.22), rgba(247, 198, 0, 0.06) 40%, transparent 68%);
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity 0.4s;
}
body.has-pointer .cursor-glow { opacity: 1; }

.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 60; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--blue), var(--yellow));
  transform-origin: left; transform: scaleX(0);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 28px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em;
  overflow: hidden; isolation: isolate;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), color 0.35s, background 0.35s, border-color 0.35s;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.35s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--yellow); transform: translateY(101%);
  transition: transform 0.45s var(--ease);
}
.btn:hover::before { transform: translateY(0); }
.btn--primary { background: var(--blue); color: var(--white); box-shadow: 0 12px 30px -12px rgba(21, 58, 107, 0.7); }
.btn--primary:hover { color: var(--blue-950); }
.btn--ghost { border-color: var(--line); color: var(--blue); background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(8px); }
.btn--ghost svg { fill: currentColor; stroke: none; }
.btn--ghost:hover { border-color: var(--yellow); color: var(--blue-950); }
.btn--yellow { background: var(--yellow); color: var(--blue-950); justify-content: center; }
.btn--yellow::before { background: var(--white); }
.btn--sm { padding: 11px 20px; font-size: 0.85rem; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background 0.4s, box-shadow 0.4s, padding 0.4s;
  padding: 22px 0;
}
.nav.is-scrolled { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); padding: 12px 0; }
.nav:not(.is-scrolled) .nav__inner > .btn--primary { background: var(--yellow); color: var(--blue-950); }
.nav:not(.is-scrolled) .nav__inner > .btn--primary::before { background: var(--white); }
.nav__inner { display: flex; align-items: center; gap: 32px; }
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__mark { width: 40px; transition: transform 0.6s var(--ease); }
.nav__brand:hover .nav__mark { transform: rotate(-12deg) scale(1.1); }
.nav__word { font-family: var(--font-display); font-size: 1.35rem; color: var(--blue); letter-spacing: 0.02em; }
.nav__links { display: flex; gap: 30px; margin-left: auto; }
.nav__links a { position: relative; font-weight: 600; font-size: 0.9rem; color: var(--blue); padding: 4px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  background: var(--yellow); transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }
/* Co-brand lockup: ALMAi leads, UNIMAYOR sits to its right as the host institution */
.cobrand { display: flex; align-items: center; gap: 8px; margin-left: 6px; padding-left: 14px; border-left: 1.5px solid var(--line); }
.cobrand__emblem { width: auto; height: 34px; }
.cobrand__name { font-family: var(--font-body); font-weight: 800; font-size: 1.02rem; letter-spacing: 0.01em; color: #2a588d; }
.footer__brand { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 4vw, 30px); flex-wrap: nowrap; }
.footer__logo { margin: 0; }
.cobrand--footer { margin: 0; padding-left: 30px; gap: 14px; border-left-color: rgba(255, 255, 255, 0.2); align-self: stretch; }
.cobrand--footer .cobrand__emblem { height: 72px; }
.cobrand--footer .cobrand__name { font-size: 1.7rem; color: var(--white); }
.nav__toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: none; position: relative; }
.nav__toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--blue); transition: transform 0.35s var(--ease); }
.nav__toggle span:first-child { top: 17px; }
.nav__toggle span:last-child { top: 25px; }
.nav.is-open .nav__toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font-family: var(--font-display); font-size: 0.68rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--blue);
}
.eyebrow--light { color: var(--white); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px rgba(247, 198, 0, 0.25); animation: blink 2.2s infinite; }
@keyframes blink { 50% { box-shadow: 0 0 0 8px rgba(247, 198, 0, 0); } }

.section { position: relative; padding: clamp(80px, 11vw, 140px) 0; z-index: 1; }
.section__head { max-width: 720px; margin-bottom: 56px; }
.section__title {
  margin: 0 0 20px; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem); line-height: 1.25; color: var(--blue); letter-spacing: -0.01em;
}
.section__sub { color: var(--muted); font-size: 1.05rem; margin: 0; }
.hl { position: relative; white-space: nowrap; z-index: 0; }
.hl::after {
  content: ""; position: absolute; left: -2px; right: -2px; bottom: 0.08em; height: 0.32em; z-index: -1;
  background: rgba(247, 198, 0, 0.55); transform: scaleX(0); transform-origin: left;
  transition: transform 0.9s var(--ease) 0.3s;
}
.is-visible .hl::after, .is-visible.hl::after, .reveal.is-visible .hl::after { transform: scaleX(1); }
.hl--yellow { color: var(--yellow); }
.hl--yellow::after { background: rgba(247, 198, 0, 0.18); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; padding: 140px 0 100px; overflow: hidden;
  background: linear-gradient(180deg, var(--white) 0%, var(--paper) 100%);
}
.hero__network { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.hero__shape { position: absolute; z-index: 0; pointer-events: none; }
.hero__shape--blue {
  right: -8%; top: -10%; width: 46%; height: 130%;
  background: var(--blue); clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 100%);
}
.hero__shape--yellow {
  right: calc(-8% + 46% - 6%); top: -10%; width: 10%; height: 130%;
  background: var(--yellow); clip-path: polygon(70% 0, 100% 0, 30% 100%, 0 100%);
  transform: translateX(-40%);
}
.hero__grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero__copy { translate: var(--cx, 0) var(--cy, 0); transition: translate 0.4s ease-out; }
.hero__title {
  margin: 0 0 24px; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.18; color: var(--blue); letter-spacing: -0.02em;
}
.hero__lead { max-width: 540px; font-size: 1.12rem; color: var(--muted); margin: 0 0 36px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 56px; }
.hero__stats { display: flex; gap: 44px; margin: 0; }
.hero__stats div { border-left: 3px solid var(--yellow); padding-left: 16px; }
.hero__stats dt { font-family: var(--font-display); font-size: 1.7rem; color: var(--blue); line-height: 1.2; }
.hero__stats dd { margin: 4px 0 0; font-size: 0.82rem; color: var(--muted); font-weight: 500; }

/* Institutional endorsement: present but secondary to the ALMAi brand */
.endorse {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 40px; padding: 10px 20px 10px 10px;
  border-radius: 16px; background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); backdrop-filter: blur(8px);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s;
}
.endorse:hover { transform: translateY(-3px); border-color: var(--yellow); box-shadow: 0 14px 30px -18px rgba(21, 58, 107, 0.5); }
.endorse__logo { width: auto; height: 58px; }
.endorse p { margin: 0; font-size: 0.78rem; line-height: 1.45; color: var(--muted); }
.endorse strong { color: var(--blue); font-weight: 700; }
.inst { color: var(--blue); font-weight: 700; }

.hero__visual { display: grid; place-items: center; }
.brain {
  position: relative; width: min(440px, 80vw); aspect-ratio: 1; display: grid; place-items: center;
  border-radius: 50%; background: var(--white);
  box-shadow: 0 40px 80px -30px rgba(7, 23, 49, 0.6), inset 0 0 0 1px var(--line);
  transform-style: preserve-3d; transition: transform 0.25s ease-out;
}
.brain__mark { width: 62%; transform: translateZ(60px); animation: float 6s ease-in-out infinite; filter: drop-shadow(0 18px 24px rgba(21, 58, 107, 0.22)); }
.brain__halo { position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, rgba(247, 198, 0, 0.22), transparent 70%); animation: breathe 4s ease-in-out infinite; }
.brain__ring { position: absolute; border-radius: 50%; border: 1.5px dashed rgba(21, 58, 107, 0.25); }
.brain__ring--1 { inset: -6%; animation: spin 40s linear infinite; }
.brain__ring--2 { inset: -16%; border-style: solid; border-color: rgba(247, 198, 0, 0.45); border-right-color: transparent; border-bottom-color: transparent; animation: spin 14s linear infinite reverse; }
.brain__chip {
  position: absolute; translate: var(--px, 0) var(--py, 0); transition: translate 0.3s ease-out; padding: 10px 18px; border-radius: 999px; transform: translateZ(90px);
  font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  box-shadow: var(--shadow);
}
.brain__chip--a { left: -6%; top: 22%; background: var(--blue); color: var(--white); }
.brain__chip--b { right: -6%; bottom: 20%; background: var(--yellow); color: var(--blue-950); }

@keyframes float { 50% { transform: translateZ(60px) translateY(-14px); } }
@keyframes breathe { 50% { transform: scale(1.12); opacity: 0.7; } }
@keyframes spin { to { transform: rotate(360deg); } }


/* ---------- Tilt ---------- */
.tilt { transform-style: preserve-3d; transition: transform 0.25s ease-out; will-change: transform; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.about__media { position: relative; margin: 0; }
.about__img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.about__img img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; transition: transform 1.2s var(--ease); }
.about__media:hover .about__img img { transform: scale(1.05); }
.about__badge {
  position: absolute; right: -24px; bottom: -28px; display: flex; align-items: center; gap: 14px;
  padding: 16px 22px; border-radius: 16px; background: var(--blue); color: var(--white); box-shadow: var(--shadow);
  font-size: 0.9rem; max-width: 260px;
}
.about__badge img { width: 46px; }
.about__badge strong { color: var(--yellow); }
.about__copy > p { color: var(--muted); font-size: 1.05rem; }
.checks { list-style: none; padding: 0; margin: 28px 0 36px; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 34px; font-weight: 600; color: var(--blue); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23153A6B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.values { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.value {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); font-weight: 600; font-size: 0.88rem; color: var(--blue);
  transition: border-color 0.3s, transform 0.4s var(--ease), box-shadow 0.4s;
}
.value:hover { border-color: var(--yellow); transform: translateY(-3px); box-shadow: 0 12px 24px -16px rgba(21, 58, 107, 0.5); }
.value__icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1.5px solid var(--blue); transition: background 0.3s, color 0.3s, transform 0.5s var(--ease); }
.value__icon svg { width: 18px; height: 18px; }
.value:hover .value__icon { background: var(--blue); color: var(--yellow); transform: rotate(-10deg); }

/* ---------- Mission & Vision (manifesto band) ---------- */
.purpose { background: var(--blue-950); color: var(--white); overflow: hidden; }
.purpose::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px circle at 10% 10%, rgba(30, 79, 143, 0.75), transparent 60%),
    radial-gradient(500px circle at 92% 90%, rgba(247, 198, 0, 0.14), transparent 60%);
}
.purpose__eyebrow { display: flex; justify-content: center; margin-bottom: 72px; }
.purpose__cols { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 160px; }
/* Divider sits between the columns only, so it never crosses the eyebrow */
.purpose__slash {
  position: absolute; left: 50%; top: -24px; bottom: -24px; width: 8px; border-radius: 8px;
  background: var(--yellow); transform: translateX(-50%) rotate(10deg);
}
.purpose__col--end { text-align: right; }
.purpose__label {
  display: inline-block; margin-bottom: 20px; padding: 6px 16px; border-radius: 999px;
  font-family: var(--font-display); font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase;
  background: var(--white); color: var(--blue);
}
.purpose__label--yellow { background: var(--yellow); color: var(--blue-950); }
.purpose__quote {
  margin: 0 0 28px; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem); line-height: 1.35; color: var(--white);
}
.purpose__quote em { font-style: normal; color: var(--yellow); }
.purpose__text { max-width: 440px; margin: 0; color: rgba(255, 255, 255, 0.75); font-size: 1.02rem; }
.purpose__text strong { color: var(--white); font-weight: 700; }
.purpose__col--end .purpose__text { margin-left: auto; }
@media (max-width: 1024px) {
  .purpose__cols { grid-template-columns: 1fr; gap: 64px; }
  .purpose__col--end { text-align: left; }
  .purpose__col--end .purpose__text { margin-left: 0; }
  .purpose__slash { display: none; }
}

/* ---------- Areas ---------- */
.areas { background: var(--paper); }
.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.card { grid-column: span 2; }
.card:nth-child(4), .card:nth-child(5) { grid-column: span 3; }
.card {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 36px 32px; border-radius: var(--radius); background: var(--white);
  border: 1px solid var(--line);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.4s, opacity 0.9s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(247, 198, 0, 0.18), transparent 60%);
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow); border-color: rgba(247, 198, 0, 0.6); }
.card:hover::before { opacity: 1; }
.card__letter {
  position: absolute; right: 18px; top: -10px; z-index: -1;
  font-family: var(--font-display); font-size: 7.5rem; line-height: 1; color: var(--blue-100);
  transition: transform 0.6s var(--ease), color 0.4s;
}
.card:hover .card__letter { transform: translateY(12px) scale(1.06); color: rgba(247, 198, 0, 0.3); }
.card__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--blue); color: var(--yellow); margin-bottom: 26px; transition: transform 0.5s var(--ease); }
.card__icon svg { width: 26px; height: 26px; }
.card:hover .card__icon { transform: rotate(-8deg) scale(1.08); }
.card h3 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; color: var(--blue); letter-spacing: 0.02em; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card--featured { background: var(--blue); border-color: var(--blue); }
.card--featured h3 { color: var(--white); }
.card--featured p { color: rgba(255, 255, 255, 0.75); }
.card--featured .card__icon { background: var(--yellow); color: var(--blue); }
.card--featured .card__letter { color: rgba(247, 198, 0, 0.2); }

/* ---------- Video ---------- */
.brandvideo { background: var(--blue-950); color: var(--white); overflow: hidden; }
.brandvideo::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px circle at 15% 10%, rgba(30, 79, 143, 0.7), transparent 60%),
    radial-gradient(500px circle at 90% 90%, rgba(247, 198, 0, 0.14), transparent 60%);
}
.brandvideo .container { position: relative; }
.brandvideo .section__title { color: var(--white); }
.section__head--light { text-align: center; margin-inline: auto; }
.player {
  position: relative; border-radius: 26px; overflow: hidden; cursor: pointer;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
  max-width: 1000px; margin-inline: auto; background: var(--white);
}
.player video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.player::after { content: ""; position: absolute; inset: 0; background: rgba(7, 23, 49, 0.06); transition: opacity 0.4s; pointer-events: none; }
.player.is-playing::after { opacity: 0; }
.player__play {
  position: absolute; left: 50%; top: 50%; z-index: 2; width: 96px; height: 96px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: var(--yellow); color: var(--blue-950);
  transform: translate(-50%, -50%); box-shadow: 0 0 0 0 rgba(247, 198, 0, 0.6);
  animation: ring 2.2s infinite; transition: opacity 0.35s, transform 0.35s var(--ease);
}
.player__play svg { width: 34px; height: 34px; fill: currentColor; stroke: none; margin-left: 5px; }
.player:hover .player__play { transform: translate(-50%, -50%) scale(1.08); }
.player.is-playing .player__play { opacity: 0; pointer-events: none; }
/* 3D tour call-to-action card under the brand video */
.tour-cta {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 32px;
  max-width: 1000px; margin: 36px auto 0; padding: 26px 30px; border-radius: 24px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12); backdrop-filter: blur(10px);
  transition: border-color 0.4s, transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.tour-cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at 0% 50%, rgba(247, 198, 0, 0.18), transparent 70%);
}
.tour-cta:hover { border-color: rgba(247, 198, 0, 0.55); transform: translateY(-4px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8); }
.tour-cta__cube { flex: none; width: 92px; height: 92px; display: grid; place-items: center; perspective: 500px; }
.cube { position: relative; width: 56px; height: 56px; transform-style: preserve-3d; animation: cube-spin 9s linear infinite; }
.tour-cta:hover .cube { animation-duration: 3s; }
.cube__face {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(21, 58, 107, 0.92); border: 1.5px solid var(--yellow);
  box-shadow: inset 0 0 18px rgba(247, 198, 0, 0.25);
}
.cube__face img { width: 70%; }
.cube__face--front { transform: translateZ(28px); }
.cube__face--back { transform: rotateY(180deg) translateZ(28px); }
.cube__face--right { transform: rotateY(90deg) translateZ(28px); background: rgba(247, 198, 0, 0.9); }
.cube__face--left { transform: rotateY(-90deg) translateZ(28px); background: rgba(247, 198, 0, 0.9); }
.cube__face--top { transform: rotateX(90deg) translateZ(28px); }
.cube__face--bottom { transform: rotateX(-90deg) translateZ(28px); }
@keyframes cube-spin { from { transform: rotateX(-22deg) rotateY(0deg); } to { transform: rotateX(-22deg) rotateY(360deg); } }
.tour-cta__copy { flex: 1; min-width: 0; text-align: left; }
.tour-cta__kicker { margin: 0 0 6px; font-family: var(--font-display); font-size: 0.65rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--yellow); }
.tour-cta__title { margin: 0 0 12px; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--white); }
.tour-cta__keys { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; font-size: 0.82rem; color: rgba(255, 255, 255, 0.7); }
.tour-cta__keys li { display: flex; align-items: center; gap: 4px; }
.tour-cta__keys kbd {
  min-width: 24px; padding: 2px 7px; border-radius: 6px; text-align: center;
  font: 700 0.72rem var(--font-body); color: var(--white);
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-bottom-width: 2px;
}
.tour-cta__btn { flex: none; }
@media (max-width: 760px) {
  .tour-cta { flex-direction: column; text-align: center; gap: 18px; padding: 26px 22px; }
  .tour-cta__copy { text-align: center; }
  .tour-cta__keys { justify-content: center; }
  .tour-cta__btn { width: 100%; justify-content: center; }
}
.player__bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 4px; background: rgba(21, 58, 107, 0.2); }
.player__bar span { display: block; height: 100%; width: 0; background: var(--yellow); transition: width 0.1s linear; }
@keyframes ring { 70% { box-shadow: 0 0 0 26px rgba(247, 198, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(247, 198, 0, 0); } }

/* ---------- Process ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: s; position: relative; }
.steps::before { content: ""; position: absolute; left: 0; right: 0; top: 28px; height: 2px; background: linear-gradient(90deg, var(--blue), var(--yellow)); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform 1.4s var(--ease); }
.steps.is-visible::before { --p: 1; }
.step { position: relative; padding-top: 80px; }
.step__num {
  position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--blue); font-family: var(--font-display); font-size: 0.85rem; color: var(--blue);
  transition: background 0.4s, color 0.4s, transform 0.5s var(--ease), border-color 0.4s;
}
.step:hover .step__num { background: var(--yellow); border-color: var(--yellow); color: var(--blue-950); transform: scale(1.12) rotate(-6deg); }
.step h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 400; font-size: 1rem; color: var(--blue); }
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Identity ---------- */
.identity { background: var(--paper); }
.identity__grid { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: clamp(40px, 6vw, 80px); align-items: center; }
.identity__copy > p { color: var(--muted); font-size: 1.05rem; }
.identity__media .tilt { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.palette { display: grid; gap: 14px; margin-top: 30px; }
.swatch {
  display: flex; align-items: center; gap: 18px; padding: 12px; border-radius: 16px; text-align: left;
  border: 1px solid var(--line); background: var(--white); transition: transform 0.4s var(--ease), box-shadow 0.4s, border-color 0.3s;
}
.swatch:hover { transform: translateX(6px); border-color: var(--c); box-shadow: 0 14px 30px -18px var(--c); }
.swatch__chip { width: 56px; height: 56px; border-radius: 50%; background: var(--c); flex: none; transition: transform 0.5s var(--ease); }
.swatch:hover .swatch__chip { transform: scale(1.1); }
.swatch__info { display: grid; }
.swatch__info strong { font-family: var(--font-display); font-weight: 400; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.swatch__info code { font-family: var(--font-body); font-weight: 600; color: var(--muted); }
/* Typography specimen (brand reference) */
.typo { margin-top: clamp(56px, 8vw, 96px); }
.typo__head { max-width: 640px; margin-bottom: 28px; }
.typo__title { margin: 0 0 8px; font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; color: var(--blue); }
.typo__head p { margin: 0; color: var(--muted); }
.typo__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.typo__card {
  display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: var(--radius); text-align: left;
  background: var(--white); border: 1px solid var(--line); color: var(--ink); font: inherit;
  transition: transform 0.5s var(--ease), border-color 0.3s, box-shadow 0.5s var(--ease), opacity 0.9s var(--ease);
}
.typo__card--btn { cursor: pointer; }
.typo__card:hover { transform: translateY(-6px); border-color: var(--yellow); box-shadow: var(--shadow); }
.typo__role { font-family: var(--font-display); font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.typo__sample { display: grid; place-items: center; height: 120px; border-radius: 14px; background: var(--paper); color: var(--blue); overflow: hidden; }
.typo__sample--logo img { width: auto; height: 94px; max-width: 86%; object-fit: contain; transition: transform 0.6s var(--ease); }
.typo__card:hover .typo__sample--logo img { transform: scale(1.05); }
.typo__sample--display { font-family: var(--font-display); font-size: 2.3rem; letter-spacing: 0.02em; }
.typo__sample--body { font-family: var(--font-body); font-weight: 800; font-size: 3.6rem; }
.typo__card h4 { margin: 6px 0 0; font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; color: var(--blue); }
.typo__card h4 small { display: block; margin-top: 2px; font-weight: 500; font-size: 0.78rem; color: var(--muted); }
.typo__card p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.typo__card code { font-family: var(--font-body); font-weight: 600; font-size: 0.86rem; color: var(--blue); }
.typo__weights { display: flex; gap: 14px; color: var(--blue) !important; }
@media (max-width: 1024px) { .typo__grid { grid-template-columns: 1fr; } }

.palette__hint { font-size: 0.82rem !important; margin-top: 12px; }

/* ---------- Contact ---------- */
.contact__box {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  padding: clamp(36px, 6vw, 72px); border-radius: 32px; background: var(--blue); color: var(--white);
}
.contact__box::before { content: ""; position: absolute; top: -40%; right: 8%; width: 70px; height: 200%; background: var(--yellow); transform: rotate(22deg); opacity: 0.9; z-index: 1; }
.contact__box::after { content: ""; position: absolute; inset: 0; background: radial-gradient(500px circle at 0 0, rgba(30, 79, 143, 0.9), transparent 70%); z-index: 0; }
.contact__box > * { position: relative; z-index: 2; }
.contact__mark { width: 70px; margin-bottom: 22px; animation: float2 6s ease-in-out infinite; }
@keyframes float2 { 50% { transform: translateY(-8px) rotate(-4deg); } }
.contact .section__title { color: var(--white); }
.contact__copy p { color: rgba(255, 255, 255, 0.78); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 28px; border-radius: 22px; background: rgba(7, 23, 49, 0.55); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.1); }
.field { position: relative; display: block; }
.field--full { grid-column: 1 / -1; }
.field input, .field textarea {
  width: 100%; padding: 22px 16px 10px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06); color: var(--white); font: inherit; resize: vertical;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--yellow); background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 4px rgba(247, 198, 0, 0.18); }
.field span { position: absolute; left: 17px; top: 16px; font-size: 0.92rem; color: rgba(255, 255, 255, 0.6); pointer-events: none; transition: transform 0.3s var(--ease), color 0.3s, font-size 0.3s; transform-origin: left; }
.field input:focus + span, .field input:not(:placeholder-shown) + span,
.field textarea:focus + span, .field textarea:not(:placeholder-shown) + span { transform: translateY(-10px); font-size: 0.72rem; color: var(--yellow); }
.field.is-invalid input, .field.is-invalid textarea { border-color: #ff7a7a; animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.form__status { grid-column: 1 / -1; margin: 0; min-height: 1.4em; font-size: 0.9rem; color: var(--yellow); }

/* ---------- Footer ---------- */
.footer { background: var(--blue-950); color: rgba(255, 255, 255, 0.6); padding: 56px 0; }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; font-size: 0.85rem; }
.footer__logo { width: min(320px, 80%); opacity: 0.95; transition: transform 0.6s var(--ease); }
.footer__logo:hover { transform: scale(1.03); }

.footer__info {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; width: 100%;
  margin-top: 12px; padding-top: 36px; border-top: 1px solid rgba(255, 255, 255, 0.12); text-align: left;
}
.footer__label { margin: 0 0 12px; font-family: var(--font-display); font-weight: 400; font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--yellow); }
.footer__col address { font-style: normal; line-height: 1.7; }
.footer__col strong { color: var(--white); font-weight: 700; }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer__list a { color: rgba(255, 255, 255, 0.8); overflow-wrap: anywhere; transition: color 0.3s; }
.footer__list a:hover { color: var(--yellow); }
@media (max-width: 760px) { .footer__info { grid-template-columns: 1fr; gap: 24px; text-align: center; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80; padding: 12px 22px; border-radius: 999px;
  background: var(--blue); color: var(--white); font-weight: 600; font-size: 0.9rem; box-shadow: var(--shadow);
  transform: translate(-50%, calc(100% + 48px)); opacity: 0; transition: transform 0.5s var(--ease), opacity 0.3s;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero__grid, .about__grid, .identity__grid, .contact__box { grid-template-columns: 1fr; }
  .hero__visual { order: -1; }
  .brain { width: min(320px, 70vw); }
  .hero__shape--blue { width: 100%; right: -55%; opacity: 0.08; }
  .hero__shape--yellow { display: none; }
  .cards { grid-template-columns: 1fr 1fr; }
  .card, .card:nth-child(4), .card:nth-child(5) { grid-column: span 1; }
  .card--featured { grid-column: 1 / -1 !important; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .steps::before { display: none; }
  .about__badge { right: 12px; }
  .contact__box::before { right: -10%; }
}

@media (max-width: 760px) {
  .nav__links {
    position: fixed; inset: 0 0 auto; top: 0; flex-direction: column; gap: 0; padding: 90px 24px 28px;
    background: var(--white); box-shadow: var(--shadow); transform: translateY(-110%); transition: transform 0.5s var(--ease);
  }
  .nav__links a { padding: 14px 0; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
  .nav.is-open .nav__links { transform: none; }
  .nav__toggle { display: block; z-index: 2; }
  .nav__inner > .btn { display: none; }
  .nav__brand { position: relative; z-index: 2; }
  .cobrand { padding-left: 10px; gap: 6px; }
  .cobrand__emblem { height: 28px; }
  .cobrand__name { font-size: 0.82rem; }
  .footer__logo { width: 52%; }
  .cobrand--footer { padding-left: 14px; gap: 8px; }
  .cobrand--footer .cobrand__emblem { height: 44px; }
  .cobrand--footer .cobrand__name { font-size: 1rem; }
  .hero__stats { gap: 20px; flex-wrap: wrap; }
  .cards, .steps, .values, .form { grid-template-columns: 1fr; }
  .brain__chip { font-size: 0.6rem; padding: 8px 12px; }
}

@media (hover: none) { .cursor-glow { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* 3D walkthrough overlay (Godot web export served from tour/) */
.tour {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--blue-950);
}
.tour[hidden] { display: none; }
.tour__frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.tour__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--blue-950);
  font: 600 0.9rem var(--font-body);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.tour__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.tour__close:hover { background: var(--yellow-600); }
.tour__hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(7, 23, 49, 0.7);
  color: var(--white);
  font-size: 0.8rem;
  pointer-events: none;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .tour__hint { white-space: normal; width: calc(100% - 32px); text-align: center; }
}
body.tour-open { overflow: hidden; }
