/*
 * The landing page. Colors, fonts, radii and shadows are the webmail's and the
 * console's tokens (src/shared/styles/tokens.css), light and dark as the system
 * is; only the larger type sizes and the page layout are its own.
 */
:root {
  --page-w: 1120px;
  --gutter: 24px;
  --display: clamp(36px, 6vw, 60px);
  --title: clamp(26px, 3.4vw, 34px);
  --lead: clamp(17px, 2vw, 20px);
  --code-bg: #f3f5f7;
  --code-fg: #1d1d1f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --code-bg: #1b1d21;
    --code-fg: #e4e6eb;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--text-lg);
  line-height: 1.6;
}

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

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

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-hover);
  border-radius: 4px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--title);
}

h3 {
  font-size: var(--text-xl);
}

p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--page-w) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 12px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 700;
  font-size: var(--text-xl);
  text-decoration: none;
  white-space: nowrap;
}

.brand-light {
  font-weight: 500;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.brand-mark rect {
  fill: #0f766e;
}

.brand-mark path {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.site-nav a,
.header-link {
  color: var(--fg-muted);
  font-size: var(--text-md);
  font-weight: 500;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.site-nav a:hover,
.header-link:hover {
  color: var(--fg);
  background: var(--bg-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--text-lg);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* A <button> drawn as a .button: the same type and size as the links beside it. */
button.button {
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

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

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

.button-small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: var(--text-md);
}

/* Hero */

.hero {
  padding: 72px 0 40px;
}

.eyebrow {
  color: var(--accent-text);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: var(--display);
  letter-spacing: -0.025em;
}

/* The headline's two lines, as written: each its own line at every width. */
.hero-line {
  display: block;
}

.lead {
  margin-top: 20px;
  max-width: 44em;
  color: var(--fg-muted);
  font-size: var(--lead);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.fine-print {
  margin-top: 14px;
  color: var(--fg-subtle);
  font-size: var(--text-md);
}

/* Screenshots */

.shot {
  margin: 0;
}

.shot img {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: var(--bg-app);
}

.shot figcaption {
  margin-top: 12px;
  color: var(--fg-subtle);
  font-size: var(--text-sm);
}

.shot-hero {
  margin-top: 56px;
}

.shot-wide {
  margin-top: 48px;
}

/* Sections */

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-app);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-lead {
  margin-top: 14px;
  max-width: 46em;
  color: var(--fg-muted);
  font-size: var(--text-lg);
}

.note {
  margin-top: 20px;
  padding: 12px 16px;
  border-left: 3px solid var(--line-strong);
  color: var(--fg-muted);
  font-size: var(--text-md);
}

.aside {
  margin-top: 24px;
  max-width: 52em;
  color: var(--fg-muted);
  font-size: var(--text-md);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.split > div > p:not(.note) {
  margin-top: 14px;
  color: var(--fg-muted);
}

.split-wide {
  grid-template-columns: 1fr minmax(0, 440px);
  justify-content: space-between;
}

/* The consent page is a tall, narrow page: shown at about its own width. */
.split-wide .shot {
  justify-self: end;
  width: 100%;
}

/* The three interfaces: one card each, all alike */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 88px;
}

.card > p {
  margin-top: 8px;
  color: var(--fg-muted);
  font-size: var(--text-md);
}

.card-icon {
  width: 40px;
  height: 40px;
  padding: 8px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  fill: none;
  stroke: var(--accent-text);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-link {
  margin-top: auto;
  padding-top: 20px;
  font-weight: 600;
  font-size: var(--text-md);
}

.checks {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  font-size: var(--text-md);
}

.checks li {
  position: relative;
  padding: 5px 0 5px 26px;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.85em;
  width: 12px;
  height: 6px;
  border-left: 2px solid var(--accent-text);
  border-bottom: 2px solid var(--accent-text);
  transform: rotate(-45deg);
}

/* Numbered steps */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.split-wide .steps {
  margin-top: 24px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 48px;
  color: var(--fg-muted);
}

.steps li strong {
  color: var(--fg);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
  font-size: var(--text-md);
}

.steps .url {
  display: inline-block;
  margin-top: 6px;
}

/* Code */

.code-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 20px;
  margin-top: 36px;
  align-items: start;
}

.code {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--code-bg);
  overflow: hidden;
}

.code figcaption {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: var(--code-fg);
  font-size: 13px;
  line-height: 1.6;
}

.code pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  overflow-wrap: normal;
}

/* Use cases and security */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 48px;
  margin-top: 36px;
}

.item p {
  margin-top: 8px;
  color: var(--fg-muted);
  font-size: var(--text-md);
}

/* Pricing */

/* Three plans side by side, each as wide as the others; stacked below 900 px. */
.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
}

.plan .checks {
  margin-bottom: 24px;
}

.plan .button {
  margin-top: auto;
}

.price {
  margin-top: 8px;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.plan-text {
  margin: 18px 0 24px;
  color: var(--fg-muted);
  font-size: var(--text-md);
}

.price span {
  color: var(--fg-muted);
  font-size: var(--text-lg);
  font-weight: 500;
}

/* Contact Sales: a native modal dialog */

.contact {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
  overflow: auto;
  overscroll-behavior: contain;
}

.contact::backdrop {
  background: rgb(16 24 40 / 45%);
}

.contact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 0;
}

.contact-head h2 {
  font-size: var(--text-2xl);
}

.contact-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--fg-muted);
  cursor: pointer;
}

.contact-close:hover {
  background: var(--bg-hover);
  color: var(--fg);
}

.contact-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.contact-close:focus-visible,
.contact .button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Focused only so that it is read out (tabindex -1, never tabbed to): no ring, it is not a control. */
.contact-done-title:focus {
  outline: none;
}

.contact-form,
.contact-done {
  padding: 8px 24px 24px;
}

.contact-lead {
  color: var(--fg-muted);
  font-size: var(--text-md);
  margin-bottom: 8px;
}

.field {
  margin-top: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--text-md);
  font-weight: 600;
}

.optional {
  color: var(--fg-muted);
  font-weight: 400;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 16px; /* no zoom on focus on phones */
}

.field textarea {
  min-height: 132px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
}

.field [aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin-top: 6px;
  color: var(--danger);
  font-size: var(--text-sm);
}

/* The field people never see (a honeypot): off screen, not merely transparent. */
.contact-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-alert {
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger-strong);
  font-size: var(--text-md);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.contact-actions .button:disabled {
  opacity: 0.7;
  cursor: progress;
}

.contact-done p {
  color: var(--fg-muted);
}

.contact-done .contact-done-title {
  margin: 8px 0 6px;
  color: var(--fg);
  font-size: var(--text-xl);
  font-weight: 700;
}

.contact-done strong {
  color: var(--fg);
  overflow-wrap: anywhere;
}

/* Footer */

.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: var(--text-md);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}

.footer-brand {
  color: var(--fg);
  font-weight: 700;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer a {
  color: var(--fg-muted);
}

.footer-copy {
  margin-left: auto;
}

/* Narrower screens */

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

  .plans {
    grid-template-columns: minmax(0, 480px);
  }

  .split,
  .split-wide,
  .code-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
  }

  .site-nav {
    display: none;
  }

  .hero {
    padding: 48px 0 24px;
  }

  .section {
    padding: 56px 0;
  }

  .grid-2,
  .plans {
    grid-template-columns: 1fr;
  }

  /* The dialog as a sheet: the whole width and as tall as it needs. */
  .contact {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .contact-head,
  .contact-form,
  .contact-done {
    padding-left: 16px;
    padding-right: 16px;
  }

  .contact-actions .button {
    flex: 1 1 auto;
  }

  .card,
  .plan {
    padding: 22px;
  }

  .cta-row .button {
    flex: 1 1 auto;
  }

  .footer-copy {
    margin-left: 0;
  }
}

@media (max-width: 380px) {
  .header-link {
    display: none;
  }
}
