/*
 * Shared Kestori static-site foundation.
 * Marketing-only presentation lives in marketing-site.css. Critical homepage
 * hero CSS stays inline so first paint does not block on either stylesheet.
 */

:root {
  --color-bg: #fbfaf6;
  --color-surface: #fffefa;
  --color-text: #18231f;
  --color-muted: #53635d;
  --color-accent: #145743;
  --color-accent-hover: #0b3f31;
  --color-accent-soft: #dcece5;
  --color-accent-mist: #eef6f2;
  --color-warm: #e99a21;
  --color-warm-soft: #fff0d3;
  --color-warm-border: #edc276;
  --color-warm-text: #67430b;
  --color-border: #dbe3de;
  --color-border-strong: #b9c9c0;
  --color-soft: #f0f4f1;
  --color-on-accent: #fff;
  --color-header: rgba(255, 254, 250, 0.96);
  --color-grid: rgba(20, 87, 67, 0.045);
  --color-marketing-glow: rgba(220, 236, 229, 0.85);
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --maxw: 1120px;
  --radius: 16px;
  --radius-small: 8px;
  --shadow-soft: 0 12px 34px rgba(22, 61, 48, 0.08);
  --shadow-raised: 0 24px 64px rgba(22, 61, 48, 0.13);
}

html[data-theme='dark'] {
  --color-bg: #0c1512;
  --color-surface: #13211c;
  --color-text: #edf4ef;
  --color-muted: #a8bab1;
  --color-accent: #76d9b5;
  --color-accent-hover: #a1e8cf;
  --color-accent-soft: #1c3d32;
  --color-accent-mist: #153027;
  --color-warm: #efb24f;
  --color-warm-soft: #382914;
  --color-warm-border: #745525;
  --color-warm-text: #f4cf8d;
  --color-border: #2b4037;
  --color-border-strong: #4a655a;
  --color-soft: #101d18;
  --color-on-accent: #09271d;
  --color-header: rgba(19, 33, 28, 0.96);
  --color-grid: rgba(118, 217, 181, 0.075);
  --color-marketing-glow: rgba(28, 61, 50, 0.78);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.24);
  --shadow-raised: 0 24px 64px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  color: var(--color-accent-hover);
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.75rem, 6vw, 4rem);
}

h2 {
  margin-top: 1.8em;
  font-size: clamp(1.85rem, 3vw, 2.4rem);
}

h3 {
  margin-top: 1.5em;
  font-size: 1.35rem;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

li {
  margin-bottom: 0.35em;
}

figure {
  margin: 0;
}

figcaption {
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

code {
  padding: 0.1em 0.35em;
  background: var(--color-soft);
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header / nav */

.site-header {
  padding: 18px 0;
  background: var(--color-header);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(22, 61, 48, 0.03);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--color-text);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand::before {
  content: '';
  width: 12px;
  height: 18px;
  background: linear-gradient(180deg, var(--color-warm) 0 38%, var(--color-accent) 38% 100%);
  border-radius: 3px;
  box-shadow: 7px 5px 0 -3px var(--color-accent-soft);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nav a {
  padding: 8px 12px;
  color: var(--color-text);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--color-accent);
  background: var(--color-accent-mist);
}

/* Theme preference */

.theme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-width: 74px;
  min-height: 44px;
  cursor: pointer;
}

.theme-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.theme-toggle__visual {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 7px;
  color: var(--color-muted);
  background: var(--color-soft);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.theme-toggle:hover .theme-toggle__visual {
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.theme-toggle__input:focus-visible + .theme-toggle__visual {
  outline: 3px solid var(--color-warm);
  outline-offset: 3px;
}

.theme-toggle__icon {
  width: 15px;
  font-size: 0.85rem;
  line-height: 1;
  text-align: center;
}

.theme-toggle__track {
  position: relative;
  width: 30px;
  height: 18px;
  background: var(--color-border-strong);
  border-radius: 999px;
}

.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  background: var(--color-surface);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.theme-toggle__input:checked + .theme-toggle__visual .theme-toggle__track {
  background: var(--color-accent);
}

.theme-toggle__input:checked + .theme-toggle__visual .theme-toggle__thumb {
  transform: translateX(12px);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 24px;
  color: var(--color-on-accent);
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-small);
  box-shadow: 0 9px 22px rgba(20, 87, 67, 0.2);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.btn:hover {
  color: var(--color-on-accent);
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn-secondary {
  color: var(--color-accent);
  background: transparent;
}

.btn-secondary:hover {
  color: var(--color-accent-hover);
  background: var(--color-soft);
}

a:focus-visible,
summary:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid var(--color-warm);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  body,
  .site-header,
  .feature,
  .price-card,
  .migration-steps > li,
  .site-footer,
  .theme-toggle__visual,
  .theme-toggle__track,
  .theme-toggle__thumb {
    transition:
      color 180ms ease,
      background-color 180ms ease,
      border-color 180ms ease,
      box-shadow 180ms ease,
      transform 180ms ease;
  }
}

.launch-live {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  max-width: 36em;
}

.launch-live span {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.launch-live span a {
  color: var(--color-accent);
  font-weight: 600;
}

.launch-live span a:hover {
  color: var(--color-accent-hover);
}

/* Sections */

.section {
  padding: 76px 0;
}

.section-soft {
  background:
    radial-gradient(circle at 12% 20%, rgba(233, 154, 33, 0.08), transparent 28%), var(--color-soft);
  border-block: 1px solid var(--color-border);
}

.lede {
  max-width: 40em;
  color: var(--color-muted);
  font-size: 1.18rem;
  line-height: 1.7;
}

/* Shared comparison tables */

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

table.compare th,
table.compare td {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

table.compare th {
  background: var(--color-soft);
  font-weight: 600;
}

.table-scroll {
  width: 100%;
  margin: 20px 0 34px;
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.table-scroll table.compare {
  min-width: 760px;
  margin: 0;
  background: var(--color-surface);
}

/* Footer */

.site-footer {
  margin-top: 80px;
  padding: 34px 0;
  color: var(--color-muted);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.site-footer a {
  margin-right: 14px;
  color: var(--color-muted);
}

/* Legal pages: tighter text column */

.legal {
  max-width: 42em;
}

.legal h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
}

.legal h2 {
  font-size: 1.25rem;
}

.legal h3 {
  font-size: 1.05rem;
}

@media (max-width: 719px) {
  body {
    font-size: 16px;
  }

  .container {
    padding-inline: 18px;
  }

  .site-header {
    padding: 12px 0;
  }

  .site-header .container {
    flex-wrap: nowrap;
  }

  .brand {
    font-size: 1rem;
  }

  .brand::before {
    width: 10px;
    height: 16px;
  }

  .nav {
    flex-wrap: nowrap;
    gap: 2px;
    justify-content: flex-end;
  }

  .theme-toggle {
    min-width: 68px;
  }

  .nav a {
    padding: 8px 5px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .section {
    padding: 58px 0;
  }

  .btn {
    width: 100%;
    padding-inline: 16px;
    text-align: center;
  }

  .site-footer .container {
    flex-direction: column;
  }
}
