/* Ketesa landing page styles */

/* --- Tokens: light (default) ------------------------------------------- */
:root {
  color-scheme: light;

  --primary:        #1858D5;
  --primary-hover:  #1448B0;
  --on-primary:     #FFFFFF;
  --secondary:      #334258;

  --bg:             #F5F5F5;
  --surface:        #FFFFFF;
  --surface-2:      #F0F2F5;
  --text:           #1A1A2E;
  --text-muted:     #575E6B;
  --border:         #E5E7EB;

  /* Dark steel band used for the managed-hosting section */
  --band-bg:        #2B3A52;
  --band-surface:   #33425C;
  --band-text:      #FFFFFF;
  --band-text-muted:rgba(255, 255, 255, 0.78);
  --band-border:    rgba(255, 255, 255, 0.20);

  --focus:          #1858D5;
  --shadow:         0 8px 30px rgba(16, 24, 40, 0.12);
  --shadow-sm:      0 1px 3px rgba(16, 24, 40, 0.10);
  --radius:         12px;
  --radius-sm:      8px;

  --container:      1140px;
  --font-sans:      system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Tokens: dark ------------------------------------------------------- */
/* Applied when the user pins dark, OR (system is dark AND nothing pinned). */
:root[data-theme="dark"] {
  color-scheme: dark;

  --primary:        #F49300;
  --primary-hover:  #FFA722;
  --on-primary:     #0C1318;
  --secondary:      #5B8DAF;

  --bg:             #0C1318;
  --surface:        #151C24;
  --surface-2:      #1B232C;
  --text:           #E8E8ED;
  --text-muted:     #9CA3AF;
  --border:         #253038;

  --band-bg:        #11181F;
  --band-surface:   #1B232C;
  --band-text:      #E8E8ED;
  --band-text-muted:#9CA3AF;
  --band-border:    #253038;

  --focus:          #F49300;
  --shadow:         0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.40);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;

    --primary:        #F49300;
    --primary-hover:  #FFA722;
    --on-primary:     #0C1318;
    --secondary:      #5B8DAF;

    --bg:             #0C1318;
    --surface:        #151C24;
    --surface-2:      #1B232C;
    --text:           #E8E8ED;
    --text-muted:     #9CA3AF;
    --border:         #253038;

    --band-bg:        #11181F;
    --band-surface:   #1B232C;
    --band-text:      #E8E8ED;
    --band-text-muted:#9CA3AF;
    --band-border:    #253038;

    --focus:          #F49300;
    --shadow:         0 8px 30px rgba(0, 0, 0, 0.45);
    --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.40);
  }
}

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

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

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

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; color: var(--text); }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

/* --- Accessibility helpers --------------------------------------------- */
.skip-link {
  position: absolute;
  top: -120%;
  left: 16px;
  z-index: 1000;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.6em 1em;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 0; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Layout ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 2rem;
  text-align: center;
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.6em 1.15em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-lg { padding: 0.8em 1.5em; font-size: 1.05rem; }

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--text-muted); }

/* --- Header / nav ------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.7rem 24px;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-logo { border-radius: 8px; }
.brand-name { font-size: 1.2rem; letter-spacing: -0.02em; }

.nav-right { display: flex; align-items: center; gap: 0.5rem 1.1rem; flex-wrap: wrap; justify-content: flex-end; }
.nav-link { color: var(--text-muted); font-weight: 500; }
.nav-link:hover { color: var(--text); text-decoration: none; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.theme-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3em 0.8em;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.theme-btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.theme-btn:hover:not([aria-pressed="true"]) { color: var(--text); }

/* --- Hero --------------------------------------------------------------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 1rem; }
.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-muted); margin: 0 0 1.75rem; max-width: 38ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem; }
.hero-meta { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

/* --- Screenshots (theme-aware, CSS-only swap, works with JS off) -------- */
.shot { position: relative; }
.shot img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.shot .dark { display: none; }
:root[data-theme="dark"] .shot .light { display: none; }
:root[data-theme="dark"] .shot .dark  { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .shot .light { display: none; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .shot .dark  { display: block; }
}

/* --- Showcase rows ------------------------------------------------------ */
.showcase { padding: clamp(2rem, 5vw, 4rem) 0; }
.showcase-alt { background: var(--surface); border-block: 1px solid var(--border); }
.showcase-row {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.showcase-alt .showcase-row { direction: rtl; }
.showcase-alt .showcase-row > * { direction: ltr; }
.showcase-copy h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1rem; }
.showcase-copy p { color: var(--text-muted); margin: 0; font-size: 1.08rem; }

/* --- Features grid ------------------------------------------------------ */
.features { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.feature-grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.feature-card h3 { font-size: 1.2rem; margin: 0 0 0.5rem; }
.feature-card p { color: var(--text-muted); margin: 0; font-size: 0.98rem; }

/* --- Managed (etke.cc funnel) band ------------------------------------- */
.managed {
  background: var(--band-bg);
  color: var(--band-text);
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}
.managed-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.managed h2 { color: var(--band-text); font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin: 0 0 1rem; }
.managed .lede { color: var(--band-text-muted); max-width: 46ch; }
.managed .lede a { color: var(--band-text); text-decoration: underline; }
.eyebrow-on-accent { color: var(--band-text-muted); }
.managed-kicker { font-size: 1.2rem; margin: 0 0 1.75rem; color: var(--band-text); }
.managed-kicker strong { color: var(--band-text); }
.managed-list {
  list-style: none;
  margin: 0 0 1.75rem; padding: 0;
  display: grid; gap: 0.85rem;
}
.managed-list li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--band-text-muted);
  font-size: 1rem;
}
.managed-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.managed-list strong { color: var(--band-text); }
.managed-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.managed .btn-ghost { color: var(--band-text); border-color: var(--band-border); }
.managed .btn-ghost:hover { background: var(--band-surface); border-color: var(--band-text); color: var(--band-text); }
.managed .shot img { border-color: var(--band-border); }

/* --- About / open source ------------------------------------------------ */
.about { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.about-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.about-logo { border-radius: var(--radius-sm); margin-bottom: 1rem; }
.about h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 1rem; }
.about p { color: var(--text-muted); font-size: 1.1rem; margin: 0 0 1.75rem; }
.about-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* --- Get started -------------------------------------------------------- */
.get-started { padding: clamp(2.5rem, 6vw, 5rem) 0; background: var(--surface); border-top: 1px solid var(--border); }
.start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.25rem;
}
.start-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}
.start-card h3 { font-size: 1.25rem; margin: 0 0 0.6rem; }
.start-card p { color: var(--text-muted); margin: 0 0 1.5rem; flex: 1; }
.start-card .btn { align-self: flex-start; }

/* --- Footer ------------------------------------------------------------- */
.site-footer { background: var(--bg); border-top: 1px solid var(--border); padding: 2.5rem 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; justify-content: space-between; }
.footer-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--text); }
.footer-legal { width: 100%; margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* --- Error page --------------------------------------------------------- */
.error {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 0;
}
.error-code { font-size: clamp(4rem, 14vw, 7rem); line-height: 1; margin: 0; color: var(--primary); }
.error h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0.5rem 0 1rem; }
.error p { color: var(--text-muted); font-size: 1.1rem; margin: 0 0 1.75rem; }
.error-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 860px) {
  .hero-grid,
  .showcase-row,
  .managed-grid { grid-template-columns: 1fr; }
  .showcase-alt .showcase-row { direction: ltr; }
  .hero-shot, .managed-shot { order: 2; }
  .nav-cta { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav-link { display: none; }
  .nav { flex-wrap: wrap; }
  .lede { max-width: none; }
}

/* --- Motion / contrast preferences ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .btn, .feature-card, .start-card, .shot img, .theme-toggle { border: 1px solid CanvasText; }
  .theme-btn[aria-pressed="true"] { background: Highlight; color: HighlightText; }
  .managed-list li::before { background: CanvasText; }
  :where(a, button, [tabindex]):focus-visible { outline: 3px solid Highlight; }
}
