/* Tipsy site skin. Tokens mirror cmd/tipsy-gui/theme.go on purpose:
   the site should look like the app in both light and dark. */

:root {
  color-scheme: light dark;
  --brand-gradient: linear-gradient(100deg, #a9d301 0%, #3fc48c 48%, #2d6bff 100%);
  --max: 1080px;
  --sans: "Inter", "Noto Sans", "DejaVu Sans", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 8px;
  --radius-sm: 6px;
}

[data-theme="light"] {
  --bg: #fcfcfd;
  --surface: #ffffff;
  --text: #141820;
  --muted: #68717e;
  --border: #d9dde3;
  --hover: #eef0f4;
  --selected: #e5eeff;
  --link: #2466df;
  --accent: #2d6bff;
  --accent-hover: #215de1;
  --focus: #1b55c6;
  --disabled: #85909e;
  --success-bg: #edf8f1;
  --success: #227d48;
  --warning-bg: #fff4d8;
  --warning: #805c10;
  --code-bg: #141820;
  --code-text: #f3f5f7;
  --code-dim: #a8b1bf;
  --header-bg: rgba(252, 252, 253, 0.9);
  --shadow: 0 1px 2px rgba(20, 24, 32, 0.06), 0 12px 32px rgba(20, 24, 32, 0.1);
}

[data-theme="dark"] {
  --bg: #1c1f24;
  --surface: #23272e;
  --text: #f3f5f7;
  --muted: #a8b1bf;
  --border: #424a56;
  --hover: #2d333d;
  --selected: #203b68;
  --link: #87b5ff;
  --accent: #2d6bff;
  --accent-hover: #5a86ff;
  --focus: #aacbff;
  --disabled: #8390a2;
  --success-bg: #183528;
  --success: #7ade9d;
  --warning-bg: #3d321b;
  --warning: #f0cb78;
  --code-bg: #101216;
  --code-text: #f3f5f7;
  --code-dim: #a8b1bf;
  --header-bg: rgba(28, 31, 36, 0.9);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--selected); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 22px; }

/* Header, modeled on the app top navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.brand em { font-style: normal; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

nav.main-nav { margin-left: 12px; display: flex; align-items: stretch; gap: 2px; }
nav.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 21px 13px 18px;
  border-bottom: 3px solid transparent;
}
nav.main-nav a:hover { background: var(--hover); color: var(--text); }
nav.main-nav a.active { border-bottom-color: var(--accent); color: var(--text); font-weight: 650; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Buttons, same roles as the app: primary, secondary, link */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-link { background: transparent; border-color: transparent; color: var(--link); }
.btn-link:hover { background: var(--selected); }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; }

.theme-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  cursor: pointer;
  white-space: nowrap;
}
.theme-btn:hover { background: var(--hover); }
.menu-btn { display: none; }

@media (max-width: 880px) {
  nav.main-nav { display: none; }
  nav.main-nav.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 6px 14px 12px;
  }
  nav.main-nav.open a { padding: 10px 8px 8px; }
  .menu-btn { display: inline-flex; }
  .header-cta { display: none; }
}

/* Pills, same meaning as the app status chips */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 11px;
  padding: 3px 11px;
  border: 1px solid var(--border);
  background: var(--hover);
  color: var(--muted);
  white-space: nowrap;
}
.pill-ok { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.pill-info { background: var(--selected); border-color: var(--accent); color: var(--link); }
.pill-warn { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }

/* Hero */
.hero { padding: 52px 0 10px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 28px; align-items: start; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

h1.hero-title {
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 12px;
  text-wrap: balance;
}
.lede { font-size: 1.06rem; color: var(--muted); max-width: 34rem; margin: 0 0 20px; }
.lede strong { color: var(--text); }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-note { font-size: 0.86rem; color: var(--muted); margin: 14px 0 0; }
.hero-note code { font-family: var(--mono); font-size: 0.85em; }

/* Install panel */
.install-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.install-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 650;
  font-size: 0.95rem;
}
.codeblock {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.65;
  padding: 16px;
  overflow-x: auto;
  white-space: pre;
}
.codeblock .dim { color: var(--code-dim); }
.install-panel-body { padding: 16px; }
.install-panel-body p { margin: 0 0 12px; color: var(--muted); font-size: 0.93rem; }
.install-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.fineprint { font-size: 0.83rem; color: var(--muted); margin: 12px 0 0; }
.fineprint code { font-family: var(--mono); font-size: 0.86em; }

/* Sections: one header pattern everywhere */
section.block { padding: 34px 0 4px; }
.sec-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--link);
  margin: 0 0 6px;
}
.sec-head h1, .sec-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); letter-spacing: -0.015em; font-weight: 750; margin: 0 0 6px; }
.sec-sub { color: var(--muted); margin: 0 0 18px; max-width: 46rem; }

/* Feature cards: one card style everywhere */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-index { font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.card h3 { margin: 6px 0 6px; font-size: 1.08rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.card p + p { margin-top: 8px; }
.card code { font-family: var(--mono); font-size: 0.85em; }

/* Steps: plain numbered rows with an accent marker for the current path */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  border-left: 3px solid var(--border);
}
.steps li strong { display: block; margin-bottom: 2px; }
.steps li p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.steps li code { font-family: var(--mono); font-size: 0.85em; }
.steps li.done { border-left-color: var(--success); }
.steps li .step-tag { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

/* Requirements table */
.spec { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.spec table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.spec th, .spec td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: top; }
.spec tr:first-child th, .spec tr:first-child td { border-top: 0; }
.spec th { width: 190px; font-weight: 600; }
.spec td { color: var(--muted); }
.spec td strong { color: var(--text); }
.spec td code { font-family: var(--mono); font-size: 0.85em; }
@media (max-width: 640px) { .spec th { width: 118px; } }

/* Notice bar, same role as the app notice banners */
.notice { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.92rem; margin: 0 0 12px; }
.notice-info { background: var(--selected); color: var(--link); }
.notice-ok { background: var(--success-bg); color: var(--success); }
.notice-warn { background: var(--warning-bg); color: var(--warning); }
.notice code { font-family: var(--mono); font-size: 0.86em; }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 16px; margin-bottom: 10px; }
.faq summary { font-weight: 650; cursor: pointer; }
.faq details p { color: var(--muted); font-size: 0.94rem; margin: 8px 0 2px; }
.faq details code { font-family: var(--mono); font-size: 0.85em; }

/* Method cards */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .method-grid { grid-template-columns: 1fr; } }
.method-card { display: block; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.method-card:hover { text-decoration: none; border-color: var(--accent); }
.method-card h3 { margin: 8px 0 4px; font-size: 1.08rem; }
.method-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.method-card code { display: block; margin-top: 10px; font-family: var(--mono); font-size: 0.78rem; background: var(--bg); border: 1px solid var(--border); padding: 8px 10px; border-radius: var(--radius-sm); overflow-x: auto; white-space: nowrap; color: var(--muted); }

/* Guide pages */
.crumbs { font-size: 0.85rem; color: var(--muted); margin: 24px 0 10px; }
.guide { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 22px; }
.guide h1 { font-size: 1.8rem; letter-spacing: -0.015em; margin: 8px 0 6px; font-weight: 750; }
.guide h3 { font-size: 0.95rem; margin: 22px 0 8px; }
.guide .section-sub { color: var(--muted); margin: 0 0 6px; }
.guide pre { background: var(--code-bg); color: var(--code-text); padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.83rem; font-family: var(--mono); line-height: 1.7; }
.pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 40px; }

/* Closing band */
.closing { margin: 30px 0 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.closing h2 { margin: 0; font-size: 1.4rem; letter-spacing: -0.015em; }
.closing p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.closing .row { display: flex; gap: 10px; flex-wrap: wrap; }

footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 36px; padding: 24px 0 40px; color: var(--muted); font-size: 0.88rem; }
.footer-grid { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.footer-brand { display: flex; gap: 10px; align-items: center; color: var(--text); font-weight: 800; }
.footer-brand img { width: 26px; height: 26px; border-radius: 6px; }
footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px 16px; flex-wrap: wrap; }
footer .colophon { margin-top: 14px; font-size: 0.8rem; }
footer .colophon code { font-family: var(--mono); font-size: 0.86em; }

/* Hover play: cards and buttons lift and tilt a touch */
@media (hover: hover) {
  .card, .method-card { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
  .btn { transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.16s ease, box-shadow 0.16s ease; }
  .card:hover, .method-card:hover {
    transform: translateY(-3px) rotate(-0.4deg);
    border-color: var(--accent);
    box-shadow: var(--shadow);
  }
  .btn:hover { transform: translateY(-1px) rotate(-0.4deg); box-shadow: var(--shadow); }
  .btn:active { transform: translateY(0) rotate(0); box-shadow: none; }
  .brand img { transition: transform 1s ease; }
  .brand:hover img { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .card, .method-card, .btn, .brand img { transition: none; }
  .card:hover, .method-card:hover, .btn:hover, .btn:active, .brand:hover img { transform: none; box-shadow: none; }
}

/* Easter egg badges: real buttons that knock loose with a little gravity */
.pill-btn {
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.pill-btn.loose { cursor: grabbing; box-shadow: var(--shadow); }
/* The empty slot stays visible so the badge has a home to return to */
.pill-slot {
  display: inline-block;
  border: 1.5px dashed var(--border);
  border-radius: 11px;
  background: var(--hover);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.14);
}
/* Settle-in twirl when a badge snaps back home */
.pill-btn.home-spin { animation: badge-home 0.55s ease; }
@keyframes badge-home {
  0% { transform: rotate(0deg) scale(0.94); }
  35% { transform: rotate(-12deg) scale(1.02); }
  65% { transform: rotate(7deg) scale(1); }
  100% { transform: rotate(0deg) scale(1); }
}
