/* MDRender project site.
   Identity lifted from the console's own theme ("control room at night"):
   deep slate ink, brass signal accent, crimson shield, Iowan/Palatino serif. */

:root {
  color-scheme: dark;
  --ink: #0f1420;
  --surface: #161d2b;
  --surface-2: #1d2637;
  --line: #2a3446;
  --line-strong: #3b4863;
  --text: #e7eaf1;
  --muted: #98a4bb;
  --brass: #e0a44a;
  --brass-ink: #23190a;
  --brass-weak: rgba(224, 164, 74, 0.12);
  --crimson: #e94560;
  --ok: #6cc59a;
  --radius: 10px;
  --radius-sm: 7px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu,
    Cantarell, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--brass); text-underline-offset: 3px; }
a:hover { color: #f0bc6a; }

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- header ---------- */

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  flex-wrap: wrap;
}

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

.brand-mark { width: 26px; height: 26px; }

.brand-name {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

.head-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.head-nav a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.head-nav a:not(.btn):hover { color: var(--text); }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  background: var(--brass);
  color: var(--brass-ink);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brass);
}

.btn:hover {
  background: #f0bc6a;
  color: var(--brass-ink);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

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

.btn-small { padding: 0.38rem 0.9rem; font-size: 0.9rem; }

.cta-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

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

.hero {
  padding: 4.5rem 0 5rem;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 3.5rem;
  align-items: center;
}

.hero-copy h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: 0.005em;
  margin: 0 0 1.2rem;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 31em;
  margin: 0;
}

/* screenshot composition: browser frame with the phone overlapping its corner */

.hero-shot { position: relative; }

.hero-browser { margin: 0; }

.hero-phone {
  position: absolute;
  left: -3rem;
  bottom: -2.4rem;
  width: 13rem;
  margin: 0;
}

/* ---------- frames ---------- */

.frame {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0;
  max-width: 100%;
}

.frame img { border-top-left-radius: 0; border-top-right-radius: 0; }

.frame-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.85rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.dots { display: inline-flex; gap: 6px; }

.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
  display: inline-block;
}

.frame-url {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.12rem 0.6rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone {
  border-radius: 22px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
}

.phone img {
  border-radius: 16px;
  border: 1px solid var(--line);
}

figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.8rem 1rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.phone figcaption { display: none; }

/* ---------- section scaffolding ---------- */

.band {
  padding: 4.5rem 0;
  border-bottom: 1px solid var(--line);
}

.band > .wrap > h2,
.split-copy h2,
.run-grid h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  line-height: 1.2;
  margin: 0 0 1.6rem;
}

/* ---------- how it works ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.2rem;
}

.steps li {
  border-top: 1px solid var(--line-strong);
  padding-top: 1.1rem;
}

.step-num {
  font-family: var(--serif);
  font-size: 2.1rem;
  line-height: 1;
  color: var(--brass);
  display: block;
  margin-bottom: 0.7rem;
}

.steps h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

/* ---------- use cases ---------- */

.cases {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3rem;
}

.case {
  border-top: 1px solid var(--line);
  padding: 1.15rem 0 1.35rem;
}

.case dt { font-weight: 600; }

.case dd {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.97rem;
  max-width: 36em;
}

/* ---------- gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.2rem;
}

.gallery .frame:last-child { max-width: calc(50% - 1.1rem); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3.2rem;
  align-items: start;
}

.split-reverse .split-copy { order: 2; }
.split-reverse .split-shots { order: 1; }

.split-copy p { color: var(--muted); max-width: 38em; }
.split-copy strong { color: var(--text); }

.mini-steps {
  list-style: none;
  counter-reset: mini;
  margin: 1.6rem 0;
  padding: 0;
}

.mini-steps li {
  counter-increment: mini;
  position: relative;
  padding: 0.9rem 0 0.9rem 3rem;
  border-top: 1px solid var(--line);
}

.mini-steps li::before {
  content: counter(mini);
  position: absolute;
  left: 0;
  top: 0.8rem;
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--brass);
  width: 2rem;
}

.note {
  font-size: 0.93rem;
  border-left: 2px solid var(--line-strong);
  padding-left: 1rem;
  margin-top: 1.4rem;
}

.split-shot { margin-top: 0.5rem; }

.split-shots {
  display: grid;
  gap: 1.6rem;
  justify-items: start;
}

.split-shots .phone { width: 13rem; justify-self: end; }

#payments .split { align-items: center; }

/* ---------- run it ---------- */

.run-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3.2rem;
  align-items: start;
}

.run-grid p { color: var(--muted); max-width: 36em; margin: 0; }

.code {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  overflow-x: auto;
}

.code code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre;
}

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

.site-foot { padding: 2rem 0 2.6rem; }

.foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.foot-brand .brand-mark { width: 20px; height: 20px; }

.foot-nav { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; }

.foot-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.foot-nav a:hover { color: var(--text); }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero-grid,
  .split,
  .run-grid { grid-template-columns: minmax(0, 1fr); }

  .hero { padding: 3rem 0 4rem; }

  .hero-shot { margin-top: 1rem; }

  .hero-phone {
    position: static;
    width: 13rem;
    margin: -3.5rem 0 0 auto;
    margin-right: 1.2rem;
  }

  .split-reverse .split-copy { order: 0; }
  .split-reverse .split-shots { order: 0; }

  .steps { grid-template-columns: 1fr; gap: 1.6rem; }

  .split-shots .phone { justify-self: start; }
}

@media (max-width: 720px) {
  .cases { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .gallery .frame:last-child { max-width: none; grid-column: auto; }
  .head-nav { gap: 1rem; }
}

/* ---------- inner-page hero ---------- */

.hero-page { padding: 3.6rem 0 4.2rem; }

.hero-page .lede { font-size: 1.04rem; }

.cta-note {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 1rem 0 0;
  max-width: 34em;
}

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

/* ---------- pillars (index) ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.2rem;
}

.pillar {
  display: block;
  border-top: 1px solid var(--line-strong);
  padding-top: 1.1rem;
  text-decoration: none;
  color: inherit;
}

.pillar h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 0.55rem;
}

.pillar p {
  color: var(--muted);
  font-size: 0.96rem;
  margin: 0 0 0.9rem;
}

.pillar-link {
  color: var(--brass);
  font-size: 0.93rem;
  font-weight: 600;
}

.pillar:hover h3 { color: var(--brass); }

.pillar code { font-size: 0.85em; }

/* ---------- own-server band (index, server) ---------- */

.own-band {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 3.2rem;
  align-items: center;
}

.own-band p {
  color: var(--muted);
  max-width: 40em;
}

/* ---------- section lede ---------- */

.section-lede {
  color: var(--muted);
  max-width: 46em;
  margin: -0.6rem 0 1.8rem;
}

/* ---------- app page ---------- */

.app-hero-shot {
  display: flex;
  gap: 1.4rem;
  justify-content: center;
  align-items: flex-start;
}

.app-hero-shot .phone { width: 14rem; margin: 0; }

.app-hero-shot .hero-phone-static { margin-top: 1.6rem; }

.app-hero-shot img,
.app-shots img { width: 100%; }

.app-shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

.app-shots .phone { margin: 0; }

.app-shots figcaption { display: block; }

/* phones with captions under them */
.app-shots .phone figcaption,
.hero-phone figcaption { display: none; }

/* ---------- clients page ---------- */

.script-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
  margin-bottom: 1.8rem;
}

/* ---------- legal pages ---------- */

.legal {
  max-width: 46rem;
  padding-top: 3.4rem;
  padding-bottom: 4rem;
}

.legal h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 1.1rem;
}

.legal .lede {
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0 0 2.4rem;
}

.legal .lede strong { color: var(--text); }

.legal h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 2.1rem 0 0.7rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.legal p { margin: 0 0 1rem; }

.legal ul { margin: 0 0 1.2rem; padding-left: 1.3rem; }

.legal li { margin-bottom: 0.5rem; color: var(--muted); }

.legal li strong { color: var(--text); }

.legal p strong { color: var(--text); }

.legal-links {
  margin-top: 2.4rem !important;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- responsive additions ---------- */

@media (max-width: 980px) {
  .pillars { grid-template-columns: 1fr; }
  .own-band { grid-template-columns: 1fr; }
  .app-hero-shot .phone { width: 12.5rem; }
  .app-hero-shot .hero-phone-static { margin-top: 0; }
}

@media (max-width: 720px) {
  .app-shots { grid-template-columns: 1fr; }
  .app-shots .phone { max-width: 17rem; }
  .app-hero-shot .phone { width: auto; flex: 0 1 12.5rem; min-width: 0; }
  .script-grid { grid-template-columns: 1fr; }
}

/* phone as a span inside figure.shot */
.phone { display: block; }

.shot { margin: 0; }

.shot figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.8rem 0.3rem 0;
}

.app-shots .phone { width: 100%; }
