/* The three sections share the selected palette; light and spacing mark the transitions. */
:root {
  --gutter: clamp(18px, 5.5vw, 88px);
  --editorial-base: var(--page);
  --editorial-surface: var(--surface);
  --editorial-text: var(--text);
  --editorial-muted: var(--muted);
  --editorial-accent: var(--accent);
  --editorial-action: var(--primary-start);
  --editorial-on-action: var(--on-primary);
  --editorial-progress: var(--accent);
  --editorial-line: var(--line);
}

:root[data-palette="obsidiana"] {
  --editorial-base: #090b11;
  --editorial-surface: #10131c;
  --editorial-accent: #a8b4ff;
  --editorial-action: var(--electric-cobalt);
  --editorial-progress: var(--synth-magenta);
  --editorial-line: #34394b;
}

body { background: var(--editorial-base); }

.site-header.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 68px;
  max-width: 1280px;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.portal-logo, .footer-top > a.portal-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: .55rem;
  color: var(--editorial-text);
  text-decoration: none;
}
.site-header .portal-logo { grid-area: 1 / 2; }
.portal-logo-symbol {
  position: relative;
  display: block;
  width: 3.5rem;
  aspect-ratio: 1;
  flex: none;
}
.portal-logo-symbol img, .portal-logo-frames {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.portal-logo-frames { visibility: hidden; background-repeat: no-repeat; }
.portal-logo-symbol.is-playing img { visibility: hidden; }
.portal-logo-symbol.is-playing .portal-logo-frames { visibility: visible; }
.portal-logo-name {
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .23em;
  text-transform: uppercase;
}
@supports (mask-image: url('')) or (-webkit-mask-image: url('')) {
  .portal-logo-name {
    width: 6rem;
    height: .8rem;
    font-size: 0;
    background: currentColor;
    -webkit-mask: url('assets/logo-nexus-letras.png') center / contain no-repeat;
    mask: url('assets/logo-nexus-letras.png') center / contain no-repeat;
    forced-color-adjust: none;
  }
}
@media print, (prefers-reduced-motion: reduce) {
  .portal-logo-symbol.is-playing img { visibility: visible; }
  .portal-logo-symbol.is-playing .portal-logo-frames { visibility: hidden; }
}

.site-header .header-controls {
  grid-area: 1 / 1;
  justify-self: start;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.site-header .header-controls #appearance-toggle,
.site-header .header-controls #motion-toggle {
  padding: 8px 0;
  width: auto;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--editorial-muted);
  font-size: .875rem;
  font-weight: 500;
}
.site-header .header-controls #motion-toggle::before,
.site-header .header-controls #motion-toggle[aria-pressed="true"]::before { content: none; }
.site-header .header-controls #appearance-toggle:hover,
.site-header .header-controls #motion-toggle:hover,
.site-header .header-controls #appearance-toggle[aria-expanded="true"] { color: var(--editorial-accent); }
#appearance-panel { top: 63px; right: auto; left: var(--gutter); max-height: calc(100dvh - 72px); }

.module-flow.editorial-flow { display: block; padding: 0; }
.editorial-flow > .experience-module {
  --text-heading: var(--editorial-text);
  --text-soft: var(--editorial-muted);
  --accent-hover: var(--editorial-accent);
  --line-soft: var(--editorial-line);
  --line-strong: var(--editorial-line);
  --line-contact: var(--editorial-line);
  margin: 0;
  border: 0;
  border-radius: 0;
  padding-inline: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  scroll-margin-top: 0;
  color: var(--editorial-text);
}
.editorial-flow > .experience-module::before,
.editorial-flow > .experience-module::after { display: none; }

.editorial-flow #inicio.hero {
  --studio-key: color-mix(in srgb, var(--editorial-accent) 64%, var(--core-pigment));
  --studio-edge: color-mix(in srgb, var(--editorial-accent) 73%, var(--core-glint));
  padding-block: clamp(12px, 2vw, 24px) 0;
  background: var(--editorial-base);
  background:
    radial-gradient(ellipse at 27% 66%, color-mix(in srgb, var(--studio-key) 13%, transparent), transparent 47%),
    radial-gradient(ellipse at 65% 78%, color-mix(in srgb, var(--core-pigment) 13%, transparent), transparent 41%),
    var(--editorial-base);
  text-align: center;
}
.editorial-flow #inicio .hero-introduction { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 0; }
.editorial-flow #inicio .eyebrow { margin-bottom: 14px; color: var(--editorial-muted); }
.editorial-flow #inicio .hero-title {
  max-width: none;
  color: var(--editorial-text);
  font-size: clamp(2.125rem, 5.7vw, 4.75rem);
  font-weight: 610;
  letter-spacing: -.052em;
  line-height: 1.02;
}
.editorial-flow #inicio .hero-title span {
  background: none;
  color: var(--editorial-accent);
  -webkit-text-fill-color: currentColor;
}
.editorial-flow #inicio .hero-art {
  width: min(100%, 455px);
  height: auto;
  min-height: 0;
  max-width: none;
  padding-block: 14px 18px;
  margin: 7px auto 0;
  overflow: visible;
}
.editorial-flow #inicio .hero-art img {
  width: clamp(220px, 40vh, 350px);
  max-width: 86%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
}
.editorial-flow #inicio .hero-art::before,
.editorial-flow #inicio .hero-art::after { content: none; }
.studio-reflection {
  position: absolute;
  pointer-events: none;
  left: 50%;
  bottom: 0;
  width: min(150%, 86vw, 42rem);
  height: 29%;
  transform: translate(-50%, 2%) rotate(-4deg);
  background: radial-gradient(ellipse, color-mix(in srgb, var(--studio-key) 28%, transparent) 1%, color-mix(in srgb, var(--core-pigment) 12%, transparent) 34%, transparent 69%);
}
.studio-reflection::before,
.studio-reflection::after {
  position: absolute;
  content: "";
  inset: 12% 12% 20%;
  border-radius: 50%;
  background: radial-gradient(ellipse, transparent 41%, color-mix(in srgb, var(--studio-key) 30%, transparent) 48%, color-mix(in srgb, var(--studio-edge) 68%, transparent) 51%, color-mix(in srgb, var(--studio-key) 22%, transparent) 54%, transparent 64%);
  mask-image: conic-gradient(from 20deg, transparent, black 12%, transparent 35% 54%, black 69%, transparent 96%);
  filter: blur(1px);
}
.studio-reflection::after {
  inset: 30% 15% 28% 1%;
  transform: rotate(-3deg);
  opacity: .6;
  filter: blur(2px);
}
.editorial-flow #inicio .hero-intro { max-width: 46ch; margin: 0; color: var(--editorial-muted); }

.editorial-index {
  display: grid;
  width: min(100%, 680px);
  grid-template-columns: 1fr 1.55fr 1fr;
  margin-top: clamp(20px, 3.2vw, 34px);
  border-top: 1px solid var(--editorial-line);
}
.editorial-index a {
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 10px 8px;
  color: var(--editorial-muted);
  font-size: .9375rem;
  font-weight: 550;
}
.editorial-index a:hover { color: var(--editorial-text); text-decoration: underline; text-underline-offset: 4px; }
.editorial-index .editorial-index-main {
  position: relative;
  margin-top: -1px;
  color: var(--editorial-on-action);
  text-decoration: none;
  background: var(--editorial-action);
  background: linear-gradient(170deg, color-mix(in srgb, var(--editorial-action) 97%, white), color-mix(in srgb, var(--editorial-action) 73%, black));
  border-top: 1px solid color-mix(in srgb, var(--editorial-action) 45%, white);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 24%), 0 14px 28px color-mix(in srgb, var(--editorial-action) 18%, transparent);
}
.editorial-index .editorial-index-main:hover { color: var(--editorial-on-action); filter: brightness(1.08); }
.editorial-index a:focus-visible { position: relative; z-index: 1; outline-offset: -4px; }

.editorial-flow #adn { padding-block: clamp(36px, 6vw, 72px) clamp(44px, 7vw, 82px); }
.editorial-flow #servicios {
  background: var(--editorial-base);
  background: linear-gradient(138deg, color-mix(in srgb, var(--editorial-surface) 89%, var(--editorial-action)), var(--editorial-base) 67%);
  padding-block: clamp(44px, 7vw, 83px);
}
.editorial-flow .service-content { max-width: 1020px; }
.site-footer { max-width: 1020px; margin: 0 auto; background: transparent; }

@media (min-width: 721px) and (max-height: 800px) {
  .site-header.shell { min-height: 58px; }
  #appearance-panel { top: 55px; }
  .editorial-flow #inicio.hero { padding-top: 12px; }
  .editorial-flow #inicio .eyebrow { margin-bottom: 11px; }
  .editorial-flow #inicio .hero-title { font-size: clamp(2.125rem, 5.3vw, 4.25rem); }
  .editorial-flow #inicio .hero-art { margin-top: 3px; }
  .editorial-flow #inicio .hero-art img { width: clamp(200px, 37vh, 320px); }
  .editorial-index { margin-top: 24px; }
}

@media (max-width: 720px) {
  .site-header.shell { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 0; padding-top: 16px; }
  .site-header .portal-logo, .site-header .header-controls { grid-area: auto; justify-self: center; }
  .portal-logo-symbol { width: 3rem; }
  #appearance-panel { top: calc(60px + 3rem); left: 50%; transform: translateX(-50%); max-height: calc(100dvh - 70px - 3rem); }
  .editorial-flow #inicio .hero-art img { width: clamp(200px, 46vw, 302px); }
}

@media (max-width: 420px) {
  .editorial-index { grid-template-columns: minmax(0, .7fr) minmax(0, 1.6fr) minmax(0, 1fr); }
  .editorial-index a { min-height: 48px; padding-inline: 4px; font-size: .875rem; }
}

@media (forced-colors: active) {
  .studio-reflection { display: none; }
  .editorial-index .editorial-index-main { border: 1px solid ButtonText; }
}

@media print {
  :root, :root[data-palette="obsidiana"] {
    --editorial-base: #fff;
    --editorial-surface: #fff;
    --editorial-text: #161b24;
    --editorial-muted: #303948;
    --editorial-accent: #202938;
    --editorial-action: #d8dbe3;
    --editorial-on-action: #161b24;
    --editorial-progress: #272c37;
    --editorial-line: #687587;
  }
  .site-header .header-controls, .editorial-index, .studio-reflection { display: none; }
  .editorial-flow #inicio.hero, .editorial-flow #adn, .editorial-flow #servicios { background: #fff; color: #161b24; }
}
