/*
  DMN Master — shared style for the website.

  The colours are the app's own (RetroPalette and Studio in the app's
  source, shared with BPMN Master): the Terracotta theme by day, the Dark
  theme at night, following the visitor's system setting. Shapes on the page
  borrow the notation the app draws: a decision table with its name tab and
  hit-policy column, input-data capsules, a dot grid.
*/

:root {
  color-scheme: light dark;

  /* Terracotta theme */
  --canvas: #e5d2bc;
  --surface: #f1e6d7;
  --card: #fcf7ef;
  --paper: #fffcf6;
  --field: #ede1d1;
  --ink: #33231a;
  --muted: #7a5c46;
  --hairline: #d8c3a9;
  --accent: #b5410e;
  --accent-soft: rgba(181, 65, 14, 0.14);
  --on-accent: #fff8ef;
  --chrome: #b4471a;
  --on-chrome: #fff4e6;
  --chrome-pill: rgba(255, 244, 230, 0.16);
  --chrome-pill-strong: rgba(255, 244, 230, 0.26);
  --band: #33231a;
  --on-band: #fbf3e8;
  --dot: rgba(51, 35, 26, 0.2);
  --hero-top: #d9642c;
  --hero-bottom: #a63a0b;
  --on-hero: #fff4e6;
  --hero-kicker: #3a1c0c;
  --hero-dot: rgba(255, 244, 230, 0.14);
  --shape-shadow: 0 6px 18px rgba(90, 58, 32, 0.16);
  --shape-drop: 0 5px 9px rgba(90, 58, 32, 0.16);
  --panel-shadow: 0 3px 10px rgba(58, 30, 14, 0.1);
  --success: #3f7f55;

  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, system-ui, "SF Pro Text", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark theme: espresso with cream lines */
    --canvas: #17130f;
    --surface: #1c1814;
    --card: #272019;
    --paper: #262019;
    --field: #1a1612;
    --ink: #eee2cf;
    --muted: #a8937d;
    --hairline: #3b3129;
    --accent: #e2753c;
    --accent-soft: rgba(226, 117, 60, 0.2);
    --on-accent: #1c120b;
    --chrome: #1c1814;
    --on-chrome: #eee2cf;
    --chrome-pill: rgba(238, 226, 207, 0.08);
    --chrome-pill-strong: rgba(238, 226, 207, 0.15);
    --band: #2d261f;
    --on-band: #eee2cf;
    --dot: rgba(238, 226, 207, 0.14);
    --hero-top: #3a2a20;
    --hero-bottom: #1a120d;
    --on-hero: #f1e6d4;
    --hero-kicker: #e8854a;
    --hero-dot: rgba(238, 226, 207, 0.08);
    --shape-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    --shape-drop: 0 5px 9px rgba(0, 0, 0, 0.45);
    --panel-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    --success: #74c08c;
  }
}

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

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

body {
  margin: 0;
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--canvas);
  /* The canvas dot grid */
  background-image: radial-gradient(circle, var(--dot) 1.1px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  text-decoration-thickness: 2px;
}

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

kbd {
  font-family: var(--rounded);
  font-size: 0.8em;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--field);
  border: 1px solid var(--hairline);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- Window bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--chrome);
  color: var(--on-chrome);
  padding-top: env(safe-area-inset-top);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  .bar {
    box-shadow: 0 1px 0 var(--hairline);
  }
}

.bar-inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: var(--rounded);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.nav a {
  color: inherit;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  opacity: 0.88;
}

.nav a:hover {
  background: var(--chrome-pill);
  opacity: 1;
}

.nav a[aria-current="page"] {
  background: var(--chrome-pill-strong);
  font-weight: 650;
  opacity: 1;
}

@media (max-width: 520px) {
  .brand span {
    display: none;
  }

  .nav a {
    padding: 6px 10px;
  }
}

/* ---------------------------------------------------------------- Documents */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 24px;
}

/* A page title drawn as a DMN decision table: the name in a tab on top, the
   hit-policy letter heading the dark first column. */
.dtable {
  margin-bottom: 28px;
  filter: drop-shadow(var(--shape-drop));
}

.dtable-name {
  width: fit-content;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  padding: 3px 14px 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.dtable-body {
  display: flex;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 0 3px 3px 3px;
}

.dtable-hit {
  flex: 0 0 38px;
  background: var(--band);
  color: var(--on-band);
  font-family: var(--rounded);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  padding-top: 12px;
}

.dtable-main {
  padding: 22px 24px 24px;
  display: flex;
  gap: 18px;
  align-items: center;
}

.dtable-main picture {
  flex-shrink: 0;
}

.dtable-main img {
  width: 76px;
  height: 76px;
  border-radius: 17px;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.dtable h1 {
  font-family: var(--rounded);
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}

.dtable p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 520px) {
  .dtable-main {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 18px 20px;
  }

  .dtable h1 {
    font-size: 26px;
  }
}

/* Section headers, as in the app's side panels: small, spaced capitals. */
.label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 32px 4px 10px;
}

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}

.card h2,
.card h3 {
  font-size: 16.5px;
  line-height: 1.35;
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}

.card p,
.card li {
  font-size: 15px;
}

.card p {
  margin: 0.5em 0;
}

.card p:last-child {
  margin-bottom: 0;
}

.card ul {
  margin: 0.5em 0 0;
  padding-left: 1.2em;
}

.card li + li {
  margin-top: 0.25em;
}

.card .meta {
  color: var(--muted);
  font-size: 13.5px;
}

.short {
  border-left: 4px solid var(--accent);
}

.toc {
  columns: 2 220px;
  column-gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li {
  break-inside: avoid;
  font-size: 15px;
  padding: 3px 0;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

.updated {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 4px 0;
}

/* ---------------------------------------------------------------- Footer */

.foot {
  max-width: 760px;
  margin: 24px auto 0;
  padding: 24px 16px calc(40px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  border-top: 1px solid var(--hairline);
}

.foot p {
  margin: 4px 0;
}

.foot nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 10px;
}

.foot nav a {
  font-weight: 500;
  text-decoration: none;
}

.foot nav a:hover {
  text-decoration: underline;
}

.motto {
  font-family: var(--rounded);
  font-weight: 600;
}

/* ---------------------------------------------------------------- Landing page */

.hero {
  color: var(--on-hero);
  background-color: var(--hero-bottom);
  background-image: radial-gradient(circle, var(--hero-dot) 1.1px, transparent 1.6px),
    linear-gradient(180deg, var(--hero-top), var(--hero-bottom));
  background-size: 22px 22px, 100% 100%;
  overflow: hidden;
}

.hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 16px 0;
  text-align: center;
}

.flow {
  display: inline-block;
  width: 228px;
  height: auto;
  margin-bottom: 22px;
  filter: drop-shadow(0 3px 8px rgba(58, 18, 4, 0.25));
}

.kicker {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hero-kicker);
  margin: 0 0 10px;
}

.hero h1 {
  font-family: var(--rounded);
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 auto 16px;
  max-width: 820px;
}

.hero .lede {
  font-size: clamp(16px, 2.2vw, 19px);
  max-width: 640px;
  margin: 0 auto 26px;
  opacity: 0.92;
}

.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--rounded);
  font-weight: 700;
  font-size: 16px;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
}

.button.primary {
  background: var(--on-hero);
  color: var(--hero-bottom);
  box-shadow: 0 4px 14px rgba(58, 18, 4, 0.25);
}

@media (prefers-color-scheme: dark) {
  .button.primary {
    background: var(--accent);
    color: var(--on-accent);
  }
}

.button.ghost {
  color: var(--on-hero);
  background: rgba(255, 244, 230, 0.14);
  border: 1px solid rgba(255, 244, 230, 0.35);
}

.button.solid {
  background: var(--accent);
  color: var(--on-accent);
}

.button:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.requires {
  font-size: 13.5px;
  opacity: 0.8;
  margin: 14px 0 0;
}

.devices {
  display: block;
  width: min(1000px, 100%);
  margin: 34px auto -6px;
}

.wide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 64px 0 8px;
}

.feature.flip .feature-text {
  order: 2;
}

.feature-art {
  display: flex;
  justify-content: center;
}

.feature-art img.phone {
  width: 320px;
}

/* The iPhone Duo's outer screen is wider than a phone's. */
.feature-art img.duo {
  width: 400px;
}

.feature-art img.tablet {
  width: 430px;
}

.feature-art img.laptop {
  width: 640px;
}

.feature .label {
  margin: 0 0 8px;
  color: var(--accent);
}

.feature h2 {
  font-family: var(--rounded);
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}

.feature p {
  margin: 0 0 14px;
  font-size: 17px;
}

/* List bullets drawn as small input-data capsules. */
.inputs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.inputs li {
  position: relative;
  padding-left: 28px;
  margin: 8px 0;
  font-size: 16px;
}

.inputs li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 17px;
  height: 10px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: var(--paper);
}

@media (max-width: 760px) {
  .feature {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 48px;
  }

  .feature.flip .feature-text {
    order: 0;
  }

  .feature-art img.phone {
    width: 260px;
  }

  .feature-art img.duo {
    width: 320px;
  }
}

.section-head {
  text-align: center;
  padding: 72px 0 24px;
}

.section-head h2 {
  font-family: var(--rounded);
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 6px 0 0;
}

.section-head .label {
  margin: 0;
  color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.grid .card {
  margin: 0;
  padding: 18px 20px 20px;
  box-shadow: var(--panel-shadow);
}

.grid .card h3 {
  font-size: 17px;
  margin: 10px 0 6px;
}

.grid .card p {
  margin: 0;
  color: var(--ink);
}

.glyph {
  width: 34px;
  height: 34px;
  display: block;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.closing {
  text-align: center;
  padding: 72px 0 40px;
}

.closing picture img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: var(--shape-shadow);
}

.closing h2 {
  font-family: var(--rounded);
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -0.015em;
  margin: 16px 0 6px;
}

.closing p {
  color: var(--muted);
  margin: 0 0 22px;
}

/* SVG notation shapes on the page take the theme's colours. */
.shape-fill {
  fill: var(--paper);
}

.shape-ink {
  stroke: var(--ink);
}

.shape-accent {
  stroke: var(--accent);
}
