/* shellby.org — account screens.
   Tokens: dark by default; light via the navbar toggle (html[data-theme=light]). 4px spacing grid.
   Motion: 180ms ease-out, disabled under prefers-reduced-motion. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #07090d;
  --bg-elev: #0b0e14;
  --surface: #0f131a;
  --surface-2: #151a23;
  --surface-3: #1b2130;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #eef2f7;
  --text-2: #a4aebf;
  --dim: #6b7588;
  --accent: #2ee6f2;
  --accent-strong: #7df2f8;
  --accent-ink: #021417;
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 38%, transparent);
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #fb7185;
  --ring: 0 0 0 3px color-mix(in oklab, var(--accent) 28%, transparent);
  --shadow-lg: 0 32px 80px -32px rgba(0, 0, 0, 0.7), 0 8px 24px -8px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --r-lg: 16px;
  --r: 10px;
  --r-sm: 8px;
  --motion: 180ms;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f7f8fa;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e9edf2;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0d1320;
  --text-2: #475467;
  --dim: #7a8699;
  --accent: #0891a8;
  --accent-strong: #067385;
  --accent-ink: #ffffff;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #e11d48;
  --shadow-lg: 0 32px 80px -40px rgba(15, 23, 42, 0.25), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
}


*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--sans);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; border-radius: 4px; transition: color var(--motion) var(--ease); }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: none; box-shadow: var(--ring); }
::selection { background: color-mix(in oklab, var(--accent) 30%, transparent); }

.skip-link {
  position: fixed;
  left: 16px;
  top: -48px;
  z-index: 50;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  transition: top var(--motion) var(--ease);
}
.skip-link:focus { top: 16px; }

/* ================= layout ================= */

body.layout-split {
  display: grid;
  grid-template-columns: minmax(420px, 44fr) 56fr;
}
body.layout-app { display: block; }
body.layout-app .brand-panel { display: none; }

.main-col {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 32px;
  min-height: 72px;
}
body.layout-split .topbar .wordmark { visibility: hidden; }
body.layout-app .topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  padding: 12px 24px;
  min-height: 64px;
}
.top-actions { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-2); }

.stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 32px 48px;
  outline: none;
}
.stage:focus, .stage:focus-visible { box-shadow: none; }
body.layout-app .stage { align-items: flex-start; padding: 40px 24px 80px; }
.panel {
  width: 100%;
  max-width: 400px;
  animation: rise 320ms var(--ease) both;
}
.panel.wide { max-width: 1000px; }

.legal {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 16px 32px 24px;
  font-size: 13px;
  color: var(--dim);
}
.legal a { color: var(--dim); }
.legal a:hover { color: var(--text); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ================= brand panel ================= */

.brand-panel {
  position: sticky;
  top: 0;
  overflow: hidden;
  height: 100dvh;
  background: #05070a;
  color: #eef2f7;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  isolation: isolate;
}
.aurora { position: absolute; inset: -20%; z-index: -2; filter: blur(60px); opacity: 0.9; }
.aurora span {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: drift 22s var(--ease) infinite alternate;
}
.aurora span:nth-child(1) { width: 60%; height: 50%; left: 10%; top: 40%; background: radial-gradient(closest-side, rgba(46, 230, 242, 0.42), transparent); }
.aurora span:nth-child(2) { width: 55%; height: 45%; left: 45%; top: 15%; background: radial-gradient(closest-side, rgba(88, 101, 242, 0.32), transparent); animation-duration: 28s; animation-delay: -6s; }
.aurora span:nth-child(3) { width: 45%; height: 40%; left: 20%; top: 70%; background: radial-gradient(closest-side, rgba(16, 185, 129, 0.18), transparent); animation-duration: 34s; animation-delay: -12s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6%, -4%, 0) scale(1.08); }
  100% { transform: translate3d(-5%, 5%, 0) scale(0.96); }
}
.grid-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 55%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 55%, #000 30%, transparent 80%);
}
.brand-inner {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 28px 48px 40px;
  gap: 24px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font: 700 19px/1 var(--mono);
  letter-spacing: -0.4px;
  width: max-content;
  padding: 4px;
  margin-left: -4px;
}
.wordmark:hover { color: inherit; }
.wordmark img { width: 30px; height: 30px; filter: drop-shadow(0 0 10px rgba(46, 230, 242, 0.45)); }
.wordmark.compact { color: var(--text); font-size: 17px; }
.wordmark.compact img { width: 26px; height: 26px; }
.brand-copy { width: 100%; max-width: 560px; container-type: inline-size; text-align: center; }
.brand-copy h2 {
  /* Uma linha em qualquer largura do painel: a fonte acompanha o container. */
  white-space: nowrap;
  font-size: clamp(24px, calc(100cqi / 13.2), 46px);
  line-height: 1.08;
  font-weight: 650;
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, #ffffff 0%, #b9c4d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-copy p { margin-top: 16px; font-size: 16px; line-height: 1.6; color: #93a0b4; }
.character {
  align-self: center;
  justify-self: center;
  width: min(400px, 78%);
  max-height: 100%;
  animation: float 7s ease-in-out infinite;
}
.character img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 30px 60px rgba(46, 230, 242, 0.18)); }
@keyframes float { 50% { transform: translateY(-10px); } }

@media (max-width: 960px) {
  body.layout-split { display: block; }
  .brand-panel { display: none; }
  body.layout-split .topbar .wordmark { visibility: visible; }
  .topbar { padding: 16px 20px; min-height: 64px; }
  .stage { align-items: flex-start; padding: 16px 20px 40px; }
  .legal { padding: 16px 20px 24px; }
  body.layout-split .stage { padding-top: 24px; }
}

/* ================= typography ================= */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
h1 { font-size: 28px; line-height: 36px; font-weight: 650; letter-spacing: -0.025em; }
.lead { margin-top: 8px; color: var(--text-2); font-size: 15px; line-height: 24px; }
.lead strong { color: var(--text); font-weight: 600; }
.caption { color: var(--dim); font-size: 13px; line-height: 20px; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.grow { flex: 1; min-width: 0; }

/* ================= forms =================
   Every field has the same structure: .field > .field-head > label, then
   .control, then .hint. Spacing lives on the structure, never on a label. */

form { margin-top: 28px; }
.divider + form { margin-top: 24px; }
.field + .field { margin-top: 20px; }
.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  min-height: 20px;
}
.field-head label { font-size: 13px; line-height: 20px; font-weight: 550; color: var(--text); }
.field-head a { font-size: 13px; line-height: 20px; font-weight: 500; }
.control { position: relative; display: flex; align-items: center; }
.control .lead-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--dim);
  pointer-events: none;
  transition: color var(--motion) var(--ease);
}
.control .lead-icon svg { width: 18px; height: 18px; display: block; }
.control .lead-icon.at { font: 600 16px/18px var(--mono); text-align: center; }
.control:focus-within .lead-icon { color: var(--accent); }
input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border-radius: var(--r);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--motion) var(--ease), box-shadow var(--motion) var(--ease), background var(--motion) var(--ease);
}
input::placeholder { color: var(--dim); }
input:hover { border-color: color-mix(in oklab, var(--text) 22%, transparent); }
input:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: var(--ring);
}
input[aria-invalid='true'] { border-color: color-mix(in oklab, var(--danger) 70%, transparent); }
input[aria-invalid='true']:focus { box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 22%, transparent); }
input.mono { font-family: var(--mono); letter-spacing: 0.01em; }
input.has-suffix { padding-right: 46px; }
input:disabled { opacity: 0.55; }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-elev) inset;
  caret-color: var(--text);
}
.suffix {
  position: absolute;
  right: 5px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: color var(--motion) var(--ease), background var(--motion) var(--ease);
}
button.suffix:hover { color: var(--text); background: var(--surface-2); }
.suffix svg { width: 18px; height: 18px; }
.status-mark { pointer-events: none; opacity: 0; transform: scale(0.8); transition: opacity var(--motion) var(--ease), transform var(--motion) var(--ease); }
.status-mark.show { opacity: 1; transform: none; }
.status-mark.ok { color: var(--ok); }
.status-mark.bad { color: var(--danger); }
.hint {
  margin-top: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--dim);
  transition: color var(--motion) var(--ease);
}
.hint:empty { display: none; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--danger); }

.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.meter span { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background var(--motion) var(--ease); }
.meter[data-score='1'] span:nth-child(-n + 1) { background: var(--danger); }
.meter[data-score='2'] span:nth-child(-n + 2) { background: var(--warn); }
.meter[data-score='3'] span:nth-child(-n + 3) { background: var(--accent); }
.meter[data-score='4'] span { background: var(--ok); }

/* ================= buttons ================= */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: 600 14px/1 var(--sans);
  letter-spacing: -0.005em;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background var(--motion) var(--ease), border-color var(--motion) var(--ease), color var(--motion) var(--ease), transform 90ms var(--ease), opacity var(--motion) var(--ease), box-shadow var(--motion) var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: color-mix(in oklab, var(--text) 20%, transparent); color: var(--text); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.block { width: 100%; }
.btn.lg { height: 48px; font-size: 15px; }
.btn.primary {
  border-color: transparent;
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-strong) -40%, var(--accent) 60%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 8px 24px -8px color-mix(in oklab, var(--accent) 55%, transparent);
}
.btn.primary:hover:not(:disabled) {
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent-strong) -10%, var(--accent) 80%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 12px 28px -8px color-mix(in oklab, var(--accent) 65%, transparent);
}
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: color-mix(in oklab, var(--danger) 10%, transparent); border-color: color-mix(in oklab, var(--danger) 40%, transparent); color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn .spinner { display: none; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading .spinner { display: block; position: absolute; inset: 0; margin: auto; }
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--text) 18%, transparent);
  border-top-color: var(--text);
  animation: spin 700ms linear infinite;
}
.btn.primary .spinner { border-color: color-mix(in oklab, var(--accent-ink) 25%, transparent); border-top-color: var(--accent-ink); }
@keyframes spin { to { transform: rotate(360deg); } }

.oauth { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.oauth.single { grid-template-columns: 1fr; }
.oauth .btn { height: 46px; font-weight: 550; }
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  font-size: 12px;
  color: var(--dim);
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }

.alt { margin-top: 28px; text-align: center; font-size: 14px; color: var(--text-2); }
.alt a { font-weight: 550; }
.row { display: flex; gap: 12px; }
.row > .btn { flex: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.actions.center { justify-content: center; }
.fineprint { margin-top: 20px; font-size: 12px; line-height: 18px; color: var(--dim); text-align: center; }
.fineprint a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }

/* ================= alerts, badges ================= */

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid color-mix(in oklab, var(--danger) 30%, transparent);
  background: color-mix(in oklab, var(--danger) 8%, transparent);
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
  animation: fade var(--motion) var(--ease) both;
}
.alert > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--danger); }
.alert.warn { border-color: color-mix(in oklab, var(--warn) 32%, transparent); background: color-mix(in oklab, var(--warn) 8%, transparent); }
.alert.warn > svg { color: var(--warn); }
.alert.info { border-color: var(--accent-line); background: var(--accent-soft); }
.alert.info > svg { color: var(--accent); }
.alert .btn { margin: -6px -6px -6px auto; }
@keyframes fade { from { opacity: 0; transform: translateY(-2px); } }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.badge svg { width: 12px; height: 12px; }
.badge.ok { color: var(--ok); background: color-mix(in oklab, var(--ok) 12%, transparent); border-color: transparent; }
.badge.warn { color: var(--warn); background: color-mix(in oklab, var(--warn) 12%, transparent); border-color: transparent; }
.badge.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

/* ================= status screens ================= */

.status { text-align: center; }
.status .lead { max-width: 360px; margin-left: auto; margin-right: auto; }
.status-icon {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  box-shadow: 0 0 0 8px color-mix(in oklab, var(--accent) 5%, transparent), 0 12px 32px -12px color-mix(in oklab, var(--accent) 50%, transparent);
  animation: pop 460ms var(--ease) both;
}
.status-icon svg { width: 28px; height: 28px; }
.status-icon.ok { color: var(--ok); background: color-mix(in oklab, var(--ok) 12%, transparent); border-color: color-mix(in oklab, var(--ok) 35%, transparent); box-shadow: 0 0 0 8px color-mix(in oklab, var(--ok) 5%, transparent); }
.status-icon.warn { color: var(--warn); background: color-mix(in oklab, var(--warn) 12%, transparent); border-color: color-mix(in oklab, var(--warn) 35%, transparent); box-shadow: 0 0 0 8px color-mix(in oklab, var(--warn) 5%, transparent); }
.status-icon.danger { color: var(--danger); background: color-mix(in oklab, var(--danger) 12%, transparent); border-color: color-mix(in oklab, var(--danger) 35%, transparent); box-shadow: 0 0 0 8px color-mix(in oklab, var(--danger) 5%, transparent); }
@keyframes pop { 0% { transform: scale(0.7); opacity: 0; } 60% { transform: scale(1.05); opacity: 1; } 100% { transform: none; } }

/* device authorization */
.device-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}
.device-chip svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.device-chip b { color: var(--text); font: 600 13px var(--mono); letter-spacing: 0.08em; }
.phrase {
  margin-top: 28px;
  padding: 24px 20px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(120% 100% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--bg-elev);
  text-align: center;
}
.phrase .code { display: flex; justify-content: center; gap: 6px; }
.phrase .code span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 46px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font: 700 22px/1 var(--mono);
  color: var(--text);
}
.phrase .code span.sep { width: 14px; background: none; border: 0; color: var(--dim); }
.phrase .caption { margin-top: 16px; }
.who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
}
.who .name { font-weight: 600; font-size: 14px; }
.who .caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font: 700 15px var(--mono);
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-strong), var(--accent) 45%, #5865f2 140%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset;
}
.avatar.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 26px; }
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.provider-glyph {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.provider-glyph svg { width: 18px; height: 18px; }

/* ================= account ================= */

.account {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: start;
}
.account-nav { position: sticky; top: 104px; display: grid; gap: 2px; }
.account-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
.account-nav a svg { width: 16px; height: 16px; color: var(--dim); }
.account-nav a:hover { background: var(--surface-2); color: var(--text); }
.account-nav a[aria-current='true'] { background: var(--surface-2); color: var(--text); }
.account-nav a[aria-current='true'] svg { color: var(--accent); }
.account-main { min-width: 0; display: grid; gap: 24px; }
/* Cor do personagem escolhido (vem do servidor em avatar.accent). Registrada
   como <color> para a troca animar em vez de saltar. */
@property --avatar-accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #7dcfff;
}
.profile {
  --avatar-accent: var(--accent);
  --avatar-soft: color-mix(in oklab, var(--avatar-accent) 16%, transparent);
  transition: --avatar-accent var(--motion) var(--ease), border-color var(--motion) var(--ease);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(80% 140% at 0% 0%, var(--avatar-soft), transparent 60%),
    var(--surface);
  border-color: color-mix(in oklab, var(--avatar-accent) 14%, var(--border));
}
.profile h1 { font-size: 24px; line-height: 32px; }
.profile .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  scroll-margin-top: 96px;
}
.card-head { padding: 20px 24px 4px; }
.card-head h2 { font-size: 16px; line-height: 24px; font-weight: 650; letter-spacing: -0.01em; }
.card-head p { margin-top: 2px; font-size: 14px; color: var(--text-2); }
.card-body { padding: 12px 8px 8px; }
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 16px;
  transition: opacity var(--motion) var(--ease), transform var(--motion) var(--ease);
}
.card-body .item ~ .item { border-top: 1px solid var(--border); }
.item .title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item .caption { overflow: hidden; text-overflow: ellipsis; }
.item.removing { opacity: 0; transform: translateX(8px); }
.expand { padding: 4px 16px 20px 66px; animation: fade var(--motion) var(--ease) both; }
.expand form { margin-top: 0; max-width: 420px; }
.expand .actions { margin-top: 20px; }
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 24px 24px 32px;
  text-align: center;
}
.empty .empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--dim);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  margin-bottom: 4px;
}
.empty .empty-icon svg { width: 22px; height: 22px; }
.empty .title { font-weight: 600; font-size: 14px; }
.empty .caption { max-width: 340px; }

@media (max-width: 860px) {
  .account { grid-template-columns: 1fr; gap: 20px; }
  .account-nav { position: static; display: flex; overflow-x: auto; gap: 4px; margin: 0 -4px; padding: 0 4px; scrollbar-width: none; }
  .account-nav a { flex: none; }
  .expand { padding-left: 16px; }
  body.layout-app .stage { padding: 24px 16px 64px; }
}
@media (max-width: 520px) {
  .profile { flex-direction: column; align-items: flex-start; }
  .item { flex-wrap: wrap; }
  .item > .btn, .item > a.btn { margin-left: 50px; }
  h1 { font-size: 24px; line-height: 32px; }
  .user-trigger .nick { display: none; }
}

/* ================= menu (account dropdown) ================= */

.menu-wrap { position: relative; }
.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px 0 6px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: 550 14px var(--sans);
  cursor: pointer;
  transition: background var(--motion) var(--ease), border-color var(--motion) var(--ease);
}
.user-trigger:hover, .user-trigger[aria-expanded='true'] { background: var(--surface-2); border-color: var(--border); }
.user-trigger > svg { width: 14px; height: 14px; color: var(--dim); }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 20;
  animation: menu-in 160ms var(--ease) both;
}
.menu .menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu .menu-head .name { font-weight: 600; color: var(--text); font-size: 14px; }
.menu .menu-head .caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu [role='menuitem'] {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font: 500 14px var(--sans);
  text-align: left;
  cursor: pointer;
}
.menu [role='menuitem'] svg { width: 16px; height: 16px; color: var(--dim); }
.menu [role='menuitem']:hover, .menu [role='menuitem']:focus-visible { background: var(--surface-2); color: var(--text); box-shadow: none; }
.menu .danger, .menu .danger:hover { color: var(--danger); }
.menu .danger svg { color: var(--danger); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }

/* ================= skeleton, toasts ================= */

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.sk-title { height: 32px; width: 60%; }
.sk-line { height: 16px; width: 85%; margin-top: 12px; }
.sk-input { height: 46px; margin-top: 28px; }
.sk-input + .sk-input { margin-top: 20px; }
.sk-button { height: 48px; margin-top: 28px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 40;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: toast-in 240ms var(--ease) both;
}
.toast svg { width: 18px; height: 18px; flex: none; color: var(--ok); }
.toast.bad svg { color: var(--danger); }
.toast.out { animation: toast-out 180ms var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

.noscript { padding: 32px; text-align: center; color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .spinner { animation: spin 1s linear infinite !important; }
  .aurora span, .character { animation: none !important; }
}

.back { margin-left: -12px; }
@media (max-width: 520px) { .hide-sm { display: none; } }
@media (max-width: 340px) { .oauth { grid-template-columns: 1fr; } }

/* ================= static pages (landing, legal) ================= */

.site { min-height: 100dvh; display: flex; flex-direction: column; }
.site .topbar { border-bottom: 1px solid var(--border); }
.site nav.top-actions a:not(.btn) { color: var(--text-2); font-weight: 500; }
.site nav.top-actions a:not(.btn):hover { color: var(--text); }
.hero {
  position: relative;
  isolation: isolate;
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 72px 32px 96px;
}
/* Full-bleed background: fixed to the viewport so it never shows the
   edges of the content column. */
.hero .aurora { position: fixed; inset: -20%; opacity: 0.5; }
.hero .grid-bg { position: fixed; opacity: 0.55; }
body.site { overflow-x: hidden; }
.hero-copy .eyebrow { margin-bottom: 20px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--accent-line); background: var(--accent-soft); text-transform: none; letter-spacing: 0; font-size: 13px; }
.hero h1 {
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 700;
  text-wrap: balance;
}
/* Uma frase por linha, quebra por CSS (não <br>): leitores de tela leem as
   três frases em sequência, com os pontos como pausa. */
.hero h1 .h1-line { display: block; }
.hero h1 .glow { color: var(--accent); text-shadow: 0 0 40px color-mix(in oklab, var(--accent) 45%, transparent); }
.hero p.lead { margin-top: 20px; font-size: 18px; line-height: 1.6; max-width: 520px; }
.hero .actions { margin-top: 36px; }
.hero .character { width: min(440px, 100%); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 48px 20px 64px; text-align: left; }
  .hero .character { width: 220px; order: -1; }
}

.doc { max-width: 720px; width: 100%; margin: 0 auto; padding: 56px 24px 96px; flex: 1; }
.doc h1 { font-size: 36px; line-height: 44px; }
.doc .updated { margin-top: 8px; color: var(--dim); font-size: 14px; }
.doc h2 { margin-top: 40px; font-size: 18px; line-height: 28px; font-weight: 650; letter-spacing: -0.01em; }
.doc p, .doc li { margin-top: 12px; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.doc ul { padding-left: 20px; }
.doc li { margin-top: 6px; }
.doc strong { color: var(--text); font-weight: 600; }
.doc code { font-family: var(--mono); font-size: 13px; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text); }

/* ================= avatars ================= */

.avatar { position: relative; overflow: hidden; isolation: isolate; }
.avatar img,
.avatar .avatar-ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}
.avatar .avatar-ghost { z-index: 2; opacity: 1; transition: opacity 280ms var(--ease); }
.avatar .avatar-ghost.out { opacity: 0; }
.avatar.has-img { background: var(--surface-2); box-shadow: 0 0 0 1px var(--border-strong); }
.avatar.has-img .avatar-letter { visibility: hidden; }
.avatar.md { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; }
.avatar.xl { width: 88px; height: 88px; border-radius: 24px; font-size: 34px; }
.avatar.xl.has-img { box-shadow: 0 0 0 1px var(--border-strong), 0 0 0 5px color-mix(in oklab, var(--accent) 14%, transparent), 0 16px 40px -18px color-mix(in oklab, var(--accent) 60%, transparent); }
.profile .avatar.xl.has-img {
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--avatar-accent) 55%, var(--border-strong)),
    0 0 0 5px color-mix(in oklab, var(--avatar-accent) 16%, transparent),
    0 16px 44px -16px color-mix(in oklab, var(--avatar-accent) 70%, transparent);
}

.menu .menu-head { display: flex; align-items: center; gap: 12px; }
.menu .menu-head .grow { min-width: 0; flex: 1; }

/* Profile header: the avatar is the entry point to the picker. */
.avatar-edit {
  position: relative;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 24px;
  cursor: pointer;
  transition: transform var(--motion) var(--ease);
}
.avatar-edit:hover { transform: scale(1.03); }
.avatar-edit:active { transform: scale(0.98); }
.avatar-edit:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--avatar-accent, var(--accent)); }
.avatar-edit-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: #fff;
  background: rgba(3, 6, 10, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--motion) var(--ease);
}
.avatar-edit-overlay svg { width: 26px; height: 26px; transform: scale(0.85); transition: transform var(--motion) var(--ease); }
.avatar-edit:hover .avatar-edit-overlay,
.avatar-edit:focus-visible .avatar-edit-overlay { opacity: 1; }
.avatar-edit:hover .avatar-edit-overlay svg,
.avatar-edit:focus-visible .avatar-edit-overlay svg { transform: none; }
.avatar-edit.loading-soft { opacity: 0.7; pointer-events: none; }
.avatar-edit-overlay .spinner { display: none; }
.avatar-edit.loading-soft .avatar-edit-overlay { opacity: 1; }
.avatar-edit.loading-soft .avatar-edit-overlay svg { display: none; }
.avatar-edit.loading-soft .avatar-edit-overlay .spinner { display: block; }

/* ================= modal ================= */

html.modal-open { overflow: hidden; }
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 8, 0.62);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}
:root[data-theme='light'] .modal-backdrop { background: rgba(15, 23, 42, 0.32); }
.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(120% 60% at 50% -10%, color-mix(in oklab, var(--pick, var(--accent)) 10%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(12px) scale(0.975);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.modal-root.open .modal-backdrop { opacity: 1; }
.modal-root.open .modal { opacity: 1; transform: none; }
.modal-root.closing .modal { transition-duration: 160ms; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
}
.modal-head h2 { font-size: 18px; line-height: 24px; font-weight: 650; letter-spacing: -0.01em; }
.modal-head p { margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.icon-btn {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--motion) var(--ease), color var(--motion) var(--ease), transform 90ms var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.icon-btn svg { width: 18px; height: 18px; }
.modal-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 20px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
}
.modal-foot-actions { display: flex; gap: 8px; }

/* ---- picker ---- */
.modal-root { --pick: var(--accent); }
.pp-hero { display: flex; align-items: center; gap: 20px; padding: 24px 24px 20px; }
.pp-preview {
  position: relative;
  flex: none;
  width: 112px;
  height: 112px;
  border-radius: 28px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow:
    0 0 0 1px var(--border-strong),
    0 0 0 6px color-mix(in oklab, var(--pick) 16%, transparent),
    0 20px 44px -18px color-mix(in oklab, var(--pick) 70%, transparent);
  transition: box-shadow 260ms var(--ease);
}
.pp-preview-img,
.pp-preview-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pp-preview-img.fade-in { animation: pp-fade var(--motion) var(--ease) both; }
.pp-preview-loading {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 8px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transition: opacity var(--motion) var(--ease);
}
.pp-preview[aria-busy='true'] .pp-preview-loading { opacity: 1; }
.pp-preview-loading .spinner { display: block; }
@keyframes pp-fade { from { opacity: 0.2; transform: scale(1.04); } }
.pp-preview-provider { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text); }
.pp-preview-provider svg { width: 44px; height: 44px; }
.pp-preview [hidden] { display: none; }
.pp-hero-meta .name { font-size: 16px; font-weight: 650; }
.pp-hero-meta .caption { margin-top: 2px; }

.segmented {
  position: relative;
  display: flex;
  gap: 0;
  margin: 0 24px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.segmented [role='tab'] {
  position: relative;
  z-index: 1;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font: 550 13px var(--sans);
  cursor: pointer;
  transition: color var(--motion) var(--ease);
}
.segmented [role='tab'] svg { width: 16px; height: 16px; }
.segmented [role='tab']:hover { color: var(--text); }
.segmented [role='tab'][aria-selected='true'] { color: var(--text); }
.segmented [role='tab']:focus-visible { outline: none; box-shadow: var(--ring); }
.segmented-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease), width 220ms var(--ease);
}
.pp-panels { padding: 20px 24px 4px; }
.pp-panel[hidden] { display: none; }
.pp-panel { animation: pp-panel-in 200ms var(--ease) both; }
@keyframes pp-panel-in { from { opacity: 0; transform: translateY(4px); } }

/* carousel */
.carousel { display: flex; align-items: center; gap: 8px; }
.car-viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}
.car-track {
  --gap: 12px;
  --per: 3.6;
  display: flex;
  gap: var(--gap);
  padding: 10px 20px 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 20px;
  scrollbar-width: none;
  cursor: grab;
}
.car-track::-webkit-scrollbar { display: none; }
.car-track.dragging { cursor: grabbing; scroll-snap-type: none; }
.car-track.dragging .car-item { pointer-events: none; }
.car-item {
  position: relative;
  flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  scroll-snap-align: center;
  background: var(--surface-2);
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--border);
  transform: scale(0.94);
  opacity: 0.78;
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), opacity 220ms var(--ease);
}
.car-item img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; transition: opacity 200ms var(--ease); }
.car-item.loading img { opacity: 0; }
.car-item.loading {
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.car-item:hover { opacity: 1; transform: scale(0.97); }
.car-item:focus-visible { outline: none; opacity: 1; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text-2); }
.car-item[aria-checked='true'] {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--pick), 0 14px 30px -14px color-mix(in oklab, var(--pick) 80%, transparent);
}
.car-check {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06121a;
  background: var(--pick);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 180ms var(--ease), transform 220ms var(--ease);
}
.car-check svg { width: 13px; height: 13px; stroke-width: 3; }
.car-item[aria-checked='true'] .car-check { opacity: 1; transform: none; }
.car-nav {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: opacity var(--motion) var(--ease), background var(--motion) var(--ease), transform 90ms var(--ease);
}
.car-nav svg { width: 18px; height: 18px; }
.car-nav:hover:not(:disabled) { background: var(--surface-2); }
.car-nav:active:not(:disabled) { transform: scale(0.94); }
.car-nav:disabled { opacity: 0.3; cursor: default; }
.car-nav:focus-visible { outline: none; box-shadow: var(--ring); }
.car-meta { display: flex; align-items: center; gap: 12px; margin: 4px 44px 0; }
.car-progress { position: relative; flex: 1; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.car-progress span { position: absolute; left: 0; top: 0; bottom: 0; width: 20%; border-radius: 3px; background: var(--pick); transition: background 220ms var(--ease); }
.car-count { font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }

/* swatches */
.swatch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.swatch-label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.swatches { display: flex; gap: 8px; }
.swatch {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
  transition: transform 120ms var(--ease);
}
.swatch-dot {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25) inset, 0 4px 10px -4px var(--sw);
  transition: inset 160ms var(--ease);
}
.swatch svg { position: relative; width: 14px; height: 14px; stroke-width: 3; color: #06121a; opacity: 0; transform: scale(0.5); transition: opacity 160ms var(--ease), transform 200ms var(--ease); }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-checked='true'] { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--sw); }
.swatch[aria-checked='true'] svg { opacity: 1; transform: none; }
.swatch:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--text); }

/* upload */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 228px;
  padding: 24px;
  text-align: center;
  border-radius: 16px;
  border: 1.5px dashed var(--border-strong);
  background:
    radial-gradient(60% 80% at 50% 0%, color-mix(in oklab, var(--accent) 7%, transparent), transparent 70%),
    var(--surface-2);
  cursor: pointer;
  transition: border-color var(--motion) var(--ease), background var(--motion) var(--ease), transform var(--motion) var(--ease);
}
.dropzone:hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--border-strong)); }
.dropzone:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.dropzone.over { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 10%, var(--surface-2)); transform: scale(1.01); }
.dropzone[hidden] { display: none; }
.dropzone-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 16px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  transition: transform 220ms var(--ease);
}
.dropzone.over .dropzone-icon { transform: translateY(-4px) scale(1.06); }
.dropzone-icon svg { width: 24px; height: 24px; }
.dropzone-title { font-size: 15px; font-weight: 600; }
.dropzone-lead { font-size: 13px; color: var(--text-2); }
.dropzone .caption { margin-top: 8px; }
.cropper[hidden] { display: none; }
.crop-stage {
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 16px;
  background:
    repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface-3) 0 50%) 0 0 / 16px 16px;
}
.crop-viewport {
  position: relative;
  width: 240px;
  height: 240px;
  overflow: hidden;
  border-radius: 28px;
  cursor: grab;
  touch-action: none;
  background: #000;
}
.crop-viewport.grabbing { cursor: grabbing; }
.crop-viewport:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent); }
.crop-img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  transform-origin: center;
  user-select: none;
  pointer-events: none;
}
.crop-mask {
  position: absolute;
  inset: 0;
  border-radius: 28px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  background:
    linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12)) 33.33% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12)) 66.66% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12)) 0 33.33% / 100% 1px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12)) 0 66.66% / 100% 1px no-repeat;
  opacity: 0;
  transition: opacity var(--motion) var(--ease);
}
.crop-viewport.grabbing .crop-mask,
.crop-viewport:hover .crop-mask { opacity: 1; }
.crop-controls { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.crop-zoom {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: var(--surface-3);
  accent-color: var(--accent);
  cursor: pointer;
}
.crop-zoom::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 120ms var(--ease);
}
.crop-zoom::-webkit-slider-thumb:hover { transform: scale(1.12); }
.crop-zoom::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent); }
.crop-zoom:focus-visible { outline: none; box-shadow: var(--ring); }
.crop-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.crop-actions { display: flex; gap: 8px; }
.pp-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text);
  border: 1px solid color-mix(in oklab, var(--danger) 35%, transparent);
  background: color-mix(in oklab, var(--danger) 10%, transparent);
  animation: fade 180ms var(--ease) both;
}
.pp-error[hidden] { display: none; }
.pp-error svg { width: 16px; height: 16px; flex: none; color: var(--danger); margin-top: 1px; }

/* provider */
.provider-card { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.provider-card-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.provider-card-icon svg { width: 22px; height: 22px; }
.provider-card .title { font-weight: 600; font-size: 15px; }
.provider-card .caption { margin-top: 4px; line-height: 19px; }
.provider-pick.picked { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* phones: bottom sheet */
@media (max-width: 560px) {
  .modal-root { padding: 0; place-items: end stretch; }
  .modal {
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    transform: translateY(100%);
    transition: opacity 240ms var(--ease), transform 280ms var(--ease);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 4px;
    background: var(--border-strong);
  }
  .modal-head { padding: 12px 20px 0; }
  .pp-hero { padding: 20px 20px 16px; gap: 16px; }
  .pp-preview { width: 88px; height: 88px; border-radius: 22px; }
  .segmented { margin: 0 20px; }
  .segmented [role='tab'] span { font-size: 13px; }
  .pp-panels { padding: 16px 20px 4px; }
  .car-track { --per: 3; }
  .car-nav { display: none; }
  .car-meta { margin: 4px 20px 0; }
  .swatch-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .swatch { width: 40px; height: 40px; }
  .crop-viewport { width: min(240px, 64vw); height: min(240px, 64vw); }
  .modal-foot { padding: 12px 20px 16px; }
  .modal-foot .btn { height: 44px; }
  .avatar.xl { width: 72px; height: 72px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .modal, .modal-backdrop, .segmented-thumb, .car-item, .pp-panel { transition: none !important; animation: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .profile { transition: none; }
}

/* Cor "None": amostra riscada (convenção de "sem cor") e perfil sem brilho
   colorido — só borda e anel neutros. */
.swatch-none .swatch-dot {
  background:
    linear-gradient(135deg, transparent calc(50% - 1.5px), var(--danger) calc(50% - 1.5px), var(--danger) calc(50% + 1.5px), transparent calc(50% + 1.5px)),
    var(--surface-3);
  box-shadow: 0 0 0 1px var(--border-strong) inset;
}
.swatch-none svg { color: var(--text); }
.swatch-none[aria-checked='true'] { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--dim); }
.profile.no-accent {
  background: var(--surface);
  border-color: var(--border);
}
.profile.no-accent .avatar.xl.has-img {
  box-shadow: 0 0 0 1px var(--border-strong), 0 16px 40px -20px rgba(0, 0, 0, 0.6);
}
.profile.no-accent .avatar-edit:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text-2); }

/* Computadores: hardware numa linha, depois último uso e login com local. */
.item.device { align-items: flex-start; }
.item.device .provider-glyph { margin-top: 2px; }
.item.device .btn { margin-top: 2px; }
.device-spec { margin-top: 2px; color: var(--text-2); }
.device-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 6px;
  font-size: 13px;
  line-height: 18px;
  color: var(--dim);
}
.device-meta svg { width: 14px; height: 14px; flex: none; opacity: 0.8; }
.device-meta .ip {
  font-family: var(--mono);
  font-size: 12px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

/* Camadas decorativas (grade, aurora) nunca recebem clique, e o topo fica
   acima delas: a .grid-bg fixa cobria o header e engolia os botões. */
.aurora, .grid-bg, .backdrop { pointer-events: none; }
.topbar { position: relative; z-index: 20; }

/* ================= home: personagem cercado por 3 monitores =================
   Palco com perspectiva; os monitores ficam em volta do personagem, com a
   tela voltada para ele (esquerda/direita giram para o centro, o de cima
   inclina para baixo). Cada um flutua em fase própria. */
.stage3d {
  --stage: 560px;
  position: relative;
  justify-self: center;
  width: var(--stage);
  height: calc(var(--stage) * 0.92);
}
/* Sem contexto 3D compartilhado (preserve-3d): no WebKit (Safari e o app) o
   texto que muda dentro de camadas 3D aninhadas não era redesenhado e os
   terminais pareciam vazios. Cada monitor tem a própria perspectiva. */
.rig {
  position: absolute;
  inset: 0;
}
.hero .stage3d .character {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 55%;
  translate: -50% -50%;
  z-index: 2;
}
.floor-glow {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 60%;
  height: 12%;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(46, 230, 242, 0.28), transparent);
  filter: blur(8px);
  pointer-events: none;
}

.monitor {
  --glow: #2ee6f2;
  position: absolute;
  width: 36%;
  aspect-ratio: 16 / 10.5;
  animation: monitor-float 8s ease-in-out infinite;
}
.monitor[data-agent='codex'] { --glow: #9ece6a; }
.monitor[data-agent='claude'] { --glow: #ff9e64; }
.monitor[data-agent='kimi'] { --glow: #bb9af7; }
.m-left  { left: 7%;  top: 38%; transform: perspective(900px) rotateY(38deg); transform-origin: 0% 50%; animation-delay: -1.5s; }
.m-right { right: 7%; top: 38%; transform: perspective(900px) rotateY(-38deg); transform-origin: 100% 50%; animation-delay: -4s; }
.m-top   { left: 34%; top: 12%; transform: perspective(900px) rotateX(-24deg) scale(0.9); transform-origin: 50% 0%; animation-delay: -6s; z-index: 1; }

/* Monocromáticos por padrão; só o monitor sob o mouse ganha a cor do agente. */
.monitor {
  filter: grayscale(1) brightness(0.82);
  transition: filter 280ms var(--ease), scale 280ms var(--ease);
  cursor: default;
}
/* Sem z-index no hover: o monitor continua por trás do personagem. */
.monitor:hover,
.monitor.lit {
  filter: none;
  scale: 1.04;
}
.monitor.lit .m-bezel,
.monitor:hover .m-bezel {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 34px 0 color-mix(in oklab, var(--glow) 65%, transparent),
    0 22px 50px -18px rgba(0, 0, 0, 0.9);
}
.m-bezel { transition: box-shadow 280ms var(--ease); }
@keyframes monitor-float {
  50% { translate: 0 -8px; }
}

.m-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  translate: -50% 0;
  padding: 2px 10px;
  border-radius: 6px;
  font: 600 13px/20px var(--mono);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--glow);
  background: color-mix(in oklab, var(--glow) 10%, #05070b);
  border: 1px solid color-mix(in oklab, var(--glow) 55%, transparent);
  text-shadow: 0 0 10px color-mix(in oklab, var(--glow) 80%, transparent);
  box-shadow: 0 0 18px -4px color-mix(in oklab, var(--glow) 70%, transparent);
  white-space: nowrap;
}
.m-bezel {
  position: absolute;
  inset: 0;
  padding: 7px;
  border-radius: 12px;
  background: linear-gradient(160deg, #1a2030, #0a0d14 55%, #141a26);
  border: 1px solid color-mix(in oklab, var(--glow) 45%, #1d2433);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 22px -2px color-mix(in oklab, var(--glow) 55%, transparent),
    0 22px 50px -18px rgba(0, 0, 0, 0.9);
}
.m-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  /* Camada própria: o WebKit redesenha o texto que muda a cada tecla. */
  transform: translateZ(0);
  border-radius: 7px;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in oklab, var(--glow) 9%, #03060a), #020306 70%);
  box-shadow: 0 0 24px color-mix(in oklab, var(--glow) 18%, transparent) inset;
}
/* Linhas de varredura e reflexo do vidro. */
.m-screen::before,
.m-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.m-screen::before {
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}
.m-screen::after {
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.07), transparent 38%);
}
.m-term {
  margin: 0;
  padding: 8px 10px;
  font: 500 10px/1.55 var(--mono);
  color: #c9d3e6;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: 0 0 6px color-mix(in oklab, var(--glow) 35%, transparent);
}
.m-term .pr { color: var(--glow); }
.m-term .dim { color: #6b7690; }
.m-term .ok { color: #9ece6a; }
.m-term .hl { color: #e6edf7; }
.m-term .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  vertical-align: -0.15em;
  background: var(--glow);
  box-shadow: 0 0 8px var(--glow);
  animation: cursor-blink 1s steps(1) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }

@media (max-width: 1080px) {
  .stage3d { --stage: 460px; }
}
@media (max-width: 860px) {
  /* Largura do conteúdo da hero (container query), não 100vw: imune a
     barras de rolagem e ao padding. */
  .hero { container-type: inline-size; }
  .stage3d { --stage: min(420px, 100cqi); order: -1; margin-bottom: 8px; }
  .m-label { font-size: 11px; }
  .m-term { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .monitor, .m-term .cursor { animation: none !important; }
}

/* Personagem animado: clipes sobrepostos, um visível por vez (home.js). */
.hero .stage3d .character { animation: float 7s ease-in-out infinite; }
.clips { aspect-ratio: 1; }
.clip {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms var(--ease);
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45));
}
.clip.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .clip { transition: none; } }
.monitor[data-agent='devin'] { --glow: #7aa2f7; }
.monitor[data-agent='opencode'] { --glow: #e0af68; }

/* ================= home: downloads (abaixo da descrição) ================= */
.downloads { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 36px; }
.os-ico { width: 18px; height: 18px; flex: none; }
.dl-primary { gap: 10px; }
.dl-primary .os-ico { margin-top: -2px; }
.dl-others { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-size: 14px; }
.dl-also { color: var(--dim); }
.dl-alt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  border-radius: 6px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--motion) var(--ease);
}
.dl-alt .os-ico { width: 15px; height: 15px; opacity: 0.85; }
.dl-alt:hover { color: var(--text); text-decoration: none; }
.dl-alt:hover span { text-decoration: underline; text-underline-offset: 3px; }
.dl-alt:focus-visible { outline: none; box-shadow: var(--ring); }
.dl-alt[hidden] { display: none; }

/* ================= home: "Works with" — logo grande, nome embaixo ================= */
.works-with { margin-top: 44px; width: 100%; }
.ww-label {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.works-with ul {
  /* Ocupa toda a largura da coluna de texto: espaço distribuído entre os
     logos; a margem negativa alinha o conteúdo das pontas com o texto
     (o fundo do hover transborda os 6px de respiro). */
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-inline: -6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.works-with li {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 56px;
  padding: 12px 6px 10px;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  text-align: center;
  color: var(--text-2);
  transition: color var(--motion) var(--ease), background var(--motion) var(--ease);
}
.ww-logo {
  width: 30px;
  height: 30px;
  opacity: 0.72;
  transition: opacity var(--motion) var(--ease), transform var(--motion) var(--ease);
}
.works-with li:hover { color: var(--text); background: color-mix(in oklab, var(--text) 4%, transparent); }
.works-with li:hover .ww-logo { opacity: 1; transform: translateY(-2px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.tg-ico { width: 16px; height: 16px; flex: none; }

/* Aviso "em breve" quando o download ainda não está publicado. */
.soon-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  translate: -50% 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  color: var(--text);
  animation: soon-in 260ms var(--ease) both;
}
@keyframes soon-in { from { opacity: 0; translate: -50% 8px; } }


/* O personagem é só imagem: não pode "roubar" o mouse dos monitores que ele
   sobrepõe (a área do vídeo é maior que a figura). */
.hero .stage3d .character { pointer-events: none; }

/* ================= login/cadastro: grid dos CLIs integrados =================
   Oito blocos (os sete integrados + "Any CLI"). Um por vez fica "rodando"
   (brilho + ponto de status), ecoando o status ao vivo do app. */
.cli-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 560px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cli-tile {
  --tile-glow: #2ee6f2;
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  aspect-ratio: 1 / 1.04;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  transition: transform 260ms var(--ease), border-color 360ms var(--ease), box-shadow 360ms var(--ease), background 360ms var(--ease);
}
.cli-logo {
  width: 42%;
  max-width: 46px;
  height: auto;
  aspect-ratio: 1;
  color: #e6ecf5;
  opacity: 0.7;
  transition: opacity 360ms var(--ease), filter 360ms var(--ease);
}
.cli-name {
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  color: #8f9bb0;
  transition: color 360ms var(--ease);
}
.cli-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tile-glow);
  box-shadow: 0 0 10px var(--tile-glow);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}
.cli-tile:hover,
.cli-tile.is-running {
  border-color: color-mix(in oklab, var(--tile-glow) 42%, transparent);
  background: linear-gradient(160deg, color-mix(in oklab, var(--tile-glow) 10%, transparent), rgba(255, 255, 255, 0.02));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 0 32px -6px color-mix(in oklab, var(--tile-glow) 45%, transparent),
    0 18px 40px -24px rgba(0, 0, 0, 0.8);
}
.cli-tile:hover { transform: translateY(-3px); }
.cli-tile:hover .cli-logo,
.cli-tile.is-running .cli-logo { opacity: 1; filter: drop-shadow(0 0 10px color-mix(in oklab, var(--tile-glow) 50%, transparent)); }
.cli-tile:hover .cli-name,
.cli-tile.is-running .cli-name { color: #eef2f7; }
.cli-tile.is-running .cli-dot { opacity: 1; transform: none; animation: cli-pulse 1.4s ease-in-out infinite; }
@keyframes cli-pulse { 50% { box-shadow: 0 0 2px var(--tile-glow); opacity: 0.55; } }
@media (max-width: 1180px) {
  .cli-grid { gap: 10px; }
  .cli-name { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .cli-tile, .cli-logo, .cli-name, .cli-dot { transition: none; }
  .cli-tile.is-running .cli-dot { animation: none; }
}

/* Tema claro: a grade de fundo precisa de linhas escuras para aparecer. */
:root[data-theme='light'] .hero .grid-bg {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
}
:root[data-theme='light'] .hero .aurora { opacity: 0.35; }

/* ================= navbar: alternar tema (sol/lua) ================= */
.topbar-end { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  color: var(--text-2);
  cursor: pointer;
  transition: color var(--motion) var(--ease), border-color var(--motion) var(--ease), background var(--motion) var(--ease), transform 120ms var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.theme-toggle svg {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: opacity 260ms var(--ease), transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* No escuro mostra o sol (ação: ir para o claro); no claro, a lua. */
.theme-toggle .i-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
:root[data-theme='light'] .theme-toggle .i-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
:root[data-theme='light'] .theme-toggle .i-moon { opacity: 1; transform: none; }

/* Troca de tema com View Transitions: o novo tema se revela num círculo
   que nasce do botão (animação feita no theme.js). */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle svg { transition: none; }
}

/* Título, grid e referência a "qualquer CLI" centralizados no painel. */
.brand-stage {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 36px;
  padding-bottom: 40px;
}
.cli-more {
  margin: -12px 0 0;
  font-size: 13.5px;
  color: #7f8aa0;
  text-align: center;
}
/* Home: referência a qualquer CLI abaixo dos logos. */
.ww-more { margin-top: 12px; font-size: 13px; color: var(--dim); }

/* Celular: palco colado à navbar e à headline (sem os vazios do layout de
   duas colunas). A sobra do palco abaixo do personagem é recolhida. */
@media (max-width: 860px) {
  .hero { padding-top: 20px; gap: 16px; }
  .stage3d { margin-bottom: -48px; }
  .site nav.top-actions a { white-space: nowrap; }
}

/* ================= home (celular): logos em carrossel contínuo =================
   Desktop: .ww-viewport é transparente ao layout e as cópias ficam ocultas. */
.works-with li.ww-clone { display: none; }
/* Itens de grid não encolhem abaixo do conteúdo por padrão: sem min-width 0,
   a faixa (max-content) alargava a coluna e a página inteira no celular. */
.hero-copy, .works-with { min-width: 0; }
@media (max-width: 860px) {
  .ww-viewport {
    overflow: hidden;
    margin-inline: -20px;              /* sangra até a borda da tela */
    padding-inline: 20px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  }
  .works-with .ww-track {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0;
    width: max-content;
    margin-inline: 0;
    animation: ww-marquee 26s linear infinite;
  }
  /* Espaço como margem (não gap): metade da faixa = exatamente uma lista. */
  .works-with .ww-track li { margin-right: 18px; }
  .works-with li.ww-clone { display: grid; }
  .ww-viewport:hover .ww-track,
  .ww-viewport:active .ww-track,
  .ww-viewport:focus-within .ww-track { animation-play-state: paused; }
  @keyframes ww-marquee { to { transform: translateX(-50%); } }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  .ww-viewport { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ww-viewport::-webkit-scrollbar { display: none; }
  .works-with .ww-track { animation: none; }
  .works-with .ww-track li { scroll-snap-align: start; }
}

.download-requirements { flex-basis: 100%; margin: 0 0 12px; color: var(--dim); font-size: 12px; line-height: 1.6; }
