/* One plain stylesheet for every page. No framework. Colors are set once here and changed for dark mode below. */

:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #1b1f24;
  --muted: #5b6470;
  --border: #d5d9df;
  --link: #1f5fbf;
  --button-bg: #1f5fbf;
  --button-text: #ffffff;
  --button-hover: #184c99;
  --notice-bg: #eaf3ea;
  --notice-border: #9cc79c;
  --alert-bg: #fbeceb;
  --alert-border: #e0a3a0;
  --focus: #f0a500;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --surface: #1e2227;
    --text: #e6e8eb;
    --muted: #a0a8b3;
    --border: #3a4049;
    --link: #8ab4f8;
    --button-bg: #3b74d1;
    --button-text: #ffffff;
    --button-hover: #4c84e0;
    --notice-bg: #1d2d1f;
    --notice-border: #3f6b44;
    --alert-bg: #33201f;
    --alert-border: #7a3f3b;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1rem;
}

main.wrap {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

/* Header and footer */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

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

.brand img {
  border-radius: 7px;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}

.site-footer p {
  margin: 0.5rem 0 0;
}

/* Text */

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 1.5rem 0 0.75rem;
}

h1 {
  font-size: 1.6rem;
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.2rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
  max-width: 70ch;
}

li {
  margin-bottom: 0.4rem;
}

li > ul,
li > ol {
  margin-top: 0.4rem;
}

a {
  color: var(--link);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.45;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Messages after an action */

[role="status"],
[role="alert"] {
  padding: 0.6rem 0.9rem;
  border: 1px solid;
  border-radius: 6px;
  max-width: none;
}

[role="status"] {
  background: var(--notice-bg);
  border-color: var(--notice-border);
}

[role="alert"] {
  background: var(--alert-bg);
  border-color: var(--alert-border);
}

/* Tables. Wide tables scroll inside their own box, so the page itself never scrolls sideways. */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface);
  font-weight: 600;
}

/* Forms and buttons */

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

td label {
  font-weight: normal;
}

input[type="text"],
input[type="email"],
input[type="password"],
input:not([type]),
select,
textarea {
  width: 100%;
  max-width: 32rem;
  padding: 0.45rem 0.55rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

td input[type="text"],
td select {
  max-width: none;
  min-width: 10rem;
}

button,
input[type="submit"] {
  display: inline-block;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--button-text);
  background: var(--button-bg);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
  background: var(--button-hover);
}

form.button_to {
  display: inline-block;
  margin: 0.25rem 0.5rem 0.25rem 0;
}

td form.button_to {
  margin: 0;
}

td button {
  padding: 0.3rem 0.7rem;
  font-size: 0.9rem;
}

@media (max-width: 40rem) {
  h1 {
    font-size: 1.35rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input:not([type]),
  select,
  textarea {
    max-width: none;
  }

  button,
  input[type="submit"] {
    width: 100%;
  }

  form.button_to {
    display: block;
    margin-right: 0;
  }

  td button {
    width: auto;
  }
}

/* /admin: the Sign out button at the top right, next to the heading. */
.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-top form.button_to {
  margin: 0;
}

.admin-top button {
  width: auto;
}

/* On phones, tables marked .stack show each row as a block, with each cell's column name above its value. */
@media (max-width: 40rem) {
  table.stack,
  .stack tbody,
  .stack tr,
  .stack td {
    display: block;
    width: 100%;
  }

  .stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .stack tr {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0;
  }

  .stack td {
    border: none;
    padding: 0.3rem 0.75rem;
  }

  .stack td:empty {
    display: none;
  }

  .stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
  }

  .stack td select,
  .stack td input[type="text"] {
    min-width: 0;
  }
}

/* Landing page ("/"). Laid out like the Gmail sidebar's home page: hero text with a drawn example on the right, then
   sections. Uses the same color tokens as every other page, so dark mode follows. */

.home .hero {
  display: grid;
  gap: 2rem;
  align-items: start;
  margin: 1rem 0 3rem;
}

.home .hero h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.home .subhead {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.get-started {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
  text-decoration: none;
}

.get-started:hover {
  background: var(--button-hover);
}

.hero-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.home h2 {
  font-size: 1.4rem;
  margin: 0 0 1rem;
}

.home > section {
  margin-bottom: 3rem;
}

@media (min-width: 52rem) {
  .home .hero {
    grid-template-columns: 1fr 21rem;
    gap: 3rem;
    margin-top: 2rem;
  }

  .home .hero h1 {
    font-size: 2.6rem;
  }
}

/* The drawn example: a Webflow submission, the HubSpot contact it fills, and the row in the log. */
.flow {
  margin: 0;
  width: 100%;
  max-width: 21rem;
  justify-self: center;
  font-size: 0.875rem;
}

.flow p {
  margin: 0;
}

.flow-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 2px 10px rgba(27, 31, 36, 0.08);
  overflow: hidden;
}

.flow-app {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 500;
}

.flow-tag {
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}

.flow-title {
  padding: 0.75rem 1rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.flow-sub {
  padding: 0 1rem 0.6rem;
  color: var(--muted);
}

.flow dl {
  margin: 0;
  padding: 0 1rem 0.75rem;
}

.flow dl div {
  margin-bottom: 0.4rem;
}

.flow dt {
  font-size: 0.75rem;
  color: var(--muted);
}

.flow dd {
  margin: 0;
}

.flow-card section {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
}

.flow-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.flow-pages {
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-pages li {
  margin: 0 0 0.2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

.flow-pages span {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--muted);
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.5rem;
  color: var(--muted);
}

.flow-arrow {
  font-size: 1.2rem;
  color: var(--link);
}

.flow .flow-log {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.6rem;
  margin-top: 0.75rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--notice-border);
  border-radius: 8px;
  background: var(--notice-bg);
  font-size: 0.8rem;
}

.flow-log-label {
  flex-basis: 100%;
  font-weight: 600;
}

.flow-status {
  font-weight: 600;
}

.flow figcaption {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* How it works: three numbered steps, side by side on wide screens. */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: none;
  display: grid;
  gap: 1rem;
}

.steps li {
  counter-increment: step;
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  margin-bottom: 0.5rem;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
}

.steps strong,
.points strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 1.05rem;
}

/* Small drawings at the top of each step. They use the page colors, so they follow dark mode. */
.steps li {
  display: flex;
  flex-direction: column;
}

.steps .step-art {
  order: -1;
  display: block;
  width: 100%;
  height: auto;
  max-height: 120px;
  margin-bottom: 0.75rem;
}

.step-art .art-card { fill: var(--bg); stroke: var(--border); stroke-width: 1.5; }
.step-art .art-field { fill: var(--surface); stroke: var(--border); }
.step-art .art-link { stroke: var(--button-bg); stroke-width: 2.5; fill: none; }
.step-art .art-dot { fill: var(--button-bg); }
.step-art .art-ok { fill: #2e7d32; }
.step-art .art-tick { stroke: #ffffff; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.step-art .art-tick-sm { stroke-width: 2; }
.step-art .art-log { fill: var(--notice-bg); stroke: var(--notice-border); }
.step-art .art-badge { fill: #2e7d32; }
.step-art .art-badge-text { fill: #ffffff; font: 600 10px system-ui, sans-serif; }
.step-art .art-label { fill: var(--text); font: 600 14px system-ui, sans-serif; }
.step-art .art-small { fill: var(--muted); font: 10px system-ui, sans-serif; }

/* Icons at the top of the Why it exists and What you get cards. Red tint for problems, blue for features. */
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.6rem;
  border-radius: 10px;
}

.card-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-icon-feature { background: color-mix(in srgb, var(--button-bg) 14%, transparent); color: var(--button-bg); }
.card-icon-problem { background: color-mix(in srgb, #c62828 13%, transparent); color: var(--muted); }
.card-icon .hot { stroke: #c62828; }
.card-icon .hot-fill { fill: #c62828; stroke: none; }

/* Why it exists and What you get: cards, two across on wide screens. */
.points {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: none;
  display: grid;
  gap: 1rem;
}

.points li {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

@media (min-width: 52rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .points {
    grid-template-columns: repeat(2, 1fr);
  }
}

.faq h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.4rem;
}

.cta {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.cta p:last-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0;
}
