/* Landing page do LogN.
 *
 * Tokens tirados do design (`LogN Landing.dc.html`), os mesmos de
 * `docs/design_system/`. Escuro é o padrão; o claro vale quando o sistema pede.
 * Nenhum estilo inline: a CSP é `style-src 'self'`. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("/fonts/IBMPlexSans-Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("/fonts/IBMPlexSans-Medium.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("/fonts/IBMPlexSans-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/fonts/IBMPlexMono-Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/fonts/IBMPlexMono-Medium.ttf") format("truetype"); }

:root {
  --accent: #FF7A45;
  --accent-hover: #FF8D5E;
  --on-accent: #160B05;

  --canvas: #0B0C0D; --surface: #111316; --surface2: #171A1E;
  --line: #24282D; --line2: #343A41; --lineDim: #4C535B; --rowLine: #16191C;
  --text: #EDEEEF; --text2: #99A0A7; --text3: #7E858D;
  --tint: #241610; --tintOk: #0F2018; --tintErr: #231113; --tintInfo: #0D1B2B;
  --synKw: #C792EA; --accentInk: #FF7A45;
  --correct: #3DD68C; --correctInk: #3DD68C;
  --wrong: #FF5C5C; --wrongInk: #FF5C5C;
  --warnInk: #F5C451;
  --info: #5AA9FF; --infoInk: #5AA9FF;
  --header: rgba(11, 12, 13, 0.9);

  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --canvas: #F6F6F4; --surface: #FFFFFF; --surface2: #EEEFEB;
    --line: #E2E3DF; --line2: #CDD0CA; --lineDim: #A9AEA8; --rowLine: #ECEDEA;
    --text: #16181A; --text2: #4E545A; --text3: #656B72;
    --tint: #FDE9DF; --tintOk: #E6F5EC; --tintErr: #FBEAEA; --tintInfo: #E6EFFB;
    --synKw: #7A3FB0; --accentInk: #A83C0B;
    --correct: #0E8F52; --correctInk: #0A6B3C;
    --wrong: #C93636; --wrongInk: #A82424;
    --warnInk: #6E4800;
    --info: #1660C4; --infoInk: #124F9E;
    --header: rgba(246, 246, 244, 0.9);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100vh;
  background: var(--canvas); color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accentInk); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, h3, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }

.mono { font-family: var(--mono); }
.accent { color: var(--accentInk); }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 10; padding: 8px 12px; background: var(--accent); color: var(--on-accent); border-radius: 4px; }
.skip:focus { top: 12px; color: var(--on-accent); }

.wrap { max-width: 1180px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
@media (max-width: 520px) { .wrap { padding-left: 16px; padding-right: 16px; } }
.band { border-top: 1px solid var(--line); }
.band-alt { background: var(--surface); }
.section { padding-top: 80px; padding-bottom: 80px; }
.stack-10 { display: flex; flex-direction: column; gap: 10px; }
.stack-18 { display: flex; flex-direction: column; gap: 18px; }
.stack-40 { display: flex; flex-direction: column; gap: 40px; }
.split { display: grid; gap: 56px; align-items: center; }
.split-420 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.split-520 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }

/* --- Cabeçalho --------------------------------------------------------- */

.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--header);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { padding-top: 14px; padding-bottom: 14px; display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand:hover { color: var(--text); }
.brand-mark { fill: var(--accent); color: var(--accent); flex: 0 0 auto; }
.brand-name { font-size: 21px; font-weight: 600; letter-spacing: -0.04em; }
.nav { display: flex; gap: 24px; flex-wrap: wrap; font-size: 12px; letter-spacing: 0.1em; }
.nav a, .gh, .lang a { color: var(--text2); }
.nav a:hover, .gh:hover, .lang a:hover { color: var(--text); }
.top-end { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.gh { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.lang { display: flex; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; }
.lang a[aria-current="page"] { color: var(--text); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.btn-accent {
  display: flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 4px;
  background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.btn-accent:hover { background: var(--accent-hover); color: var(--on-accent); }
@media (max-width: 760px) { .nav { display: none; } }
@media (max-width: 520px) { .gh span { display: none; } .top-end { gap: 14px; } }

/* --- Hero -------------------------------------------------------------- */

.hero {
  padding-top: 88px; padding-bottom: 80px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 64px; align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.hero-row { display: flex; gap: 5px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; letter-spacing: 0.12em; color: var(--text3); }
h1 {
  font-size: clamp(42px, 6.2vw, 76px); line-height: 0.98; font-weight: 600;
  letter-spacing: -0.045em; text-wrap: balance;
}
.lead-lg { max-width: 520px; font-size: 19px; line-height: 1.5; color: var(--text2); text-wrap: pretty; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 6px; }
.note { font-size: 12px; letter-spacing: 0.08em; color: var(--text3); }

/* Com o app na loja, o selo oficial da Apple (`.store-badge`), sem mexer na arte.
 * Antes disso, `.store`: botão só com texto e sem o logotipo, que a Apple não deixa
 * usar fora do selo. */
.store-badge { display: block; flex: 0 0 auto; border-radius: 10px; }
.store-badge img { display: block; height: 56px; width: auto; }
.store {
  display: flex; align-items: center; height: 56px; padding: 0 22px;
  border-radius: 10px; background: #000; border: 1px solid var(--lineDim); color: #FFF;
}
.store:hover { border-color: var(--text); color: #FFF; }
.store-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.store-over { font-size: 11px; }
.store-name { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.btn-ghost {
  display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--line); font-size: 14px; color: var(--text);
}
.btn-ghost:hover { border-color: var(--lineDim); color: var(--text); }
.btn-ghost-sm { height: 48px; padding: 0 16px; border-radius: 4px; border-color: var(--lineDim); }
.btn-ghost-sm:hover { border-color: var(--text); }

/* --- Celular ----------------------------------------------------------- */

.phone-wrap { display: flex; justify-content: center; min-width: 0; }
.phone {
  width: 316px; max-width: 100%; border-radius: 48px; padding: 9px;
  background: #1C1E21; border: 1px solid #2E3237; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
}
.phone-screen { height: 680px; border-radius: 40px; overflow: hidden; background: var(--canvas); display: flex; flex-direction: column; }
.ph-status { height: 46px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 28px 0 30px; font-size: 14px; font-weight: 600; }
.ph-island { width: 88px; height: 26px; border-radius: 14px; background: #000; }
.ph-net { font-size: 11px; }
.ph-bar { padding: 22px 16px 0; display: flex; align-items: center; gap: 10px; }
.ph-close { color: var(--text2); }
.ph-problem { font-size: 11px; letter-spacing: 0.14em; color: var(--text2); }
.ph-clock { margin-left: auto; font-size: 14px; color: var(--text2); font-variant-numeric: tabular-nums; }
.ph-lives { display: flex; gap: 4px; color: var(--wrong); font-size: 14px; line-height: 1; }
.ph-lost { color: transparent; -webkit-text-stroke: 1.2px var(--text2); }
.ph-letters { padding: 14px 16px; display: flex; gap: 10px; border-bottom: 1px solid var(--line); }
.ph-l { display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: var(--mono); font-size: 8px; color: var(--text3); }
.ph-l svg { overflow: visible; }
.b-open { fill: none; stroke: var(--line2); stroke-width: 8; }
.b-current { fill: none; stroke: #FF6FB5; stroke-width: 8; }
.ph-body { flex: 1; display: flex; flex-direction: column; padding: 18px 14px 0; }
.ph-title { font-size: 9.5px; letter-spacing: 0.14em; color: var(--text2); padding: 0 2px; }
.ph-statement { margin: 10px 2px 0; font-size: 15px; line-height: 1.5; font-weight: 600; letter-spacing: -0.01em; text-wrap: pretty; }
.ph-code { margin-top: 14px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); padding: 10px 0; font-size: 11px; line-height: 24px; color: var(--text2); }
.ph-line { display: flex; align-items: center; padding: 0 12px; }
.ln { width: 20px; flex: 0 0 auto; color: var(--text3); }
.kw { color: var(--synKw); }
.fn { color: var(--infoInk); }
.indent { padding-left: 22px; }
.ph-slot { display: inline-block; width: 64px; height: 20px; margin: 0 8px; border: 1px dashed var(--accent); border-radius: 2px; }
.ph-drag { margin-top: 14px; font-size: 9.5px; letter-spacing: 0.14em; color: var(--text3); padding: 0 2px; }
.ph-drop { margin-top: 10px; height: 40px; border: 1px dashed var(--lineDim); border-radius: 2px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text3); }
.ph-chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.ph-chips span { padding: 11px 12px; border: 1px solid var(--line2); border-radius: 2px; background: var(--surface); font-size: 11px; white-space: pre; }
.ph-confirm { margin-top: auto; margin-bottom: 24px; height: 42px; border-radius: 4px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--text3); }

/* --- Seções ------------------------------------------------------------ */

.intro { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.intro-wide { max-width: 680px; }
.kicker { font-size: 12px; letter-spacing: 0.14em; color: var(--accentInk); }
h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.05; font-weight: 600; letter-spacing: -0.035em; text-wrap: balance; }
.lead { font-size: 17px; line-height: 1.55; color: var(--text2); text-wrap: pretty; }
.footnote { font-size: 13px; line-height: 1.6; color: var(--text3); max-width: 760px; }

.grid-cells {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
}
.formats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.stack-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.cell { background: var(--surface); padding: 26px 24px 28px; display: flex; flex-direction: column; gap: 14px; }
.cell-canvas { background: var(--canvas); padding: 20px 20px 22px; gap: 8px; }
.cell-head { display: flex; align-items: center; justify-content: space-between; }
.cell h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.cell-canvas h3 { font-size: 18px; }
.cell p { font-size: 15px; line-height: 1.55; color: var(--text2); text-wrap: pretty; }
.cell-canvas p { font-size: 14px; line-height: 1.5; }
.letter, .layer { font-size: 12px; letter-spacing: 0.12em; color: var(--text3); }
.layer { font-size: 11px; }
.verdict, .status { font-size: 11px; padding: 3px 7px; border: 1px solid currentColor; border-radius: 2px; }
.status { font-size: 10.5px; padding: 2px 6px; }
.t-ok { color: var(--correctInk); }
.t-err { color: var(--wrongInk); }
.t-warn { color: var(--warnInk); }
.sample {
  margin-top: auto; display: block; font-size: 12.5px; line-height: 1.6; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 3px; background: var(--canvas); white-space: pre-wrap;
}

/* --- Trilhas ----------------------------------------------------------- */

.families { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.families li {
  display: grid; grid-template-columns: 9px minmax(0, 210px) minmax(0, 1fr);
  align-items: baseline; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line);
}
@media (max-width: 520px) {
  .families li { grid-template-columns: 9px minmax(0, 1fr); }
  .fam-topics { grid-column: 2; }
}
.dot { width: 9px; height: 9px; border-radius: 50%; transform: translateY(-1px); }
.dot[data-c="algo"] { background: #3DB2FF; }
.dot[data-c="devops"] { background: #00B894; }
.dot[data-c="ai"] { background: #C77DFF; }
.fam-name { font-size: 16px; font-weight: 600; }
.fam-topics { font-size: 13px; color: var(--text2); }

.map-frame { border: 1px solid var(--line2); border-radius: 4px; background: var(--canvas); padding: 10px 0 18px; display: flex; justify-content: center; overflow: hidden; }
.map { position: relative; width: 340px; height: 430px; flex: 0 0 auto; }
@media (max-width: 380px) { .map { transform: scale(0.85); transform-origin: top center; margin-bottom: -64px; } }
.map-edges { position: absolute; inset: 0; }
.map-edges path { fill: none; stroke-width: 2.5; stroke-linecap: round; opacity: 0.8; }
.map-edges .edge-next { stroke: var(--accent); stroke-width: 3; opacity: 1; }
.map-edges .edge-locked { stroke: var(--lineDim); stroke-dasharray: 4 6; opacity: 1; }
.node { position: absolute; width: 0; display: flex; flex-direction: column; align-items: center; }
.node svg { display: block; flex: 0 0 auto; overflow: visible; }
.node .hl { fill: none; stroke: rgba(255, 255, 255, 0.6); stroke-width: 5.5; stroke-linecap: round; }
.tag {
  margin-top: 6px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--canvas); white-space: nowrap; font-size: 11.5px; font-weight: 600;
}
.n-adhoc { left: 170px; top: 20px; }
.n-arrays { left: 82px; top: 120px; }
.n-strings { left: 256px; top: 120px; }
.n-two { left: 82px; top: 220px; }
.n-bs { left: 257px; top: 214px; }
.n-sw { left: 170px; top: 350px; }
.is-current svg { fill: var(--tint); stroke: var(--accent); stroke-width: 5; }
.is-current .hl { stroke: rgba(255, 122, 69, 0.45); }
.is-current .tag { border-color: var(--accent); background: var(--tint); }
.is-locked svg { fill: var(--line2); }
.is-locked .tag { color: var(--text2); }

/* --- Placar ------------------------------------------------------------ */

.board-frame { border: 1px solid var(--line2); border-radius: 4px; background: var(--canvas); overflow-x: auto; min-width: 0; }
.board { width: 100%; min-width: 500px; border-collapse: collapse; }
.board caption { caption-side: top; text-align: left; }
.board-cap {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: 0.12em; color: var(--text3);
}
.badge-info { margin-left: auto; padding: 3px 7px; border: 1px solid var(--info); border-radius: 2px; color: var(--infoInk); background: var(--tintInfo); }
.board th { font-weight: 400; font-size: 10.5px; color: var(--text3); padding: 9px 2px; border-bottom: 1px solid var(--line); text-align: center; }
.board th:first-child, .board td:first-child { padding-left: 16px; width: 32px; text-align: left; }
.board th:last-child, .board td:last-child { padding-right: 16px; }
.board th.team, .board td.team { text-align: left; }
.board th.num, .board td.num { text-align: right; padding-right: 6px; }
.board td { padding: 7px 2px; border-bottom: 1px solid var(--rowLine); }
.board tr.me td { background: var(--tint); }
.board .rank { font-family: var(--mono); font-size: 12px; color: var(--text3); }
.board td.team { font-size: 13px; font-weight: 600; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.board tr.me td.team { color: var(--accentInk); }
.board td.num { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.board td.pen { font-size: 12px; color: var(--text2); }
.sub {
  width: 32px; height: 30px; margin: 0 auto; border: 1px solid var(--line); border-radius: 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--mono); line-height: 1.05; color: var(--text3);
}
.sub b { font-size: 11px; font-weight: 500; }
.sub small { font-size: 8.5px; }
.sub.ok { background: var(--tintOk); border-color: var(--correct); color: var(--correctInk); }
.sub.err { background: var(--tintErr); border-color: var(--wrong); color: var(--wrongInk); }
.sub.frz { background: var(--tintInfo); border-color: var(--info); color: var(--infoInk); }

/* --- Código ------------------------------------------------------------ */

.clone-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 14px; }
.clone {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; max-width: 100%;
  border: 1px solid var(--line); border-radius: 4px; background: var(--canvas); overflow-wrap: anywhere;
}

/* --- Fim e rodapé ------------------------------------------------------ */

.end { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; align-items: center; gap: 26px; text-align: center; }
.end-title { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.02; letter-spacing: -0.04em; max-width: 720px; }
.foot { padding-top: 28px; padding-bottom: 36px; display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; font-size: 12px; color: var(--text3); }
.foot-domain { color: var(--text); }
.foot-links { margin-left: auto; display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { color: var(--text2); }
.foot-links a:hover { color: var(--text); }
.foot-legal { flex-basis: 100%; font-size: 11px; line-height: 1.6; }

/* --- 404 --------------------------------------------------------------- */

.nf { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding-top: 80px; padding-bottom: 80px; }
.nf .verdict { align-self: flex-start; }

/* --- Revoada de balões no fim da página (site.js) ---------------------- */

.party { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.party .rise { position: absolute; animation: lognRise var(--dur) cubic-bezier(.3, .1, .5, 1) var(--delay) both; }
.party .sway { transform-origin: 50% 100%; animation: lognSway var(--sway) ease-in-out var(--delay) infinite; }
.party svg { display: block; overflow: visible; }
.party .hl { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 5.5; stroke-linecap: round; }
.party .string { fill: none; stroke-width: 3; stroke-linecap: round; opacity: 0.8; }
@keyframes lognRise {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  6% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translate3d(var(--dx), calc(-100vh - 260px), 0); opacity: 0; }
}
@keyframes lognSway { 0%, 100% { transform: rotate(var(--r0)); } 50% { transform: rotate(var(--r1)); } }
