/* The link-in-bio pages (/links, /links-en), drawn with the design system's tokens (/ds/tokens.css: colours,
   fonts, radii, the accent per data-pillar) and laid out like a Linktree page: two round buttons at the top,
   the avatar, the name, the description, the networks' logos, then the links as big buttons.

   One theme per stop of the home's journey (public/home/space.js). The spaceship button (public/links.js)
   sets data-pillar on <html>, and the design system gives the accent:
     blog      (violet)  the purple ringed planet, the default
     fabrica   (amber)   the amber galaxy
     marketing (red)     the red planet
     lideranca (teal)    the Earth, on the design system's own night (bg-000)
   Each theme has its own sky (--noite), its planet as the avatar and the accent's glow behind it. */

/* registered as colours, so a change of theme fades instead of jumping */
@property --accent { syntax: '<color>'; inherits: true; initial-value: #8b6cff; }
@property --accent-soft { syntax: '<color>'; inherits: true; initial-value: #c9b8ff; }
@property --noite { syntax: '<color>'; inherits: true; initial-value: #0b1220; }
@property --cta { syntax: '<color>'; inherits: true; initial-value: #5a3ce6; }
@property --sobre-cta { syntax: '<color>'; inherits: true; initial-value: #e6ecf5; }

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  /* the sky: the pillar's colour, deep in the night */
  --noite: color-mix(in oklab, var(--violet) 30%, #000);
  --planeta: url(/favicon.svg);
  /* the CTA, filled as the system's main button: ink on violet (a deeper violet, so the small text reads),
     the dark bg-000 on amber, red and teal */
  --cta: color-mix(in oklab, var(--violet) 78%, #000); --sobre-cta: var(--ink);
  /* what follows the accent by itself */
  --cartao: color-mix(in oklab, var(--noite), var(--accent) 9%);
  --cartao-hover: color-mix(in oklab, var(--noite), var(--accent) 20%);
  --brilho: color-mix(in srgb, var(--accent) 33%, transparent);   /* the system's glow-accent, in the theme's accent */
  background: var(--noite);
  transition: --accent .6s, --accent-soft .6s, --noite .6s, --cta .6s, --sobre-cta .6s;
  scrollbar-width: thin; scrollbar-color: var(--cartao-hover) transparent;
}
/* without JavaScript nothing sets data-pillar: the default theme's accent */
html:not([data-pillar]) { --accent: var(--violet); --accent-soft: var(--violet-soft); }
html[data-pillar="fabrica"] { --noite: color-mix(in oklab, var(--amber) 22%, #000); --planeta: url(/links/galaxia-ambar.svg); --cta: var(--amber); --sobre-cta: var(--bg-000); }
html[data-pillar="marketing"] { --noite: color-mix(in oklab, var(--red-900) 52%, #000); --planeta: url(/links/planeta-vermelho.svg); --cta: var(--red); --sobre-cta: var(--bg-000); }
html[data-pillar="lideranca"] { --noite: var(--bg-000); --planeta: url(/links/terra.svg); --cta: var(--teal); --sobre-cta: var(--bg-000); }

body {
  min-height: 100vh; min-height: 100svh;
  font-family: var(--font-body); color: var(--ink); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* the sky above the page: the accent's light coming from the planet, and a few stars (ink, 20 to 40%) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  --estrela: color-mix(in srgb, var(--ink) 40%, transparent);
  --estrela-2: color-mix(in srgb, var(--ink) 24%, transparent);
  background:
    radial-gradient(1.5px 1.5px at 9% 14%, var(--estrela) 50%, transparent 52%),
    radial-gradient(1px 1px at 22% 62%, var(--estrela) 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 88% 22%, var(--estrela) 50%, transparent 52%),
    radial-gradient(1px 1px at 76% 71%, var(--estrela-2) 50%, transparent 52%),
    radial-gradient(1px 1px at 41% 88%, var(--estrela-2) 50%, transparent 52%),
    radial-gradient(1px 1px at 94% 52%, var(--estrela-2) 50%, transparent 52%),
    radial-gradient(1px 1px at 5% 80%, var(--estrela-2) 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 63% 9%, var(--estrela-2) 50%, transparent 52%),
    radial-gradient(ellipse 150% 62% at 50% -10%, color-mix(in oklab, var(--accent) 38%, transparent), transparent 72%);
}

a { color: var(--ink); }
/* text for screen readers and for the page's Markdown, where a logo stands for it on screen */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.barra, .page, footer { max-width: 30rem; margin: 0 auto; }

/* the top: the spaceship (left) and the share button (right) */
.barra { padding: .8rem 16px 0; min-height: calc(44px + .8rem); display: flex; justify-content: space-between; }
.barra button {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--cartao); color: var(--ink);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color .15s, transform .15s;
}
.barra button:hover, .barra button:focus-visible { border-color: var(--accent); background: var(--cartao-hover); }
.barra button:active { transform: scale(.94); }
.barra svg { display: block; width: 21px; height: 21px; }
.barra .nave.partindo svg { animation: decolar .55s ease-in-out; }
@keyframes decolar {
  45% { transform: translate(16px, -16px); opacity: 0; }
  46% { transform: translate(-16px, 16px); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

.page { padding: .2rem 16px 3rem; text-align: center; }

/* the avatar: the theme's planet, with the one effect of the system (the accent's glow) behind it */
.avatar {
  width: 96px; height: 96px; margin: 0 auto;
  border-radius: 50%; border: 1px solid var(--line);
  background: var(--noite) var(--planeta) center / cover no-repeat;
  box-shadow: 0 0 90px 14px var(--brilho);
  transition: transform .28s ease-in, opacity .28s ease-in;
}
.avatar.viajando { transform: scale(.35) rotate(-25deg); opacity: 0; }

.page h1 { margin-top: 1rem; font: 800 clamp(1.75rem, 7vw, 2.2rem)/1.05 var(--font-display); letter-spacing: -.015em; }
.page .lead { margin-top: .6rem; font-size: .95rem; line-height: 1.5; color: var(--ink-muted); }

/* the networks, as their logos, right under the description */
.redes { list-style: none; margin-top: .9rem; display: flex; justify-content: center; gap: .15rem; }
.redes a {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: var(--radius-pill); color: var(--ink); text-decoration: none;
  transition: color .15s, transform .15s;
}
.redes svg { display: block; width: 26px; height: 26px; }
.redes a:hover, .redes a:focus-visible { color: var(--accent-soft); transform: translateY(-2px); }

.page section { margin-top: 1.4rem; }
.page section + section { margin-top: 2rem; }
/* a section's name: the system's eyebrow */
.page h2:not(.sr-only) { margin-bottom: .8rem; font: 500 .7rem/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-soft); }

/* the links: the system's cards */
.links { list-style: none; }
.links li + li { margin-top: .7rem; }
.links a {
  display: block; min-height: 3.5rem; padding: .9rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--cartao);
  text-decoration: none; overflow-wrap: break-word;
  transition: border-color .15s, transform .15s;
}
.links a strong { display: block; font: 700 1rem/1.25 var(--font-display); letter-spacing: -.005em; color: var(--ink); }
.links a span { display: block; margin-top: .25rem; font-size: .84rem; line-height: 1.4; color: var(--ink-muted); }
.links a:hover, .links a:focus-visible { border-color: var(--accent); background: var(--cartao-hover); transform: translateY(-1px); }
.links a:focus-visible, .redes a:focus-visible, .barra button:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
/* the CTA that opens the first section: the one theme being promoted on the social profiles right now.
   One per page, and the only filled button (the system's rule for a main CTA) */
.links a.cta { padding: 1.05rem 1.1rem 1.15rem; border-color: transparent; background: var(--cta); color: var(--sobre-cta); }
.links a.cta em { display: block; font: 600 .68rem/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.links a.cta strong { margin-top: .35rem; font-size: 1.25rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: inherit; }
.links a.cta span { margin-top: .35rem; font-size: .88rem; color: inherit; }
.links a.cta:hover, .links a.cta:focus-visible { border-color: transparent; background: var(--cta); filter: brightness(1.1); }

footer { padding: 1.5rem 16px 3rem; border-top: 1px solid var(--line); font-size: .8rem; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; }
footer a { color: var(--ink-muted); text-underline-offset: .22em; }
footer a:hover, footer a:focus-visible { color: var(--ink); }

/* what the buttons at the top say back: "Link copiado", "Destino: Terra" */
.aviso {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 20;
  padding: .6rem 1.1rem;
  border: 1px solid var(--accent); border-radius: var(--radius-pill); background: var(--cartao);
  font: 500 .74rem/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; transform: translate(-50%, .8rem); pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.aviso.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  html, .avatar, .aviso, .links a, .redes a, .barra button { transition: none; }
  .barra .nave.partindo svg { animation: none; }
  .links a:hover, .links a:focus-visible, .redes a:hover, .redes a:focus-visible { transform: none; }
}
