/* ──────────────────────────────────────────────────────────────
   miqsoft.com — MIQ Software Solutions

   Palette is sampled from the Bes app icon: teal #1E7A78 (the brand),
   cream #FDF6E9 (the app's ground), gold #C89434 (its accent). Light is
   canonical because the app is light by default; gold doubles as the
   night-mode signal, which is what the app actually shifts to after dark.
   ────────────────────────────────────────────────────────────── */

:root {
  --ground:    #FBF6EC;
  --surface:   #FFFFFF;
  --surface-2: #F5EFE2;
  --ink:       #14312F;
  --ink-2:     #4A6462;
  --ink-3:     #7C918F;
  --rule:      #E4DBCA;
  --rule-soft: #EFE8DA;

  --teal:      #1E7A78;
  --teal-quiet:#2E8E8B;
  --gold:      #9C6E12;
  --gold-fill: #C89434;

  --on-teal:   #FDF6E9;
  --on-gold:   #14312F;

  --fill-bg:   #FBEFD6;
  --fill-ink:  #7A5406;
  --fill-edge: #DCBF83;

  /* Display + wordmark. Geometric, to match the mark: circle, straight line, even
     stroke. Jost is Futura-derived, and its Q *is* a circle with a straight crossing
     tail — so the mark reads as the wordmark's own Q, enlarged.
     Body stays Karla: humanist, and far easier to read at length than a geometric
     sans. Geometric display over humanist text is the contrast doing the work here. */
  --f-display: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
  --f-ui:      "Karla", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --f-mono:    ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --s--1: 0.8438rem;
  --s-0:  1rem;
  --s-1:  1.125rem;
  --s-2:  1.375rem;
  --s-3:  1.75rem;
  --s-4:  2.375rem;

  --measure: 34rem;
  --shadow:  0 0.75rem 2rem rgba(20, 49, 47, 0.10);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:    #101F1E;
    --surface:   #172B29;
    --surface-2: #1E3634;
    --ink:       #F2EADC;
    --ink-2:     #A7B9B6;
    --ink-3:     #7A8D8A;
    --rule:      #26403D;
    --rule-soft: #1C302E;

    --teal:      #57BAB5;
    --teal-quiet:#3FA39F;
    --gold:      #E0AE4E;
    --gold-fill: #C89434;

    --on-teal:   #0B1817;
    --on-gold:   #14312F;

    --fill-bg:   #3A2D12;
    --fill-ink:  #F0CE8A;
    --fill-edge: #6B5520;

    --shadow:    0 0.75rem 2rem rgba(0, 0, 0, 0.38);
  }
}

:root[data-theme="dark"] {
  --ground:    #101F1E;
  --surface:   #172B29;
  --surface-2: #1E3634;
  --ink:       #F2EADC;
  --ink-2:     #A7B9B6;
  --ink-3:     #7A8D8A;
  --rule:      #26403D;
  --rule-soft: #1C302E;

  --teal:      #57BAB5;
  --teal-quiet:#3FA39F;
  --gold:      #E0AE4E;
  --gold-fill: #C89434;

  --on-teal:   #0B1817;
  --on-gold:   #14312F;

  --fill-bg:   #3A2D12;
  --fill-ink:  #F0CE8A;
  --fill-edge: #6B5520;

  --shadow:    0 0.75rem 2rem rgba(0, 0, 0, 0.38);
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: var(--s-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

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

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

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

/* ── Shell ─────────────────────────────────────── */

.shell { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem 6rem; }
.shell--narrow { max-width: 40rem; }

/* ── Site header ───────────────────────────────── */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem 0;
  flex-wrap: wrap;
}

.site-nav { display: flex; gap: 1.25rem; font-size: var(--s--1); }
.site-nav a { color: var(--ink-2); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--teal); }

/* ── Typography ────────────────────────────────── */

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}

h1 { font-size: var(--s-4); line-height: 1.1; }
h2 { font-size: var(--s-3); line-height: 1.2; letter-spacing: -0.01em; color: var(--teal); }
h3 { font-size: var(--s-1); line-height: 1.34; letter-spacing: -0.005em; }

p { margin: 0; max-width: var(--measure); }

.prose { display: flex; flex-direction: column; gap: 1rem; }
.prose h2 { margin-top: 1.25rem; }
.prose h3 { margin-top: 0.75rem; }
.prose > p { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 700; }

.prose ul, .prose ol {
  margin: 0;
  padding-left: 1.25rem;
  max-width: var(--measure);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--ink-2);
}

.lede { font-size: var(--s-1); color: var(--ink-2); max-width: 36rem; }

.kicker {
  font-family: var(--f-mono);
  font-size: var(--s--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

.meta { font-family: var(--f-mono); font-size: var(--s--1); color: var(--ink-3); }

/* ── Sections ──────────────────────────────────── */

section { margin-top: 3.5rem; }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack--lg { gap: 1.75rem; }

hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 3.5rem 0 0; }

.intro { padding: 3rem 0 0; display: flex; flex-direction: column; gap: 1.25rem; }
.intro h1 { max-width: 26ch; }

/* ── Product hero ──────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: 1fr 15rem;
  gap: 3rem;
  align-items: center;
  padding: 2.5rem 0 0;
}

.hero-copy { display: flex; flex-direction: column; gap: 1.25rem; }

.badge-soon {
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-mono);
  font-size: var(--s--1);
  letter-spacing: 0.04em;
  color: var(--gold);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}

.badge-soon::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-fill);
}

/* ── Screenshots ───────────────────────────────── */

.shot {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.feature {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 2.5rem;
  align-items: center;
}

.feature--flip { grid-template-columns: 1fr 13rem; }
.feature--flip .feature-shot { order: 2; }

.feature-body { display: flex; flex-direction: column; gap: 0.75rem; }
.feature-body h3 { font-size: var(--s-2); }
.feature-body p { color: var(--ink-2); }

/* ── Cards & panels ────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.75rem;
  padding: 1.5rem 1.65rem;
}

.panel h2, .panel h3 { margin-bottom: 0.5rem; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

.trio > div {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 1rem;
  border-top: 2px solid var(--teal);
}

.trio h3 { font-size: var(--s-0); }
.trio p { font-size: var(--s--1); color: var(--ink-2); }

/* ── Track list (what Bes records) ─────────────── */

.tracks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.75rem 1.5rem;
}

.tracks li {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.5rem;
  font-size: var(--s--1);
  color: var(--ink-2);
}

.tracks li::before { content: "·"; color: var(--teal); font-weight: 700; text-align: center; }
.tracks b { color: var(--ink); font-weight: 700; }

/* ── Contact ───────────────────────────────────── */

.contact { display: flex; flex-direction: column; gap: 0.35rem; }
.contact a { font-family: var(--f-mono); font-size: var(--s-1); word-break: break-all; }

/* ── Definition rows ───────────────────────────── */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 0.75rem;
  overflow: hidden;
}

.rows > li {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--rule-soft);
}

.rows > li:last-child { border-bottom: 0; }
.rows .term { font-weight: 700; font-size: var(--s--1); color: var(--ink); }
.rows .def { margin: 0; font-size: var(--s--1); color: var(--ink-2); }

/* ── Product shelf ─────────────────────────────── */

.shelf { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }

.product {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule-soft);
  align-items: start;
}

.shelf > .product:last-child { border-bottom: 1px solid var(--rule-soft); }

.app-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1.1rem;
  border: 1px solid var(--rule);
}

.product-body { min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.product-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 0.75rem; }

.product-name {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: var(--s-2);
  letter-spacing: -0.008em;
  color: var(--ink);
  text-decoration: none;
}

.product-name:hover { text-decoration: underline; }

.status {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid var(--rule);
  color: var(--ink-3);
  white-space: nowrap;
}

.status--soon { color: var(--gold); border-color: var(--gold); }

.product-body p { color: var(--ink-2); font-size: var(--s-0); }

.product-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: var(--s--1);
  margin-top: 0.15rem;
}

.shelf-note { font-size: var(--s--1); color: var(--ink-3); margin-top: 1.25rem; max-width: var(--measure); }

/* ── Placeholders — deliberately visible ───────── */

.fill {
  background: var(--fill-bg);
  color: var(--fill-ink);
  border: 1px dashed var(--fill-edge);
  border-radius: 0.25rem;
  padding: 0.1rem 0.4rem;
  font-family: var(--f-mono);
  font-size: 0.9em;
}

.fill-note {
  border-left: 2px solid var(--gold-fill);
  background: var(--surface);
  border-radius: 0 0.4rem 0.4rem 0;
  padding: 0.9rem 1.1rem;
  font-size: var(--s--1);
  color: var(--ink-2);
  max-width: var(--measure);
}

.fill-note strong { color: var(--gold); }

/* ── FAQ ───────────────────────────────────────── */

.faq { display: flex; flex-direction: column; }
.faq details { border-bottom: 1px solid var(--rule-soft); padding: 0.15rem 0; }

.faq summary {
  cursor: pointer;
  padding: 0.9rem 0;
  font-weight: 700;
  font-size: var(--s-0);
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-mono); color: var(--teal); flex: none; }
.faq details[open] summary::after { content: "−"; }

.faq details > *:not(summary) {
  padding-bottom: 1rem;
  color: var(--ink-2);
  font-size: var(--s--1);
  max-width: var(--measure);
}

/* ── Footer ────────────────────────────────────── */

.site-foot {
  margin-top: 4rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: var(--s--1);
  color: var(--ink-3);
}

.site-foot nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* ── Responsive ────────────────────────────────── */

@media (max-width: 44rem) {
  .feature, .feature--flip { grid-template-columns: 1fr; gap: 1.5rem; }
  .feature--flip .feature-shot { order: 0; }
  .feature-shot { max-width: 14rem; }
  .trio { grid-template-columns: 1fr; }
}

@media (max-width: 40rem) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 1.5rem; }
  .hero-shot { max-width: 15rem; }
  .intro { padding-top: 1.5rem; }
  .rows > li { grid-template-columns: 1fr; gap: 0.35rem; }
  .product { grid-template-columns: 3rem 1fr; gap: 1rem; }
  .app-icon { width: 3rem; height: 3rem; border-radius: 0.85rem; }
  .shell { padding: 0 1.25rem 4rem; }
  h1 { font-size: var(--s-3); }
}

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

/* ── Brand lockup ──────────────────────────────────
   The mark is a Q whose gold tail crosses the ring — the same shape as a tap
   target, which is what MIQ builds. Colours come from tokens so it flips with
   the theme; the ring must never be the flat brand teal on a dark ground.
   Small-size favicons use a separate, heavier geometry (assets/brand/). */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--teal);
  text-decoration: none;
}

/* Short all-caps wordmarks need positive tracking. Negative tracking — which is
   right for large lowercase display type — makes three capitals look cramped. */
.brand span {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--s-2);
  letter-spacing: 0.06em;
  line-height: 1;
}

.mark { width: 1.6rem; height: 1.6rem; flex: none; }
.mark-ring { stroke: var(--teal); }
.mark-tail { stroke: var(--gold-fill); }
