/* Self-hosted variable fonts (latin subset, SIL Open Font License 1.1) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  --bg: #090b14;
  --card: #111426;
  --card-2: #151a2e;
  --row: rgba(255, 255, 255, 0.025);
  --row-hover: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.07);
  --text: #e9ecf5;
  --muted: #8a90a8;
  --dim: #80869e;

  --gold: #f2c14e;
  --gold-2: #c8902a;
  --apple: #8b7bff;
  --android: #3ee08f;
  --desktop: #2fd3e6;
  --tv: #e04fd8;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* Fixed glow layer instead of background-attachment: fixed (janky on mobile) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 123, 255, 0.12), transparent 60%),
    radial-gradient(800px 500px at 0% 30%, rgba(47, 211, 230, 0.06), transparent 60%),
    radial-gradient(700px 400px at 50% 110%, rgba(224, 79, 216, 0.08), transparent 60%);
}

a { color: inherit; }
button { font: inherit; }
svg { width: 1em; height: 1em; flex: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(9, 11, 20, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 193, 78, 0.45), rgba(139, 123, 255, 0.35), transparent);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(242, 193, 78, 0.25));
}
.brand-name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #ffe39a, var(--gold) 45%, var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.crumbs {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  color: var(--dim);
  display: flex;
  gap: 8px;
}
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* ---------- Language dropdown ---------- */
.lang { position: relative; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.lang-btn svg { font-size: 16px; color: var(--muted); }
.lang-btn .chev { font-size: 14px; transition: transform 0.2s; }
.lang-btn:hover,
.lang-btn:focus-visible,
.lang-btn[aria-expanded="true"] {
  background: rgba(242, 193, 78, 0.08);
  border-color: rgba(242, 193, 78, 0.4);
}
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #151a2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8);
  animation: menu-in 0.15s ease-out;
}
.lang-menu[hidden] { display: none; }
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.lang-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.lang-menu button:hover,
.lang-menu button:focus-visible { background: rgba(255, 255, 255, 0.06); outline-offset: -2px; }
.lang-code {
  display: grid;
  place-items: center;
  width: 30px;
  height: 22px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}
.lang-menu .tick { margin-left: auto; font-size: 15px; color: var(--gold); visibility: hidden; }
.lang-menu [aria-current="true"] .lang-code { color: #1a1206; background: var(--gold); }
.lang-menu [aria-current="true"] .tick { visibility: visible; }

/* ---------- Layout ---------- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 16px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--desktop);
  scroll-margin-top: 96px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(47, 211, 230, 0.4), transparent);
}
.section-label .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
}
#instrucoes { color: var(--gold); }
#instrucoes::after { background: linear-gradient(90deg, rgba(242, 193, 78, 0.45), transparent); }

/* ---------- Package card ---------- */
.pkg {
  --accent: var(--desktop);
  position: relative;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 14px;
  margin-bottom: 26px;
  overflow: hidden;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.8);
}
.pkg::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  /* Thin line on top plus an elliptical glow below; both fade to transparent on every side */
  background:
    linear-gradient(90deg, transparent 4%, var(--accent) 50%, transparent 96%) top / 100% 2px no-repeat,
    radial-gradient(50% 100% at 50% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
  pointer-events: none;
  opacity: 0.9;
}
.pkg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 120px at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
  pointer-events: none;
}
.pkg > * { position: relative; z-index: 1; }

.pkg--gold    { --accent: var(--gold); padding-bottom: 22px; }
.pkg--apple   { --accent: var(--apple); }
.pkg--android { --accent: var(--android); }
.pkg--desktop { --accent: var(--desktop); }
.pkg--tv      { --accent: var(--tv); }

.pkg-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.pkg-icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  font-size: 24px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--accent) 12%, transparent);
}
.pkg-title-wrap { flex: 1; min-width: 0; }
.pkg-title {
  margin: 0;
  flex: 1;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.pkg-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.badge {
  margin-left: auto;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  white-space: nowrap;
}

/* ---------- Rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: 32px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-radius: 12px;
  transition: background 0.15s;
}
.row + .row { margin-top: 2px; }
.row:hover { background: var(--row-hover); }

.row-icon {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 15px;
}
.row-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
a.row-name:hover,
a.row-name:focus-visible {
  color: #fff;
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  border-color: var(--accent);
  box-shadow: 0 0 16px -4px var(--accent);
}
.row-name--static {
  border-color: transparent;
  background: transparent;
  padding-left: 0;
}
.row-url {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-actions { display: flex; gap: 6px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.icon-btn:hover,
.icon-btn:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}
.icon-btn.copied { color: var(--android); }

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 7px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.chip--gold { --accent: var(--gold); font-size: 16px; }

/* ---------- Formuler instructions ---------- */
.step-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 2px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
}
.num {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--gold);
  background: rgba(242, 193, 78, 0.12);
  border: 1px solid rgba(242, 193, 78, 0.35);
}
.muted { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.muted b { color: var(--text); font-weight: 600; }

.device-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.device {
  background: var(--row);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.device h3 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}
.device ol {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: #c9cee0;
}
.device li { margin: 6px 0; }
.device li::marker { color: var(--dim); font-weight: 700; }
.device b { color: var(--text); font-weight: 600; }
.warn {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #ff7b7b;
  background: rgba(255, 90, 90, 0.1);
  border: 1px solid rgba(255, 90, 90, 0.3);
}
.colors { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.colors i {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #0b0d17;
}
.c-red    { background: #ff5d5d; }
.c-green  { background: #3ee08f; }
.c-yellow { background: #ffd34d; }
.c-blue   { background: #5aa2ff; }

.codes {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.codes-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}
.codes-row:nth-child(odd):not(.codes-row--head) { background: var(--row); }
.codes-row--head {
  background: rgba(242, 193, 78, 0.08);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.ver, .method {
  justify-self: start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.v2 { color: #b9a9ff; background: rgba(139, 123, 255, 0.14); border: 1px solid rgba(139, 123, 255, 0.35); }
.v3 { color: #6fefae; background: rgba(62, 224, 143, 0.12); border: 1px solid rgba(62, 224, 143, 0.35); }
.v4 { color: #7fb6ff; background: rgba(90, 162, 255, 0.12); border: 1px solid rgba(90, 162, 255, 0.35); }
.m-mac  { color: #6be6f2; background: rgba(47, 211, 230, 0.1); border: 1px solid rgba(47, 211, 230, 0.3); }
.m-user { color: #ffb36b; background: rgba(255, 150, 60, 0.1); border: 1px solid rgba(255, 150, 60, 0.3); }
.code-cell { display: flex; align-items: center; gap: 6px; }

.usb {
  display: flex;
  gap: 14px;
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(242, 193, 78, 0.06);
  border: 1px solid rgba(242, 193, 78, 0.25);
}
.usb-icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 11px;
  font-size: 20px;
  color: var(--gold);
  background: rgba(242, 193, 78, 0.12);
  flex: none;
}
.usb-title { margin: 0; font-weight: 700; }
.usb .muted { margin-top: 2px; }

.glossary {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 18px;
}
.glossary summary {
  cursor: pointer;
  padding: 14px 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.glossary summary:hover { color: var(--text); }
.glossary dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0 0 16px;
  font-size: 14px;
}
.glossary dl div { display: flex; gap: 8px; flex-wrap: wrap; }
.glossary dt { font-weight: 600; }
.glossary dt::after { content: " ="; color: var(--dim); }
.glossary dd { margin: 0; color: var(--muted); }

/* ---------- Footer & toast ---------- */
.footer {
  text-align: center;
  padding: 10px 16px 36px;
  font-size: 12px;
  color: var(--dim);
  font-family: var(--mono);
  font-weight: 500;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #1b2036;
  border: 1px solid rgba(62, 224, 143, 0.4);
  color: var(--android);
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .device-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar-inner { padding: 8px 16px; }
  .brand img { width: 46px; height: 46px; }
  .crumbs { display: none; }
  .wrap { padding: 20px 16px 32px; }
  .pkg { padding: 18px 14px 10px; }
  .pkg-icon { width: 44px; height: 44px; font-size: 20px; }
  .pkg-title { font-size: 16px; }

  .row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    grid-template-areas: "icon name actions" "icon url actions";
    row-gap: 6px;
    padding: 10px 6px;
  }
  .row-icon { grid-area: icon; align-self: start; }
  .row-name { grid-area: name; justify-self: start; white-space: normal; }
  .row-url { grid-area: url; font-size: 12px; }
  .row-actions { grid-area: actions; }
  .icon-btn { width: 40px; height: 40px; }

  /* minmax(0, 1fr) + wrapping pills keep the copy button inside the card on narrow phones */
  .codes-row { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; }
  .method { max-width: 100%; white-space: normal; border-radius: 12px; }
  .codes-row .ver { grid-column: 1; }
  .codes-row .method { grid-column: 1; grid-row: 2; }
  .codes-row .code-cell { grid-column: 2; grid-row: 1 / span 2; }
  .codes-row--head span:nth-child(2) { display: none; }
  .glossary dl { grid-template-columns: 1fr; }
}

/* Very narrow phones: version + method on top, code below */
@media (max-width: 400px) {
  .codes-row { grid-template-columns: auto minmax(0, 1fr); }
  .codes-row .method { grid-column: 2; grid-row: 1; }
  .codes-row .code-cell { grid-column: 1 / -1; grid-row: 2; }
  .codes-row--head span:nth-child(2) { display: block; }
  .codes-row--head span:nth-child(3) { display: none; }
}

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