/* EasyDB — https://easydb.by-atlas.xyz
   Shared styles for index.html, privacy.html, support.html.
   No framework, no build step. Edit directly and re-upload. */

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: light dark;

  --bg:            #ffffff;
  --bg-subtle:     #f5f5f7;
  --bg-raised:     #ffffff;
  --bg-sunken:     #fafafa;

  --text:          #1d1d1f;
  --text-muted:    #6e6e73;
  --text-faint:    #86868b;

  --border:        #e3e3e6;
  --border-strong: #d2d2d7;

  /* Purple is the app's AI colour: the sparkles icon, the "Using current
     query" chip, and SQL keyword highlighting all use systemPurple. */
  --accent:        #9333c4;
  --accent-hover:  #7d2ba8;
  --accent-soft:   rgba(175, 82, 222, 0.10);
  --accent-line:   rgba(175, 82, 222, 0.28);

  /* Blue comes from the app icon's speech bubble. */
  --blue:          #0067d6;
  --blue-soft:     rgba(10, 132, 255, 0.10);

  /* The editor's syntax palette, reused so SQL here looks like SQL there. */
  --syn-keyword:   #9333c4;
  --syn-string:    #c41a16;
  --syn-number:    #1c00cf;
  --syn-comment:   #007400;

  --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg:     0 12px 32px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);

  --maxw:          1040px;
  --radius:        12px;
  --radius-lg:     16px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #000000;
    --bg-subtle:     #0e0e10;
    --bg-raised:     #1c1c1e;
    --bg-sunken:     #141416;

    --text:          #f5f5f7;
    --text-muted:    #a1a1a6;
    --text-faint:    #86868b;

    --border:        #2a2a2d;
    --border-strong: #3a3a3d;

    --accent:        #bf5af2;
    --accent-hover:  #cf7ef5;
    --accent-soft:   rgba(191, 90, 242, 0.16);
    --accent-line:   rgba(191, 90, 242, 0.40);

    --blue:          #0a84ff;
    --blue-soft:     rgba(10, 132, 255, 0.16);

    --syn-keyword:   #d9a2f5;
    --syn-string:    #ff6b60;
    --syn-number:    #6cb6ff;
    --syn-comment:   #4ec94e;

    --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-lg:     0 12px 40px rgba(0, 0, 0, 0.6);
  }
}

/* ---------------------------------------------------------------- base */

* { box-sizing: border-box; }

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

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

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

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

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

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

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 650; }
h3 { font-size: 1.1rem; font-weight: 620; letter-spacing: -0.01em; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

code, kbd {
  font-family: var(--mono);
  font-size: 0.88em;
}

kbd {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  font-size: 0.82em;
  white-space: nowrap;
}

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

.narrow { max-width: 720px; }

/* Visible only to screen readers. */
.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.2rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 620;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-right: auto;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand img { width: 26px; height: 26px; }
.nav-brand { flex: none; }

.nav-links {
  display: flex;
  gap: 1.4rem;
  font-size: 0.94rem;
}
/* Without nowrap, "How it works" wraps to two lines and overruns the 56px bar. */
.nav-links a { color: var(--text-muted); white-space: nowrap; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

@media (max-width: 620px) {
  .nav-inner { gap: 1rem; }
  .nav-links { gap: 1rem; font-size: 0.88rem; }
  /* Drop the least important link rather than let the bar overflow. */
  .nav-links .hide-sm { display: none; }
}

/* ---------------------------------------------------------------- hero */

.hero {
  text-align: center;
  padding: 5rem 0 3rem;
}

.hero img.appicon {
  width: 116px;
  height: 116px;
  margin: 0 auto 1.75rem;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.16));
}

.hero h1 { margin-bottom: 1.1rem; }

.hero .lede {
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

.cta-row {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.5rem;
  border-radius: 980px;
  font-size: 1rem;
  font-weight: 550;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  cursor: default;
}
.btn-primary:hover { background: var(--accent-hover); }

/* Not-yet-shipped state: reads as a status, not a broken link. */
.btn-soon {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
  cursor: default;
}

.btn-secondary {
  background: transparent;
  color: var(--blue);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--blue); }

.requirements-line {
  font-size: 0.88rem;
  color: var(--text-faint);
}

/* ---------------------------------------------------------------- sections */

.section { padding: 4.5rem 0; }
.section + .section { padding-top: 0; }

.section-subtle {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 4.5rem;
}
.section-subtle + .section { padding-top: 4.5rem; }

.section-head {
  max-width: 660px;
  margin-bottom: 2.5rem;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.section-head h2 { margin-bottom: 0.85rem; }

.section-head p {
  color: var(--text-muted);
  font-size: 1.06rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 620;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

/* ---------------------------------------------------------------- screenshots */

/* The screenshots are the app's own window, captured at 2560x1600 against a
   transparent background — chrome, rounded corners and all. So there is no
   frame to draw here: the shadow goes on the image, where drop-shadow can
   follow the alpha instead of tracing a rectangle the window doesn't fill. */
.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.16))
          drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

@media (prefers-color-scheme: dark) {
  /* A soft grey shadow is invisible on black, so lean on one deep one. */
  .shot img {
    filter: drop-shadow(0 14px 44px rgba(0, 0, 0, 0.65));
  }
}

/* ---------------------------------------------------------------- steps */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  counter-reset: step;
}

.step {
  border-top: 2px solid var(--accent-line);
  padding-top: 1.1rem;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
  margin-bottom: 0.7rem;
}

.step h3 { margin-bottom: 0.45rem; }

.step p {
  color: var(--text-muted);
  font-size: 0.96rem;
}

@media (max-width: 780px) {
  .steps { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* ---------------------------------------------------------------- code / SQL */

.code {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre;
  margin: 0;
  tab-size: 2;
}

.kw  { color: var(--syn-keyword); font-weight: 550; }
.str { color: var(--syn-string); }
.num { color: var(--syn-number); }
.com { color: var(--syn-comment); font-style: italic; }

/* The Ask field, recreated. Purple sparkle + chip, matching the app. */
.ask-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  box-shadow: var(--shadow-sm);
}

.ask-sparkle { color: var(--accent); font-size: 1.05rem; flex: none; }

.ask-text {
  flex: 1 1 200px;
  color: var(--text);
  font-size: 0.98rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 980px;
  padding: 0.18rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 550;
  white-space: nowrap;
}

.ask-btn {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 560;
  flex: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.ask-btn:hover { background: var(--accent-hover); }

.ask-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-faint);
  margin: 0.9rem 0;
}
.ask-hint b { color: var(--text-muted); font-weight: 560; }

/* Swapping examples: brief fade so the change is legible, not jarring. */
#askSql, #askText { transition: opacity 0.15s ease; }
#askSql.swapping, #askText.swapping { opacity: 0.25; }

@media (prefers-reduced-motion: reduce) {
  #askSql, #askText { transition: none; }
  #askSql.swapping, #askText.swapping { opacity: 1; }
}

/* The write-confirmation bar, quoted verbatim from the app. */
.confirm-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-left: 3px solid #febc2e;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow-sm);
}

.confirm-bar .label { font-weight: 560; font-size: 0.96rem; margin-right: auto; }

.confirm-actions { display: flex; gap: 0.5rem; flex: none; }

.mini-btn {
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 0.28rem 0.8rem;
  font-size: 0.88rem;
  background: var(--bg-subtle);
  color: var(--text);
  white-space: nowrap;
  font-family: inherit;
  cursor: pointer;
}
.mini-btn:hover { border-color: var(--text-faint); }

.mini-btn.filled {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 550;
}
.mini-btn.filled:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Settled state after the demo bar is answered. */
.confirm-bar.answered { border-left-color: var(--border-strong); }
.confirm-bar.answered .label { color: var(--text-muted); font-weight: 500; }

/* ---------------------------------------------------------------- feature grid */

/* Bare labels, so it reads as a list rather than a set of cards. */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem 2rem;
}

.feature h3 {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0.35rem 0 0;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  transform: translateY(-2px);
}

/* ---------------------------------------------------------------- callout */

.callout {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  padding: 1.6rem 1.8rem;
  box-shadow: var(--shadow-sm);
}

.callout h3 { margin-bottom: 0.5rem; }
.callout p { color: var(--text-muted); font-size: 0.97rem; }

.callout-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.callout-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  font-size: 0.97rem;
  color: var(--text-muted);
}

.callout-list b { color: var(--text); font-weight: 580; }

.check {
  color: var(--accent);
  font-weight: 700;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- error example */

.error-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.error-card .headline { font-weight: 580; margin-bottom: 0.3rem; }
.error-card .hint { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0.9rem; }

/* Real disclosure — it looked like one, so it should behave like one. */
.error-card .disclosure {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.error-card .disclosure summary {
  font-size: 0.87rem;
  color: var(--text-faint);
  font-family: var(--mono);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.error-card .disclosure summary::-webkit-details-marker { display: none; }

.error-card .disclosure summary::before {
  content: "\25B8";
  display: inline-block;
  transition: transform 0.15s ease;
}
.error-card .disclosure[open] summary::before { transform: rotate(90deg); }

.error-card .disclosure summary:hover { color: var(--text-muted); }

.error-card .disclosure p {
  margin: 0.7rem 0 0.2rem;
  font-family: var(--mono);
  font-size: 0.87rem;
  color: var(--text-muted);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  overflow-x: auto;
}

/* ---------------------------------------------------------------- FAQ */

.faq { display: grid; gap: 0.75rem; }

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 0 1.2rem;
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  padding: 1rem 0;
  font-weight: 560;
  font-size: 1rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  flex: none;
}
.faq details[open] summary::after { content: "\2013"; }

.faq details[open] summary { border-bottom: 1px solid var(--border); }

.faq .answer {
  padding: 1rem 0 1.15rem;
  color: var(--text-muted);
  font-size: 0.97rem;
}

/* ---------------------------------------------------------------- prose pages */

.prose { padding: 3.5rem 0 4rem; }
.prose h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin-bottom: 0.6rem; }
.prose h2 { font-size: 1.35rem; margin: 2.5rem 0 0.8rem; }
.prose h3 { margin: 1.75rem 0 0.5rem; }
.prose p, .prose li { color: var(--text-muted); }
.prose strong { color: var(--text); font-weight: 580; }
.prose ul { padding-left: 1.2rem; display: grid; gap: 0.5rem; margin: 0 0 1rem; }
.prose .updated { color: var(--text-faint); font-size: 0.9rem; margin-bottom: 2rem; }

/* ---------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--border);
  margin-top: 4.5rem;
  padding: 2.5rem 0;
  font-size: 0.9rem;
  color: var(--text-faint);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  margin-right: auto;
}
.footer-brand img { width: 20px; height: 20px; }

.footer a { color: var(--text-muted); }
