/* Orygen Atlas — site de leitura. Marca: #101D5C / #0878FF */

:root {
  --navy: #101d5c;
  --navy-deep: #0a1340;
  --accent: #0878ff;
  --ink: #0d1221;
  --muted: #5c6578;
  --line: #d8dee9;
  --paper: #eef1f7;
  --paper-2: #f7f8fb;
  --white: #ffffff;
  --warn-bg: #fff6e8;
  --warn-ink: #7a4a08;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;
  --shadow-soft: 0 24px 60px rgb(16 29 92 / 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--white);
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* —— Splash (first viewport = one composition) —— */

.splash {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  color: var(--white);
  overflow: hidden;
  background: var(--navy-deep);
}

.splash__atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.splash__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
  animation: gridDrift 28s linear infinite;
}

.splash__wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 85%, rgb(8 120 255 / 0.35), transparent 55%),
    radial-gradient(ellipse 55% 45% at 90% 10%, rgb(8 120 255 / 0.22), transparent 50%),
    linear-gradient(165deg, var(--navy) 0%, var(--navy-deep) 55%, #060b28 100%);
}

.splash__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.35;
  animation: orbFloat 18s var(--ease) infinite alternate;
}

.splash__orb--a {
  width: min(42vw, 320px);
  height: min(42vw, 320px);
  right: -4%;
  top: 22%;
  background: rgb(8 120 255 / 0.4);
}

.splash__orb--b {
  width: min(34vw, 240px);
  height: min(34vw, 240px);
  left: -2%;
  bottom: 10%;
  background: rgb(255 255 255 / 0.1);
  animation-delay: -6s;
}

.splash__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
  animation: rise 0.9s var(--ease) both;
}

.splash__logo {
  display: block;
  height: 1.75rem;
  width: auto;
}

.splash__stage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vh, 4rem) clamp(1.25rem, 5vw, 4.5rem) clamp(3rem, 8vh, 5rem);
  max-width: 52rem;
}

.splash__kicker {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.62);
  animation: rise 0.95s var(--ease) 0.08s both;
}

.splash__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4.5rem, 16vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  animation: rise 1s var(--ease) 0.14s both;
}

.splash__lead {
  margin: 1.5rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  line-height: 1.55;
  color: rgb(255 255 255 / 0.82);
  animation: rise 1s var(--ease) 0.22s both;
}

.splash__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
  animation: rise 1s var(--ease) 0.3s both;
}

.splash__principle {
  margin: 2.75rem 0 0;
  animation: rise 1s var(--ease) 0.38s both;
}

.splash__principle span {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  border-bottom: 1px solid rgb(255 255 255 / 0.35);
  padding-bottom: 0.35rem;
}

/* —— Shell —— */

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 15.5rem 1fr;
}

.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 1.5rem 1.25rem 1.5rem 1.5rem;
  background: var(--white);
  border-right: 1px solid var(--line);
}

.rail__brand img {
  display: block;
  height: 1.35rem;
  width: auto;
}

.rail__label {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.rail__nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.rail__nav a {
  position: relative;
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.98rem;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.rail__nav a:hover {
  background: var(--paper);
}

.rail__nav a.is-active {
  background: rgb(16 29 92 / 0.08);
  color: var(--navy);
  font-weight: 700;
}

.rail__nav a.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.rail__footnote {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgb(16 29 92 / 0.03), transparent 12rem),
    var(--paper-2);
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem clamp(1rem, 3vw, 2.5rem);
  background: rgb(247 248 251 / 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(216 222 233 / 0.8);
}

.crumbs {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--white);
  padding: 0.7rem;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.menu span {
  display: block;
  height: 2px;
  background: var(--navy);
  border-radius: 1px;
}

.main {
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 3.5rem) 4rem;
}

.doc {
  max-width: 46rem;
  margin: 0 auto;
  animation: docIn 0.45s var(--ease) both;
}

.doc.is-loading {
  opacity: 0.35;
}

/* —— Controls —— */

.btn,
.ghost {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 650;
  border-radius: 0.55rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn {
  border: none;
  padding: 0.85rem 1.35rem;
  background: var(--accent);
  color: var(--white);
}

.btn:hover {
  transform: translateY(-1px);
  background: #1a84ff;
}

.btn--ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgb(255 255 255 / 0.35);
}

.btn--ghost:hover {
  background: rgb(255 255 255 / 0.08);
  border-color: rgb(255 255 255 / 0.55);
}

.ghost {
  border: 1px solid rgb(255 255 255 / 0.3);
  background: transparent;
  color: var(--white);
  padding: 0.55rem 0.95rem;
}

.ghost:hover {
  border-color: rgb(255 255 255 / 0.55);
  background: rgb(255 255 255 / 0.06);
}

.ghost--compact {
  border-color: var(--line);
  color: var(--navy);
  background: var(--white);
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.ghost--compact:hover {
  border-color: rgb(16 29 92 / 0.35);
  background: var(--paper);
}

/* —— Prose —— */

.prose > :first-child {
  margin-top: 0;
}

.prose h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--navy);
  margin: 0 0 1rem;
}

.prose h2 {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 2.5rem 0 0.85rem;
  padding-top: 0.5rem;
}

.prose h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
  margin: 1.75rem 0 0.6rem;
}

.prose p,
.prose li {
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgb(13 18 33 / 0.92);
}

.prose p {
  margin: 0 0 1rem;
}

.prose a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.prose a:hover {
  color: var(--navy);
}

.prose strong {
  font-weight: 700;
  color: var(--navy);
}

.prose ul,
.prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--accent);
  background: rgb(8 120 255 / 0.06);
  color: var(--ink);
}

.prose blockquote p {
  margin: 0;
}

.prose blockquote p + p {
  margin-top: 0.65rem;
}

.prose code {
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, monospace;
  font-size: 0.88em;
  background: rgb(16 29 92 / 0.07);
  padding: 0.12em 0.35em;
  border-radius: 0.3rem;
}

.prose pre {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  background: var(--navy-deep);
  color: #e8eefc;
  border-radius: 0.65rem;
  box-shadow: var(--shadow-soft);
}

.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.86rem;
  line-height: 1.55;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.75rem;
  font-size: 0.95rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  overflow: hidden;
}

.prose th,
.prose td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.prose th {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
  background: rgb(16 29 92 / 0.04);
}

.prose tr:last-child td {
  border-bottom: none;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.prose .doc-error {
  padding: 1.25rem;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 0.65rem;
}

/* —— Mobile —— */

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgb(10 19 64 / 0.45);
  z-index: 20;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: fixed;
    z-index: 30;
    left: 0;
    top: 0;
    width: min(18rem, 86vw);
    transform: translateX(-105%);
    transition: transform 0.35s var(--ease);
    box-shadow: var(--shadow-soft);
  }

  body.nav-open .rail {
    transform: translateX(0);
  }

  .menu {
    display: flex;
  }

  .splash__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .btn--ghost {
    text-align: center;
  }

  .prose table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes docIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gridDrift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-72px, -72px, 0);
  }
}

@keyframes orbFloat {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(12px, -18px, 0);
  }
}
