/*
 * Watercooler homepage. Plain CSS, no build step.
 *
 * Light mode is the "paper" theme of the administration area
 * (apps/web/src/app/admin/admin-shell.component.ts). Dark mode is the office
 * HUD (apps/web/src/styles.css). The teal is the app icon's plate, from the
 * `teal` ramp in tools/office-art/generate.mjs.
 */

:root {
  color-scheme: light dark;

  --bg: #f4f1ea;
  --surface: #fffdf8;
  --raised: #ebe4d6;
  --ink: #1c1915;
  --muted: #5c564c;
  --line: #d6d0c4;
  --line-strong: #c4bbaa;
  --link: #1c4f8a;
  --focus: #1c4f8a;
  --accent: #1a565a;
  --accent-ink: #ffffff;
  --accent-hover: #123e44;
  --secondary: #ebe4d6;
  --secondary-ink: #1c1915;
  --placeholder-bg: #fff1c7;
  --placeholder-ink: #3d2910;
  --placeholder-line: #8a5a12;
  --shadow: 0 10px 24px rgb(28 25 21 / 12%);

  --font:
    'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system,
    BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --radius: 16px;
  --measure: 44rem;
  --page: 70rem;
  --gutter: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a;
    --surface: #1b1f27;
    --raised: #232833;
    --ink: #f4f6f8;
    --muted: #b4bdc8;
    --line: rgb(255 255 255 / 12%);
    --line-strong: rgb(255 255 255 / 22%);
    --link: #c9d7ff;
    --focus: #d5e2ff;
    --accent: #70c4b8;
    --accent-ink: #10281b;
    --accent-hover: #9cf0c8;
    --secondary: #232833;
    --secondary-ink: #f4f6f8;
    --placeholder-bg: #2c2308;
    --placeholder-ink: #ffe08a;
    --placeholder-line: #ffe08a;
    --shadow: 0 14px 34px rgb(0 0 0 / 34%), inset 0 1px 0 rgb(255 255 255 / 8%);
  }
}

@media (min-width: 40rem) {
  :root {
    --gutter: 1.5rem;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font);
  overflow-wrap: break-word;
}

img,
svg {
  display: block;
  max-inline-size: 100%;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

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

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

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.45rem, 1.2rem + 1.2vw, 2rem);
  font-weight: 680;
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 650;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.05em 0.3em;
  border-radius: 4px;
  background: var(--raised);
}

/* Skip link: off screen until focused. */
.skip-link {
  position: absolute;
  inset-inline-start: 0.75rem;
  inset-block-start: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: 0.75rem;
}

.wrap {
  inline-size: 100%;
  max-inline-size: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */

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

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding-block: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-inline-end: auto;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand svg {
  inline-size: 2rem;
  block-size: 2rem;
  image-rendering: pixelated;
}

/* On a phone the nav takes its own row under the brand and the button. */
.site-nav {
  order: 3;
  inline-size: 100%;
}

@media (min-width: 48rem) {
  .site-nav {
    order: 0;
    inline-size: auto;
  }
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.35rem;
  color: var(--ink);
  font-weight: 550;
  text-decoration: none;
}

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

/* Buttons */

.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.button.secondary {
  border-color: var(--line-strong);
  background: var(--secondary);
  color: var(--secondary-ink);
}

.button.secondary:hover {
  border-color: var(--ink);
}

.button.small {
  padding: 0.5rem 0.95rem;
  font-size: 0.95rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1.5rem 0;
}

/* Sections */

main {
  display: block;
}

.section {
  padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem);
}

.section + .section {
  border-block-start: 1px solid var(--line);
}

.section-intro {
  max-inline-size: var(--measure);
  margin-block-end: 2rem;
  color: var(--muted);
  font-size: 1.075rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Hero */

.hero .wrap {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 56rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 3rem;
  }
}

.lede {
  max-inline-size: 36rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.scene {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

/*
 * Product loops. The width, height and aspect ratio reserve the 16:9 box
 * before the poster arrives, so nothing below moves. The background matches
 * the office floor, which is what the poster shows first.
 */
.demo {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #c89e70;
}

/*
 * With reduced motion the video's only source does not match, so nothing is
 * downloaded, and the poster is shown as a plain image instead. A video with
 * no source would otherwise draw disabled controls, or an error in Firefox.
 */
.demo-still {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .demo-motion {
    display: none;
  }

  .demo-still {
    display: block;
  }
}

.scene figcaption {
  padding: 0.6rem 0.9rem;
  border-block-start: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Steps and cards */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 1.25rem 1.25rem 1.1rem 3.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  inset-block-start: 1.15rem;
  inset-inline-start: 1.1rem;
  display: grid;
  place-items: center;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.95rem;
}

.steps p,
.card p {
  margin: 0;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* Features shown as a loop: video and copy side by side, alternating sides. */

.showcase {
  display: grid;
  gap: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  margin-block-end: clamp(2.5rem, 2rem + 2vw, 3.5rem);
}

.feature {
  display: grid;
  gap: 1.25rem;
  align-items: center;
}

@media (min-width: 56rem) {
  .feature {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 3rem;
  }

  .feature:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  }

  .feature:nth-child(even) .feature-media {
    order: 2;
  }
}

.feature-media {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature-text h3 {
  font-size: 1.35rem;
}

.feature-text p {
  max-inline-size: 32rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.feature-text p:last-child {
  margin-block-end: 0;
}

.cards-title {
  margin-block-end: 1rem;
}

.note {
  max-inline-size: var(--measure);
  margin-block-start: 1.5rem;
  color: var(--muted);
}

/* Two columns that stack on a phone */

.split {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 48rem) {
  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

.ticks {
  padding-inline-start: 1.25rem;
}

.ticks li + li {
  margin-block-start: 0.4rem;
}

/* Pricing */

.price {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  margin-block-end: 1.5rem;
}

.price-box {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.price-box .amount {
  display: block;
  margin-block: 0.25rem 0.5rem;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

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

.table-scroll {
  max-inline-size: 100%;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  inline-size: 100%;
  max-inline-size: 30rem;
}

caption {
  text-align: start;
}

th,
td {
  padding: 0.5rem 0.75rem;
  border-block-end: 1px solid var(--line);
  text-align: start;
}

th {
  font-weight: 650;
}

td.number,
th.number {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* FAQ */

.faq {
  max-inline-size: var(--measure);
}

.faq details {
  border-block-end: 1px solid var(--line);
}

.faq details:first-of-type {
  border-block-start: 1px solid var(--line);
}

.faq summary {
  padding-block: 1rem;
  font-weight: 650;
  cursor: pointer;
}

.faq summary:hover {
  color: var(--link);
}

.faq details > :not(summary) {
  color: var(--muted);
}

.faq details > p:last-child {
  margin-block-end: 1.25rem;
}

/* Closing call to action */

.closing {
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.closing p {
  max-inline-size: var(--measure);
  color: var(--muted);
}

/* Placeholders the owner must fill. Visible on purpose. */

.placeholder {
  padding: 0.05em 0.35em;
  border: 1px dashed var(--placeholder-line);
  border-radius: 4px;
  background: var(--placeholder-bg);
  color: var(--placeholder-ink);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Legal pages */

.prose {
  max-inline-size: var(--measure);
  padding-block: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}

.prose h2 {
  margin-block-start: 2.75rem;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--line);
  font-size: 1.45rem;
}

.prose h3 {
  margin-block-start: 1.75rem;
}

.prose li + li {
  margin-block-start: 0.35rem;
}

.updated {
  color: var(--muted);
}

.toc {
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.toc h2 {
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  font-size: 1rem;
}

.toc ol {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.15rem 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.facts dt {
  margin-block-start: 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.facts dt:first-child {
  margin-block-start: 0;
}

.facts dd {
  margin: 0;
}

@media (min-width: 40rem) {
  .facts {
    grid-template-columns: 9rem minmax(0, 1fr);
  }

  .facts dt,
  .facts dt:first-child {
    margin-block-start: 0.15rem;
  }
}

.callout {
  padding: 1rem 1.25rem;
  border-inline-start: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
}

.callout p:last-child {
  margin-block-end: 0;
}

/* 404 */

.not-found {
  padding-block: clamp(3rem, 2rem + 6vw, 7rem);
  text-align: center;
}

.not-found svg {
  inline-size: 6rem;
  block-size: 6rem;
  margin: 0 auto 1.5rem;
  image-rendering: pixelated;
}

.not-found .actions {
  justify-content: center;
}

/* Footer */

.site-footer {
  border-block-start: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  padding-block: 1.5rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer p {
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
