/* ==========================================================================
   Ludus Ops — Engineering & Operations Architecture
   style.css
   Orden: tokens · reset · layout · components · motion · responsive
   ========================================================================== */

/* ----------------------------- TOKENS ------------------------------------ */
:root {
  box-sizing: border-box;
  color-scheme: dark;

  /* Color — blueprint 02 */
  --bg: #0A0E12;
  --surface: #111D29;
  --surface-2: #172532;
  --accent: #2463E8;
  --accent-light: #3B7BFA;
  --accent-soft: rgba(36, 99, 232, 0.10);
  --fg: #F5F7F8;
  --fg-muted: #8B949E;
  --line: #25303A;
  --line-strong: #33414D;
  --danger: #FF6B6B;
  --success: #5FD48A;

  /* Type */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Motion — blueprint 13 */
  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-in-out: cubic-bezier(.4,0,.2,1);
  --dur-hover: 180ms;
  --dur-panel: 400ms;
  --dur-reveal: 600ms;
  --dur-draw: 1000ms;
  --dur-page: 350ms;

  /* Layout — blueprint 03 */
  --container: 1200px;
  --gutter: 32px;
  --gap: 28px;
  --radius: 6px;
  --nav-h: 72px;
  --bg-rgb: 10, 14, 18;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F7F8;
  --bg-rgb: 245, 247, 248;
  --surface: #FFFFFF;
  --surface-2: #EDF1F5;
  --accent: #2463E8;
  --accent-light: #1F56D1;
  --accent-soft: rgba(36, 99, 232, 0.08);
  --fg: #0A0E12;
  --fg-muted: #525C66;
  --line: #DCE2E8;
  --line-strong: #C2CBD4;
}

.i18n-pending body { visibility: hidden; }

*, *::before, *::after { box-sizing: inherit; margin: 0; padding: 0; }

@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;
  }
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font: 18px/1.55 var(--font-display);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ----------------------------- LAYOUT ------------------------------------ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
}
.skip-link:focus { top: 16px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: 140px 0; position: relative; }
.section--surface { background: var(--surface); }
.section--tight { padding: 96px 0; }

.section__head { max-width: 760px; margin-bottom: 64px; }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 20px;
}

.h1 {
  font-size: clamp(2.625rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.h2 {
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }

.lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--fg-muted);
  margin-top: 22px;
}

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent-light); }

/* ----------------------------- MOTION ------------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

[data-reveal="left"] { transform: translateX(-16px); }
[data-reveal="left"].is-visible { transform: translateX(0); }

[data-reveal="scale"] { transform: scale(0.97); }
[data-reveal="scale"].is-visible { transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ----------------------------- BUTTONS ----------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 26px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-hover) ease-out,
              color var(--dur-hover) ease-out,
              border-color var(--dur-hover) ease-out,
              transform var(--dur-hover) ease-out;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-light); border-color: var(--accent-light); }

.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-light); }

.btn--lg { min-height: 56px; padding: 0 32px; font-size: 1rem; }
.btn--block { width: 100%; }

/* ----------------------------- NAVBAR ------------------------------------ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-hover), border-color var(--dur-hover), backdrop-filter var(--dur-hover);
}
.nav.is-scrolled {
  background: rgba(var(--bg-rgb), 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}

.nav__inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo { display: flex; align-items: center; gap: 12px; flex: none; }
.logo__mark { height: 32px; width: auto; flex: none; filter: brightness(0) invert(1); }
.logo__text { display: flex; flex-direction: column; line-height: 1.1; }
.logo__name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.logo__sub {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 2px;
}

.nav__links { display: flex; align-items: center; gap: 32px; margin-left: auto; }
.nav__links > a {
  position: relative;
  font-size: 0.85rem;
  color: var(--fg-muted);
  transition: color var(--dur-hover);
}
.nav__links > a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 20px; height: 1px;
  background: var(--accent-light);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-hover) var(--ease-out);
}
.nav__links > a:hover,
.nav__links > a.is-active { color: var(--fg); }
.nav__links > a:hover::after,
.nav__links > a.is-active::after { transform: scaleX(1); }

.nav__cta { min-height: 44px; padding: 0 18px; font-size: 0.85rem; }
.nav__cta--mobile { display: none; }

.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.nav__toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--fg); border-radius: 1px;
  transition: transform var(--dur-hover), opacity var(--dur-hover);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----------------------------- FOOTER ------------------------------------ */
.footer { background: var(--surface); border-top: 1px solid var(--line); padding: 72px 0 32px; }
.footer__inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
}
.footer__tagline { margin-top: 20px; font-size: 0.9rem; color: var(--fg-muted); max-width: 320px; line-height: 1.6; }
.footer__nav, .footer__legal { display: flex; flex-direction: column; gap: 14px; }
.footer__nav a, .footer__legal a {
  font-size: 0.85rem; color: var(--fg-muted); transition: color var(--dur-hover);
}
.footer__nav a:hover, .footer__legal a:hover { color: var(--fg); }
.footer__bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding-top: 28px; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--fg-muted);
}
.footer__bottom a { color: var(--fg-muted); transition: color var(--dur-hover); }
.footer__bottom a:hover { color: var(--accent-light); }

/* ----------------------------- HERO -------------------------------------- */
.hero {
  min-height: 780px;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 72px) 0 96px;
  position: relative;
  overflow: hidden;
}
.hero__grid { display: grid; grid-template-columns: 7fr 5fr; align-items: center; gap: 64px; }
.hero__eyebrow { margin-bottom: 26px; }
.hero__title {
  font-size: clamp(2.625rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 15ch;
}
.hero__text { margin-top: 28px; font-size: 1.15rem; line-height: 1.6; color: var(--fg-muted); max-width: 56ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.hero__visual { position: relative; }
.hero__visual svg { width: 100%; height: auto; }

/* Hero entrance — blueprint 05 */
.hero__content > * {
  opacity: 0;
  animation: heroIn 650ms var(--ease-out) forwards;
}
.hero__eyebrow { animation-delay: 0ms; }
.hero__title { animation-delay: 70ms; }
.hero__text { animation-delay: 140ms; }
.hero__actions { animation-delay: 210ms; }
.hero__visual {
  opacity: 0;
  animation: heroVisualIn 700ms var(--ease-out) 280ms forwards;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroVisualIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__content > *, .hero__visual { opacity: 1 !important; animation: none !important; }
}

/* ----------------------------- PAGE HERO --------------------------------- */
.page-hero { padding: calc(var(--nav-h) + 104px) 0 80px; border-bottom: 1px solid var(--line); }
.page-hero__title {
  font-size: clamp(2.125rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 22ch;
}
.page-hero__text { margin-top: 26px; font-size: 1.1rem; line-height: 1.6; color: var(--fg-muted); max-width: 62ch; }

/* ----------------------------- GRID / CARDS ------------------------------ */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform var(--dur-hover) var(--ease-out),
              border-color var(--dur-hover),
              background var(--dur-hover);
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); background: var(--surface-2); }
.card__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-light);
  display: block;
  margin-bottom: 20px;
}
.card__title { font-size: 1.15rem; font-weight: 600; margin-bottom: 10px; letter-spacing: -0.01em; }
.card__text { font-size: 0.95rem; line-height: 1.6; color: var(--fg-muted); }

/* ----------------------------- COST FORMULA ------------------------------ */
.cost { display: grid; grid-template-columns: repeat(4, 1fr) auto 1.4fr; gap: 20px; align-items: end; }
.cost__factor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
}
.cost__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 12px;
}
.cost__value { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.cost__input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 8px 12px;
  min-height: 48px;
}
.cost__input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.cost__op { font-family: var(--font-mono); font-size: 1.5rem; color: var(--accent-light); text-align: center; }
.cost__result {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 26px 22px;
}
.cost__result .cost__value { font-family: var(--font-mono); font-size: clamp(2rem, 3vw, 2.75rem); color: var(--fg); }
.cost__note { margin-top: 24px; font-size: 0.85rem; color: var(--fg-muted); }

/* ----------------------------- METHOD TIMELINE --------------------------- */
.method { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); position: relative; }
.method__step {
  position: relative;
  padding: 30px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--dur-hover), background var(--dur-hover);
}
.method__step:hover { border-color: var(--line-strong); background: var(--surface-2); }
.method__num { font-family: var(--font-mono); font-size: 12px; color: var(--accent-light); display: block; margin-bottom: 16px; }
.method__title { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 10px; }
.method__text { font-size: 0.95rem; color: var(--fg-muted); line-height: 1.6; }

.method-line { position: absolute; top: 0; left: 0; width: 100%; height: 2px; overflow: visible; pointer-events: none; }
.step-line {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset var(--dur-draw) var(--ease-out);
}
.step-line.is-visible { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .step-line { stroke-dashoffset: 0 !important; } }

/* ----------------------------- COMPARISON -------------------------------- */
.compare { border-top: 1px solid var(--line); }
.compare__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.compare__head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.compare__head--us { color: var(--accent-light); }
.compare__cell { font-size: 1.05rem; line-height: 1.5; }
.compare__cell--them { color: var(--fg-muted); }

/* ----------------------------- AUDIT ENTRY ------------------------------- */
.audit { display: grid; grid-template-columns: 7fr 5fr; gap: 64px; align-items: center; }
.audit__list { border-top: 1px solid var(--line); }
.audit__item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--fg-muted);
}
.audit__item .num { font-family: var(--font-mono); font-size: 12px; color: var(--accent-light); flex: none; }

/* ----------------------------- ROWS -------------------------------------- */
.row {
  display: grid;
  grid-template-columns: 48px 1fr 2fr;
  gap: 28px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.row:first-child { border-top: 1px solid var(--line); }
.row__num { font-family: var(--font-mono); font-size: 12px; color: var(--accent-light); }
.row__title { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.row__text { color: var(--fg-muted); line-height: 1.55; }

/* ----------------------------- DIMENSIONS TABLE -------------------------- */
.dim { border-top: 1px solid var(--line); }
.dim__row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.dim__key { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-light); }
.dim__val { color: var(--fg-muted); line-height: 1.55; }

/* ----------------------------- SERVICES LIST ----------------------------- */
.services { border-top: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: 48px 1fr 1fr;
  gap: 28px;
  align-items: baseline;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: transform var(--dur-hover) var(--ease-out), border-color var(--dur-hover);
}
.service:hover { transform: translateX(4px); border-bottom-color: var(--accent); }
.service__num { font-family: var(--font-mono); font-size: 12px; color: var(--accent-light); }
.service__title { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.service__promise { color: var(--fg-muted); line-height: 1.55; }
.service__body {
  grid-column: 2 / -1;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height var(--dur-panel) var(--ease-out), opacity var(--dur-panel) var(--ease-out), margin var(--dur-panel) var(--ease-out);
}
.service.is-open .service__body { max-height: 320px; opacity: 1; margin-top: 16px; }
.service__body p { color: var(--fg-muted); line-height: 1.6; max-width: 62ch; }

/* ----------------------------- SECTORS ----------------------------------- */
.card--sector {
  position: relative;
  min-height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform var(--dur-hover) var(--ease-out), border-color var(--dur-hover);
}
.card--sector__visual {
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, var(--surface-2), var(--bg));
  filter: grayscale(1);
  transition: filter var(--dur-panel) var(--ease-out);
}
.card--sector__visual svg { width: 100%; height: 100%; }
.card--sector::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(var(--bg-rgb), 0.62);
  transition: background var(--dur-panel) var(--ease-out);
}
.card--sector:hover { transform: scale(1.02); border-color: var(--accent); }
.card--sector:hover::before { background: rgba(var(--bg-rgb), 0.42); }
.card--sector:hover .card--sector__visual { filter: grayscale(0); }
.card--sector__content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
}
.card--sector__title { font-size: 1.25rem; font-weight: 600; margin-bottom: 10px; }
.card--sector__text { font-size: 0.9rem; color: var(--fg-muted); line-height: 1.5; }

/* ----------------------------- CASES ------------------------------------- */
.case { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; }
.case__sticky { position: sticky; top: calc(var(--nav-h) + 40px); }
.case__metric {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--fg);
}
.case__metric-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 16px;
}
.case__chart { margin-top: 40px; }
.case__chart svg { width: 100%; height: auto; }
.case__steps { display: flex; flex-direction: column; gap: 40px; }
.case__step { padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.case__step:last-child { border-bottom: 0; padding-bottom: 0; }
.case__step-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 12px;
}
.case__step-text { font-size: 1.05rem; line-height: 1.6; color: var(--fg-muted); }

/* ----------------------------- ABOUT ------------------------------------- */
.bio { display: grid; grid-template-columns: 420px 1fr; gap: 64px; align-items: start; }
.bio__photo {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 420 / 520;
  object-fit: cover;
  filter: grayscale(1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.bio__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 20px;
}
.bio__text p + p { margin-top: 18px; }

.principle {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.principle:first-child { border-top: 1px solid var(--line); }
.principle__num { font-family: var(--font-mono); font-size: 12px; color: var(--accent-light); }
.principle__title { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; }
.principle__text { color: var(--fg-muted); line-height: 1.6; }

/* ----------------------------- PROJECTS ---------------------------------- */
.card--project {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  background: var(--surface);
}
.card--project img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: transform var(--dur-reveal) var(--ease-out), filter var(--dur-reveal) var(--ease-out);
}
.card--project:hover img { transform: scale(1.025); filter: grayscale(0); }
.card--project__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(var(--bg-rgb), 0.94), rgba(var(--bg-rgb), 0.15));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px;
}
.card--project__title { font-size: 1.2rem; font-weight: 600; }
.card--project__text { font-size: 0.9rem; color: var(--fg-muted); margin-top: 6px; }
.card--project__link {
  font-size: 0.85rem;
  color: var(--accent-light);
  margin-top: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-hover), transform var(--dur-hover);
}
.card--project:hover .card--project__link { opacity: 1; transform: translateY(0); }

/* ----------------------------- FORM -------------------------------------- */
.form { display: grid; gap: 20px; }
.form__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field input, .field select, .field textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  padding: 14px 16px;
  font-size: 0.95rem;
  transition: border-color var(--dur-hover), box-shadow var(--dur-hover);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath stroke='%238B949E' stroke-width='1.5' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
}
.field textarea { min-height: 150px; resize: vertical; }
.field__error { font-size: 0.8rem; color: var(--danger); min-height: 1em; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.req { color: var(--accent-light); }
.form__note { font-size: 0.82rem; color: var(--fg-muted); }

.form__success {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 360px;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}
.form__success-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 12px; }
.form__success-text { color: var(--fg-muted); line-height: 1.6; }
.form__summary {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: grid;
  gap: 10px;
}
.form__summary-row { display: grid; grid-template-columns: 140px 1fr; gap: 16px; font-size: 0.9rem; }
.form__summary-key { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.form__summary-val { color: var(--fg); }

.form-stack { display: grid; }
.form-stack > * {
  grid-area: 1 / 1;
  transition: opacity var(--dur-panel) var(--ease-out), visibility var(--dur-panel) var(--ease-out);
}
.form-stack > .is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.contact__grid { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; }
.contact__mail { margin-top: 40px; }
.contact__mail-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.contact__mail a { font-size: 1.25rem; transition: color var(--dur-hover); }
.contact__mail a:hover { color: var(--accent-light); }
.contact__list { margin-top: 32px; border-top: 1px solid var(--line); }
.contact__list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--fg-muted);
}
.contact__list li span:first-child { font-family: var(--font-mono); font-size: 11px; color: var(--accent-light); }

/* ----------------------------- FAQ --------------------------------------- */
.faq { border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q {
  cursor: pointer;
  list-style: none;
  padding: 22px 0;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: '+'; color: var(--accent-light); font-family: var(--font-mono); transition: transform var(--dur-hover); }
.faq__item[open] .faq__q::after { transform: rotate(45deg); }
.faq__a { padding: 0 0 24px; color: var(--fg-muted); max-width: 72ch; line-height: 1.65; }

/* ----------------------------- CTA FINAL --------------------------------- */
.cta-final { text-align: center; padding: 140px 0; }
.cta-final .lead { max-width: 56ch; margin: 24px auto 36px; }

/* ----------------------------- PAGE TRANSITION --------------------------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut var(--dur-page) var(--ease-in-out) both; }
::view-transition-new(root) { animation: vtIn var(--dur-page) var(--ease-in-out) both; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: scale(0.995); } }
body { opacity: 1; transition: opacity 200ms, background-color 250ms, color 250ms; }

/* ----------------------------- NAV TOOLS / THEME ------------------------- */
.nav__tools { display: flex; align-items: center; gap: 8px; flex: none; }
.nav__tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--radius);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color var(--dur-hover), border-color var(--dur-hover);
}
.nav__tool:hover { color: var(--fg); border-color: var(--accent); }
.nav__tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .logo__mark { filter: brightness(0); }

.hero__visual [stroke="#25303A"], .case__chart [stroke="#25303A"] { stroke: var(--line); }
.hero__visual [fill="#111D29"] { fill: var(--surface); stroke: var(--line-strong); }
body.is-fading { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

/* ----------------------------- RESPONSIVE -------------------------------- */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; gap: 56px; }
  .hero { min-height: auto; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .method { grid-template-columns: repeat(2, 1fr); }
  .method-line { display: none; }
  .audit, .case, .contact__grid, .bio { grid-template-columns: 1fr; gap: 48px; }
  .case__sticky { position: static; }
  .cost { grid-template-columns: 1fr 1fr; }
  .cost__op { display: none; }
  .cost__result { grid-column: 1 / -1; }

  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(var(--bg-rgb), 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 16px var(--gutter);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 260ms var(--ease-out), opacity 260ms var(--ease-out);
  }
  .nav__links.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav__links > a { width: 100%; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav__links > a::after { display: none; }
  .nav__cta--desktop { display: none; }
  .nav__cta--mobile { display: inline-flex; margin-top: 14px; border-bottom: 0 !important; }
  .nav__toggle { display: flex; }
  .nav__tools { margin-left: auto; }
}

@media (max-width: 768px) {
  :root { --nav-h: 64px; --gutter: 20px; --gap: 16px; }

  body { font-size: 17px; }
  .section { padding: 88px 0; }
  .section--tight { padding: 72px 0; }
  .section__head { margin-bottom: 44px; }

  .hero { padding: calc(var(--nav-h) + 48px) 0 64px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }

  .grid--2, .grid--3, .method, .cost { grid-template-columns: 1fr; }
  .cost__result { grid-column: auto; }

  .nav__inner { gap: 12px; }

  .row, .dim__row, .service { grid-template-columns: 1fr; gap: 10px; padding: 22px 0; }
  .service__body { grid-column: 1 / -1; }
  .service:hover { transform: none; }
  .compare__row { grid-template-columns: 1fr; gap: 12px; }
  .compare__head { display: none; }
  .compare__cell--them::before { content: 'Antes · '; color: var(--fg-muted); }
  .compare__cell--us::before { content: 'Ludus Ops · '; color: var(--accent-light); }
  html[lang="en"] .compare__cell--them::before { content: 'Before · '; }

  .form__grid { grid-template-columns: 1fr; }
  .form__summary-row { grid-template-columns: 1fr; gap: 4px; }
  .principle { grid-template-columns: 1fr; gap: 8px; }

  .footer__inner { grid-template-columns: 1fr; gap: 36px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ----------------------------- FORM EXTRAS ------------------------------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.field--check { gap: 4px; }
.check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.88rem !important; text-transform: none !important; letter-spacing: 0 !important;
  color: var(--fg-muted); cursor: pointer; line-height: 1.5;
}
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; padding: 0; }
.check a { color: var(--accent-light); text-decoration: underline; text-underline-offset: 3px; }
.form__error { font-size: 0.88rem; color: var(--danger); }
.form__error:empty { display: none; }
.form__success .btn { margin-top: 24px; }
.is-hidden.btn { display: none; }

/* ----------------------------- DRAWER ------------------------------------ */
.drawer { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.drawer__backdrop {
  position: absolute; inset: 0;
  background: rgba(var(--bg-rgb), 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--dur-panel) var(--ease-out);
}
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(520px, 100%);
  background: var(--bg);
  border-left: 1px solid var(--line);
  padding: 28px 36px 40px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--dur-panel) var(--ease-out);
  display: flex; flex-direction: column; gap: 24px;
}
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: translateX(0); }
.drawer__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.drawer__eyebrow { margin: 0; }
.drawer__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius);
  border: 1px solid var(--line); background: transparent; color: var(--fg-muted); cursor: pointer;
  transition: color var(--dur-hover), border-color var(--dur-hover);
}
.drawer__close:hover { color: var(--fg); border-color: var(--accent); }
.drawer__progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.drawer__progress span { display: block; height: 100%; width: 33%; background: var(--accent); transition: width var(--dur-panel) var(--ease-out); }
.drawer__step.is-hidden { display: none; }
.drawer__title { font-size: 1.6rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.drawer__text { color: var(--fg-muted); line-height: 1.6; margin-top: -8px; }
.drawer .field textarea { min-height: 110px; }
.drawer__done { display: flex; flex-direction: column; gap: 16px; padding-top: 12px; }
.drawer__next { list-style: none; border-top: 1px solid var(--line); margin: 8px 0; }
.drawer__next li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.drawer__next li span:first-child { font-family: var(--font-mono); font-size: 11px; color: var(--accent-light); padding-top: 3px; }
body.has-drawer { overflow: hidden; }

/* ----------------------------- MOBILE CTA BAR ---------------------------- */
.mobile-cta { display: none; }
@media (max-width: 768px) {
  .mobile-cta {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(var(--bg-rgb), 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    transform: translateY(110%);
    transition: transform var(--dur-panel) var(--ease-out);
  }
  .mobile-cta.is-visible { transform: translateY(0); }
  body.has-drawer .mobile-cta { transform: translateY(110%); }
  body.has-mobile-cta .footer { padding-bottom: 96px; }
  .drawer__panel { padding: 22px var(--gutter) 32px; border-left: 0; }
  .drawer__title { font-size: 1.35rem; }
}

/* ----------------------------- PROJECT DETAIL ---------------------------- */
.project {
  display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: center;
  padding: 48px 0; border-top: 1px solid var(--line);
}
.project:last-child { border-bottom: 1px solid var(--line); }
.project__media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10; background: var(--surface); }
.project__media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: transform var(--dur-reveal) var(--ease-out), filter var(--dur-reveal) var(--ease-out); }
.project:hover .project__media img { transform: scale(1.025); filter: grayscale(0); }
.project__title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 20px; }
.project__facts { display: grid; gap: 14px; }
.project__fact { display: grid; grid-template-columns: 130px 1fr; gap: 16px; line-height: 1.55; }
.project__fact dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); padding-top: 4px; }
.project__fact dd { color: var(--fg); }
.project__link { display: inline-block; margin-top: 22px; color: var(--accent-light); font-size: 0.9rem; }
.project__link:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 768px) {
  .project { grid-template-columns: 1fr; gap: 24px; padding: 36px 0; }
  .project__fact { grid-template-columns: 1fr; gap: 4px; }
}

/* ----------------------------- LEGAL ------------------------------------- */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.25rem; font-weight: 600; margin: 44px 0 12px; }
.legal p, .legal li { color: var(--fg-muted); line-height: 1.7; }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 20px; margin-top: 10px; display: grid; gap: 6px; }
.legal a { color: var(--accent-light); text-decoration: underline; text-underline-offset: 3px; }
.legal table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 0.9rem; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); color: var(--fg-muted); vertical-align: top; }
.legal th { color: var(--fg); background: var(--surface); font-weight: 500; }
.legal__updated { font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); margin-top: 20px; }

/* ----------------------------- RADAR ------------------------------------- */
.radar__note {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.radar { display: grid; }
.radar__item {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.radar__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.radar__lang {
  font-size: 9px;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--fg-muted);
}
.radar__title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 820px;
}
.radar__title a { transition: color var(--dur-hover) var(--ease-out); }
.radar__title a:hover { color: var(--accent-light); }
.radar__excerpt { color: var(--fg-muted); line-height: 1.65; max-width: 760px; margin: 0; }
.radar__link { margin: 0; }
.radar__link a { font-size: 0.85rem; color: var(--accent-light); }
.radar__link a:hover { text-decoration: underline; text-underline-offset: 3px; }
.radar__empty { color: var(--fg-muted); padding: 40px 0; }

/* ----------------------------- CHECKLIST --------------------------------- */
.opt { color: var(--fg-muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.checklist { border-top: 1px solid var(--line); }
.checklist__item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.checklist__num { font-family: var(--font-mono); font-size: 12px; color: var(--accent-light); }
.checklist__title { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }
.checklist__text { color: var(--fg-muted); line-height: 1.6; margin-top: 6px; }
.checklist__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
@media (max-width: 768px) {
  .checklist__item { grid-template-columns: 1fr; gap: 8px; }
  .checklist__actions { flex-direction: column; }
  .checklist__actions .btn { width: 100%; }
}

/* ----------------------------- AUDIT SCOPE ------------------------------- */
.scope { margin-top: 28px; border-top: 1px solid var(--line); }
.scope__row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.scope__row dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-top: 3px;
}
.scope__row dd { color: var(--fg); line-height: 1.55; }

/* ----------------------------- ILLUSTRATIVE CASE ------------------------- */
.illustrative {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 32px;
  background: var(--bg);
  max-width: 820px;
}
.illustrative__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 16px;
}
.illustrative__title { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 14px; }
.illustrative__text { color: var(--fg-muted); line-height: 1.65; }
.illustrative__note { margin-top: 16px; font-size: 0.82rem; color: var(--fg-muted); font-style: italic; }

/* ----------------------------- STEPS ------------------------------------- */
.steps { border-top: 1px solid var(--line); }
.steps__item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.steps__num { font-family: var(--font-mono); font-size: 12px; color: var(--accent-light); }
.steps__title { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }
.steps__text { color: var(--fg-muted); line-height: 1.6; margin-top: 6px; }

/* ----------------------------- CTA LEVELS -------------------------------- */
.cta-levels { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 44px; text-align: left; }
.cta-level {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
}
.cta-level--primary { border-color: var(--accent); background: var(--accent-soft); }
.cta-level__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
}
.cta-level__text { color: var(--fg-muted); line-height: 1.6; margin-bottom: 8px; }
.cta-level .btn { width: 100%; }

@media (max-width: 768px) {
  .scope__row { grid-template-columns: 1fr; gap: 4px; }
  .steps__item { grid-template-columns: 1fr; gap: 8px; }
  .cta-levels { grid-template-columns: 1fr; }
}

/* ----------------------------- ACCESSIBILITY ----------------------------- */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
  border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .card:hover, .service:hover, .card--sector:hover { transform: none; }
}
