/* addons.otty.sh. Tokens follow packages/homepage-web/src/style.css; the theme
   follows the system (no toggle, so no script). */

:root {
  color-scheme: light dark;
  --paper: #ffffff;
  --ink: #0a0a0a;
  --muted: rgb(126, 127, 149);
  --chip: rgb(238, 240, 241);
  --chip-hover: rgb(228, 231, 233);
  --card: rgb(246, 247, 248);
  --hairline: rgba(10, 10, 10, 0.1);
  --border: rgba(10, 10, 10, 0.08);
  --label: rgba(10, 10, 10, 0.42);
  --kbd-bg: rgba(10, 10, 10, 0.06);
  --code-bg: rgb(248, 248, 249);
  --accent: #2f7d4f;
  --tk-comment: rgb(140, 142, 160);
  --tk-keyword: #a3367f;
  --tk-string: #2f7d4f;
  --tk-number: #b2550d;
  --tk-constant: #b2550d;
  --tk-global: #2a62c9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d0d0f;
    --ink: #ececef;
    --muted: rgb(150, 152, 172);
    --chip: #1d1d22;
    --chip-hover: #26262b;
    --card: #141417;
    --hairline: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.1);
    --label: rgba(255, 255, 255, 0.45);
    --kbd-bg: rgba(255, 255, 255, 0.08);
    --code-bg: #121215;
    --accent: #6fd39a;
    --tk-comment: rgb(120, 122, 140);
    --tk-keyword: #e78bd0;
    --tk-string: #8fd4a4;
    --tk-number: #f2b277;
    --tk-constant: #f2b277;
    --tk-global: #86b2ff;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

code,
pre {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, 'Cascadia Mono', monospace;
}

p code,
li code,
td code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--kbd-bg);
  font-size: 0.82em;
}

b {
  font-weight: 500;
}

.muted {
  color: var(--muted);
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

.ico {
  width: 16px;
  height: 16px;
  flex: none;
}

.ico-sm {
  width: 13px;
  height: 13px;
}

/* ---------- Header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

.top-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
}

.brand img {
  width: 26px;
  height: auto;
  user-select: none;
}

.brand-sub {
  color: var(--muted);
  font-weight: 400;
}

.top-nav {
  display: flex;
  gap: 4px;
}

.top-nav a {
  padding: 6px 10px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted);
  transition:
    color 0.12s ease,
    background-color 0.12s ease;
}

.top-nav a:hover {
  color: var(--ink);
  background: var(--chip);
}

/* ---------- Hero ---------- */
.hero {
  max-width: 640px;
  padding: 72px 0 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  background: var(--chip);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.h1 {
  margin-top: 18px;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.lead {
  margin-top: 14px;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    opacity 0.12s ease,
    background-color 0.12s ease;
}

.btn-ink {
  background: var(--ink);
  color: var(--paper);
}

.btn-ink:hover {
  opacity: 0.88;
}

.btn-chip {
  background: var(--chip);
}

.btn-chip:hover {
  background: var(--chip-hover);
}

.btn-sub {
  opacity: 0.6;
}

/* ---------- Features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.feature {
  padding: 20px 20px 22px;
  border-radius: 14px;
  background: var(--card);
}

.feature-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--border);
}

.feature-t {
  margin-top: 16px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.feature-d {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Section rule ---------- */
.rule {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 80px 0 32px;
}

.rule span {
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.rule h2 {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--label);
}

/* ---------- Addon cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--paper);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.card:hover {
  border-color: var(--hairline);
  box-shadow: 0 14px 32px -18px rgba(10, 10, 10, 0.35);
  transform: translateY(-1px);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-t {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.card-d {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .chips {
  margin-top: 14px;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--label);
}

.card-id {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--chip);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

.badge {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

/* ---------- Enable + docs ---------- */
.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  margin-top: 64px;
}

.panel {
  padding: 28px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.panel .muted {
  margin-top: 6px;
  font-size: 14px;
}

.h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.steps {
  counter-reset: step;
  margin-top: 18px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 36px;
  font-size: 14px;
  line-height: 1.55;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--chip);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
}

.docs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-link {
  flex: 1;
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--card);
  transition: background-color 0.12s ease;
}

.doc-link:hover {
  background: var(--chip);
}

.doc-t {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
}

.doc-link:hover .ico-sm {
  transform: translate(2px, -2px);
}

.doc-t .ico-sm {
  transition: transform 0.15s ease;
}

.doc-d {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.doc-d code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--kbd-bg);
  font-size: 0.85em;
  color: var(--ink);
}

/* ---------- Addon page ---------- */
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 40px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  transition: color 0.12s ease;
}

.back:hover {
  color: var(--ink);
}

.back .ico {
  width: 14px;
  height: 14px;
}

.addon-head {
  padding: 24px 0 48px;
  border-bottom: 1px solid var(--border);
}

.addon-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.addon-title .h1 {
  margin-top: 0;
}

.addon-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 56px;
  padding-top: 8px;
}

.addon-main {
  min-width: 0;
}

.block {
  padding-top: 40px;
}

.block > .muted,
.block > p {
  margin-top: 8px;
  font-size: 14px;
}

.block > .steps {
  margin-top: 16px;
}

.caps {
  margin-top: 16px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.caps li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.caps .chip {
  justify-self: start;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  padding: 10px 14px;
  background: var(--card);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--label);
}

.table td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.set-t {
  display: block;
  font-weight: 500;
}

.table code.set-k {
  display: inline-block;
  margin-top: 4px;
  padding: 0;
  background: none;
  color: var(--label);
}

.table td:nth-child(2),
.table td:nth-child(3) {
  white-space: nowrap;
}

.sounds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin-top: 16px;
  padding: 0;
  list-style: none;
}

.sounds li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 6px 6px 14px;
  border-radius: 12px;
  background: var(--card);
}

.sounds audio {
  height: 32px;
  max-width: 190px;
}

/* ---------- Code ---------- */
.code {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--code-bg);
}

.code-bar {
  display: flex;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
}

.code pre {
  margin: 0;
  padding: 14px 0;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.65;
  tab-size: 4;
  font-variant-ligatures: none;
}

.code code {
  counter-reset: line;
  display: block;
  min-width: max-content;
  padding-right: 16px;
}

.code .line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 3.2em;
  padding-right: 1.2em;
  text-align: right;
  color: var(--label);
  opacity: 0.7;
  user-select: none;
}

.tk-comment {
  color: var(--tk-comment);
  font-style: italic;
}

.tk-keyword {
  color: var(--tk-keyword);
}

.tk-string {
  color: var(--tk-string);
}

.tk-number {
  color: var(--tk-number);
}

.tk-constant {
  color: var(--tk-constant);
}

.tk-global {
  color: var(--tk-global);
}

/* ---------- Facts sidebar ---------- */
.facts {
  align-self: start;
  position: sticky;
  top: 84px;
  margin-top: 40px;
  padding: 20px;
  border-radius: 14px;
  background: var(--card);
  font-size: 13px;
}

.facts dl > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.facts dl > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.facts dt,
.facts-h {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--label);
  padding-top: 1px;
}

.facts code {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.facts .hash {
  font-size: 11px;
  color: var(--muted);
}

.facts-h {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.files {
  margin-top: 8px;
  padding: 0;
  list-style: none;
}

.files li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
}

.files span {
  flex: none;
  color: var(--label);
  font-size: 12px;
}

/* ---------- 404 ---------- */
.not-found {
  padding: 120px 0 160px;
}

/* ---------- Footer ---------- */
.foot {
  margin-top: 96px;
  border-top: 1px solid var(--border);
}

.foot-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 28px;
  padding-bottom: 40px;
  font-size: 13px;
  color: var(--muted);
}

.foot-links {
  display: flex;
  gap: 18px;
}

.foot-links a:hover {
  color: var(--ink);
}

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split,
  .addon-body {
    grid-template-columns: 1fr;
  }

  .addon-body {
    gap: 0;
  }

  .facts {
    position: static;
  }
}

@media (max-width: 600px) {
  .wrap {
    padding: 0 16px;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .h1 {
    font-size: 32px;
  }

  .features,
  .grid,
  .sounds {
    grid-template-columns: 1fr;
  }

  .caps li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .top-nav a:last-child {
    display: none;
  }
}
