.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
}

.orb-a {
  width: 28rem;
  height: 28rem;
  right: -4rem;
  top: -8rem;
  background:
    radial-gradient(circle at 40% 40%, rgba(255, 214, 140, 0.35), rgba(255, 214, 140, 0) 62%);
}

.orb-b {
  width: 36rem;
  height: 36rem;
  left: -10rem;
  top: 8rem;
  background: radial-gradient(circle at 50% 50%, rgba(124, 98, 186, 0.28), transparent 68%);
}

.orb-c {
  width: 28rem;
  height: 28rem;
  right: 18%;
  bottom: -8rem;
  background: radial-gradient(circle at 50% 50%, rgba(42, 79, 173, 0.14), transparent 70%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.meridians {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  border-bottom: 0;
  background: rgba(246, 241, 232, 0.55);
  box-shadow: inset 0 -1px 0 rgba(21, 35, 63, 0.06);
}

.site-header.is-scrolled {
  background: rgba(246, 241, 232, 0.92);
  box-shadow:
    0 18px 40px rgba(21, 35, 63, 0.06),
    inset 0 -1px 0 rgba(21, 35, 63, 0.06);
}

.header-shine {
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(227, 148, 29, 0.7), rgba(109, 174, 58, 0.45), rgba(42, 79, 173, 0.55), transparent);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.5rem;
  filter: drop-shadow(0 0 10px rgba(227, 148, 29, 0.35));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-tag {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 0.28rem;
  font-weight: 600;
}

.site-nav a {
  position: relative;
  padding: 0.2rem 0;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  background: linear-gradient(90deg, var(--mark-orange), var(--violet));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}

.site-nav a:hover::after,
.site-nav a.is-active::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-nav a.is-active,
.site-nav a[aria-current="page"] {
  box-shadow: none;
}

.header-search {
  border-radius: 999px;
  padding-left: 0.9rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 20px rgba(21, 35, 63, 0.04);
}

.header-search:focus-within {
  border-color: rgba(74, 45, 115, 0.35);
  box-shadow: 0 0 0 3px rgba(227, 148, 29, 0.2);
}

.header-search button {
  border-radius: 999px;
}

.icon-link {
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.7);
  border-color: var(--line);
}

.hero {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  align-items: center;
  gap: 2rem 2.5rem;
  padding: 2.2rem 0 2.4rem;
  overflow: hidden;
}

.hero-sky {
  position: relative;
  inset: auto;
  z-index: 0;
  width: 100%;
  max-width: none;
  height: 18.5rem;
  justify-self: stretch;
  pointer-events: none;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow:
    0 16px 36px rgba(21, 35, 63, 0.1),
    0 0 0 1px rgba(21, 35, 63, 0.06);
}

.hero-sky svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 0;
  max-width: none;
}

.folio {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.folio::before {
  content: "";
  width: 2.2rem;
  height: 1px;
  background: var(--amber);
}

.hero h1 {
  font-size: clamp(2.3rem, 4.4vw, 3.7rem);
  line-height: 1.05;
  max-width: 16ch;
  text-shadow: none;
}

.hero-lede {
  font-size: 1.15rem;
  max-width: 42ch;
}

.btn-primary {
  border-radius: 999px;
  padding: 0.95rem 1.45rem;
  background:
    linear-gradient(180deg, #1d2d4e, #15233f);
  box-shadow:
    0 0 0 1px #15233f,
    0 12px 28px rgba(21, 35, 63, 0.22),
    0 0 24px rgba(227, 148, 29, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  color: var(--paper-2);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px #15233f,
    0 16px 34px rgba(21, 35, 63, 0.26),
    0 0 28px rgba(227, 148, 29, 0.28);
}

.btn-ghost {
  position: relative;
}

.featured-pull {
  margin: 0 0 3rem 0;
  width: 100%;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--line);
  background: var(--paper-2);
  box-shadow: none;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.2rem;
  align-items: start;
}

.featured-num {
  font-family: var(--serif);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--violet);
  letter-spacing: -0.04em;
}

.featured-pull .kicker {
  margin: 0;
}

.section-head h2 {
  position: relative;
}

.section-head h2::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 3px;
  margin-top: 0.7rem;
  background: linear-gradient(90deg, var(--mark-orange), transparent);
}

.star-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 0.4rem 0 1.4rem;
}

.star-node {
  position: relative;
  text-decoration: none;
  color: inherit;
  padding: 1.2rem 1.25rem 1.3rem;
  max-width: none;
  min-height: 100%;
  background: var(--paper-2);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.star-dot {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-bottom: 0.55rem;
  box-shadow: 0 0 0 4px rgba(227, 148, 29, 0.12);
  background: var(--mark-orange);
}

.star-node[data-tone="2"] .star-dot {
  background: var(--mark-blue);
  box-shadow: 0 0 0 4px rgba(42, 79, 173, 0.12);
}

.star-node[data-tone="3"] .star-dot {
  background: var(--violet);
  box-shadow: 0 0 0 4px rgba(74, 45, 115, 0.12);
}

.star-node[data-tone="4"] .star-dot {
  background: var(--mark-green);
  box-shadow: 0 0 0 4px rgba(109, 174, 58, 0.14);
}

.star-node:hover {
  border-color: rgba(74, 45, 115, 0.35);
  box-shadow: 0 10px 24px rgba(21, 35, 63, 0.06);
}

.star-node strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.star-node em {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--violet);
  margin: 0.25rem 0 0.45rem;
}

.star-node span {
  font-size: 0.95rem;
  line-height: 1.5;
}

.hubs-stage {
  display: grid;
  gap: 1.1rem;
  padding-bottom: 2rem;
}

.hub-band {
  min-height: 0;
  padding: 1.6rem 1.6rem 1.5rem;
  border: 1px solid var(--line);
  box-shadow: none;
  transition: border-color 0.2s ease;
}

.hub-band:hover {
  transform: none;
  border-color: rgba(74, 45, 115, 0.35);
}

.hub-art {
  justify-self: end;
  width: min(16rem, 100%);
  align-self: center;
  display: grid;
}

.hub-art svg {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 8.5rem;
}

.hub-band .kicker {
  color: var(--amber);
}

.page-intro {
  position: relative;
  padding: 2.6rem 0 1.4rem 1.1rem;
}

.page-intro::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2.8rem;
  width: 3px;
  height: 2.4rem;
  background: linear-gradient(180deg, var(--mark-orange), var(--violet));
}

.guide-hero {
  position: relative;
  max-width: 48rem;
  padding: 2.4rem 0 2rem;
}

.guide-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 8rem;
  background:
    radial-gradient(360px 120px at 0% 0%, rgba(227, 148, 29, 0.12), transparent 70%),
    radial-gradient(320px 120px at 100% 0%, rgba(74, 45, 115, 0.08), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.guide-hero[data-cat="optica"]::before,
.guide-hero[data-cat="fenomenos-espaciais"]::before {
  background:
    radial-gradient(480px 180px at 12% 30%, rgba(227, 148, 29, 0.2), transparent 60%),
    radial-gradient(420px 160px at 80% 10%, rgba(42, 79, 173, 0.14), transparent 62%);
}

.guide-hero[data-cat="eletricidade"]::before,
.guide-hero[data-cat="fisica-atmosferica"]::before {
  background:
    radial-gradient(420px 180px at 20% 0%, rgba(227, 148, 29, 0.22), transparent 55%),
    radial-gradient(380px 160px at 90% 40%, rgba(21, 35, 63, 0.1), transparent 60%);
}

.guide-hero[data-cat="magnetismo"]::before,
.guide-hero[data-cat="gravidade"]::before {
  background:
    radial-gradient(460px 180px at 10% 20%, rgba(74, 45, 115, 0.16), transparent 58%),
    radial-gradient(360px 140px at 85% 0%, rgba(42, 79, 173, 0.12), transparent 60%);
}

.guide-row {
  padding: 1.2rem 0;
  border-top-color: transparent;
  box-shadow: inset 0 1px 0 var(--line);
  transition: background 0.2s ease;
}

.guide-row:hover {
  background: transparent;
  padding-left: 0;
}

.guide-row h2 {
  font-size: 1.45rem;
}

.level-tag {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.7);
}

.toc {
  background: rgba(255, 253, 248, 0.55);
  border: 1px solid rgba(213, 203, 184, 0.7);
  padding: 1rem 0.85rem 1.1rem;
  box-shadow: 8px 12px 30px rgba(21, 35, 63, 0.04);
}

.guide-body h2 {
  position: relative;
  padding-left: 0.15rem;
}

.diagram {
  border: 0;
  padding: 1.15rem 1.15rem 1rem;
  box-shadow:
    0 0 0 1px rgba(213, 203, 184, 0.9),
    0 24px 50px rgba(21, 35, 63, 0.07);
  background:
    radial-gradient(480px 200px at 12% 0%, rgba(227, 148, 29, 0.14), transparent 50%),
    radial-gradient(380px 180px at 90% 80%, rgba(74, 45, 115, 0.08), transparent 50%),
    #fffdf8;
}

.formula {
  box-shadow: inset 0 0 0 1px rgba(74, 45, 115, 0.08);
}

.related-grid a {
  padding: 1.2rem 0.2rem 0.4rem;
  border-top-width: 3px;
  border-image: linear-gradient(90deg, var(--mark-orange), var(--violet)) 1;
  transition: transform 0.22s ease;
}

.related-grid a:hover {
  transform: translateY(-3px);
}

.related-grid a strong {
  font-size: 1.5rem;
}

.glossary-index a {
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.7);
}

.glossary-term h2 {
  color: var(--violet);
}

.site-footer {
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(700px 240px at 80% 0%, rgba(74, 45, 115, 0.12), transparent 55%),
    #e8dfcc;
  padding-top: 3.2rem;
}

.footer-aurora {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(227, 148, 29, 0.12), rgba(42, 79, 173, 0.1), transparent);
  height: 3px;
  top: 0;
}

.footer-giant {
  position: absolute;
  right: 1.2rem;
  bottom: 0.4rem;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: -0.04em;
  color: rgba(21, 35, 63, 0.05);
  pointer-events: none;
  line-height: 1;
}

.toolbar select {
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
}

.err-page h1 {
  background: linear-gradient(180deg, var(--ink), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (max-width: 900px) {
  .hero {
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding: 1.4rem 0 1.6rem;
    gap: 1.4rem;
  }

  .hero-sky {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: none;
    height: 12.5rem;
    order: -1;
    margin: 0;
    justify-self: stretch;
    border-radius: 1rem;
  }

  .hero-copy {
    padding: 0.2rem 0 0;
  }

  .featured-pull,
  .star-node {
    grid-template-columns: 1fr;
  }

  .star-map {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .star-map {
    grid-template-columns: 1fr;
  }

  .page-intro::before {
    left: 0;
  }

  .hub-art {
    justify-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .star-node,
  .hub-band,
  .related-grid a,
  .btn-primary {
    transition: none;
  }
}
