/* Ostella Website Stylesheet
   Design Tokens & Indigo Palette synced from addon/frontend_src/src/app.css.
   Plain CSS, zero build step, zero external requests, full dark-mode support. */

:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --panel-2: #f8f9fc;
  --ink: #1a1d29;
  --fg: #1a1d29;
  --muted: #5f6577;
  --line: #e3e5ec;
  --line-strong: #80859a;
  --accent: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: #ecebfb;
  --card: #ffffff;
  --good: #1f7a4a;
  --good-bg: #e3f2e9;
  --warn: #965d06;
  --warn-bg: #f9eedb;
  --bad: #b4372c;
  --bad-bg: #fbe7e4;
  --info: #4338ca;
  --info-bg: #ecebfb;
  --shadow: 0 1px 3px rgba(26, 29, 41, 0.06), 0 4px 16px rgba(26, 29, 41, 0.06);
  --shadow-soft: 0 1px 2px rgba(26, 29, 41, 0.07);
  --radius: 12px;
  --radius-sm: 8px;
  --measure: 46rem;
  --wide: 64rem;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12131a;
    --panel: #1a1c26;
    --panel-2: #161822;
    --ink: #e8e9f0;
    --fg: #e8e9f0;
    --muted: #9a9eb2;
    --line: #282b3a;
    --line-strong: #6a6f86;
    --accent: #8f88f5;
    --accent-ink: #12131a;
    --accent-soft: #25234a;
    --card: #1a1c26;
    --good: #6ac592;
    --good-bg: #16271e;
    --warn: #e3ae5f;
    --warn-bg: #2b2318;
    --bad: #ef8a7d;
    --bad-bg: #301c19;
    --info: #a39df8;
    --info-bg: #25234a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-soft: none;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--accent-soft);
  color: var(--fg);
}

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

header,
main,
footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Pages with a hero (home) use a wider frame; reading text stays at the measure. */
body:has(.hero) header,
body:has(.hero) main,
body:has(.hero) footer {
  max-width: var(--wide);
}

body:has(.hero) main > * {
  max-width: var(--measure);
}

body:has(.hero) main > .hero,
body:has(.hero) main > .screenshot-figure,
body:has(.hero) main > section:has(.feature-grid) {
  max-width: none;
}

body:has(.hero) main > section:has(.feature-grid) > :not(.feature-grid) {
  max-width: var(--measure);
}

/* Header */
header {
  padding-top: 20px;
  padding-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
}

.brand img {
  display: block;
  width: 32px;
  height: 32px;
  margin-right: 8px;
}

.brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 9px;
  border-radius: 9999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--line);
  line-height: 1.5;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  align-items: center;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

nav a:hover {
  color: var(--fg);
  border-bottom-color: var(--line-strong);
  text-decoration: none;
}

nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* Typography & Layout */
main {
  padding-top: 40px;
  padding-bottom: 56px;
}

h1,
h2,
h3,
h4 {
  color: var(--fg);
  text-wrap: balance;
}

h1 {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 0.6em;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 2.4em 0 0.6em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.005em;
  margin: 1.6em 0 0.4em;
}

h4 {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
  margin: 1.2em 0 0.3em;
}

main > :first-child {
  margin-top: 0;
}

p,
li {
  margin: 0.7em 0;
}

ul,
ol {
  padding-left: 1.4em;
}

li::marker {
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration-thickness: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5em 0;
}

.lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--fg);
  margin-bottom: 1.2em;
}

.sublead {
  font-size: 1rem;
  color: var(--muted);
  margin-top: -0.4em;
  margin-bottom: 1.2em;
}

.note {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Hero */
.hero {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 32px 20px 24px;
  margin: 0 0 40px;
}

.hero h1 {
  font-size: 2.2rem;
  max-width: 22ch;
}

.hero .lead {
  max-width: 40rem;
  margin-bottom: 0.4em;
}

.hero .button-group {
  margin-bottom: 0;
}

/* Buttons */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 24px 0;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.4;
  border: 1px solid transparent;
  box-shadow: var(--shadow-soft);
  transition: filter 0.15s ease, background-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
  text-align: center;
}

.button:hover {
  filter: brightness(1.08);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.button-secondary {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line-strong);
}

.button-secondary:hover {
  background: var(--panel-2);
  filter: none;
  border-color: var(--accent);
}

/* Cards & Callouts */
.box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
  box-shadow: var(--shadow);
}

.box > :first-child {
  margin-top: 0;
}

.box > :last-child {
  margin-bottom: 0;
}

.box h2,
.box h3 {
  margin-top: 0;
}

.box h2 {
  font-size: 1.3rem;
}

.box-highlight {
  background: var(--panel-2);
  border-left: 4px solid var(--accent);
}

.box-warning {
  background: var(--panel-2);
  border-left: 4px solid var(--warn);
}

/* Step Lists */
.step-list {
  list-style: none;
  padding-left: 0;
  margin: 28px 0;
  counter-reset: step-counter;
}

.step-item {
  position: relative;
  padding-left: 52px;
  margin: 0 0 28px;
}

.step-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: -22px;
  width: 2px;
  background: var(--line);
}

.step-item::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.step-item h3 {
  margin-top: 0;
  margin-bottom: 6px;
  line-height: 32px;
}

.step-item p {
  margin: 0;
}

/* Screenshots: placeholder or real image */
.screenshot-figure {
  margin: 36px 0;
}

.screenshot-box {
  background: var(--panel-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.screenshot-box:has(img) {
  aspect-ratio: auto;
  display: block;
  padding: 0;
  border-style: solid;
  border-color: var(--line);
  overflow: hidden;
}

.screenshot-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.screenshot-box img {
  width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.screenshot-inner {
  max-width: 85%;
}

.screenshot-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 9999px;
  margin-bottom: 10px;
}

.screenshot-title {
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--fg);
  margin-bottom: 6px;
}

.screenshot-desc {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

figcaption {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 24px 0;
}

@media (min-width: 600px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.feature-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.55;
}

/* FAQ item */
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.faq-item:first-of-type {
  border-top: 1px solid var(--line);
  margin-top: 16px;
}

.faq-question {
  font-size: 1.12rem;
  font-weight: 650;
  line-height: 1.35;
  margin: 0 0 8px;
  color: var(--fg);
}

.faq-answer {
  margin: 0;
  font-size: 0.98rem;
  color: var(--fg);
  line-height: 1.65;
}

.faq-answer p {
  margin: 0.5em 0;
}

/* Code & Tables */
code {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

pre {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.9rem;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  margin: 24px 0;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 600;
  background: var(--panel-2);
  border-bottom-color: var(--line-strong);
}

/* Footer */
footer {
  padding-top: 28px;
  padding-bottom: 48px;
  margin-top: 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: 20px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 2px 0;
}

.footer-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-nav a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
}

.footer-copy {
  margin-top: 12px;
}

.footer-disclaimer {
  margin-top: 12px;
  max-width: var(--measure);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}

.footer-disclaimer p {
  margin: 0.5em 0;
}

/* Larger screens */
@media (min-width: 720px) {
  h1 {
    font-size: 2.4rem;
  }

  .hero {
    padding: 56px 48px 48px;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .hero .lead {
    font-size: 1.28rem;
  }

  main {
    padding-top: 56px;
  }
}

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

  .feature-card:hover,
  .button:active {
    transform: none;
  }
}
