/*
  The feature highlight, in the dashboard's language ("The Quiet Workbench",
  docs/dashboard-design.md in the Gist home repo): the sheet, the
  illustration on a raised mat, a small product label, a 22px title, a line
  of body text and one accent link. Light and dark follow the viewer's
  system theme, as the login page does; ?theme=dark|light overrides it.
  The tokens are the dashboard's (src/style/_ui-tokens.scss).
*/

:root {
  --sheet: #ffffff;
  --text: #1c1e24;
  --text-secondary: #636878;
  --text-tertiary: #7f8390;
  --hairline: rgba(0, 0, 0, 0.075);
  --accent: #1872ff;
  --accent-rgb: 24, 114, 255;
  --link: #0f62d9;
  --link-hover: #0b4fb3;
  --chip: #f0f1f3;

  /* Illustrations */
  --illus-page: #f5f6f8;
  --illus-card: #ffffff;
  --illus-edge: rgba(16, 24, 40, 0.12);
  --illus-line: #eceef1;
  --illus-strong: #d9dce2;
  --illus-soft: rgba(24, 114, 255, 0.1);
  --illus-faint: rgba(24, 114, 255, 0.3);
  --illus-knob: #ffffff;
  --illus-success: #16a34a;
  --illus-success-soft: rgba(22, 163, 74, 0.12);
  --illus-amber: #e09b00;
  --illus-amber-soft: rgba(224, 155, 0, 0.14);
  --illus-shadow: drop-shadow(0 1px 1px rgba(16, 24, 40, 0.04))
    drop-shadow(0 8px 20px rgba(16, 24, 40, 0.06));
  --illus-bot: #7c5cff;
  --illus-bot-soft: rgba(124, 92, 255, 0.12);
  --illus-scrim: rgba(16, 24, 40, 0.06);
  --illus-ink: #1c1e24;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --sheet: #111214;
    --text: #eeeff1;
    --text-secondary: #babdc5;
    --text-tertiary: #8f929c;
    --hairline: rgba(255, 255, 255, 0.12);
    --accent: #3d8bff;
    --accent-rgb: 61, 139, 255;
    --link: #7fb2ff;
    --link-hover: #a9cbff;
    --chip: rgba(255, 255, 255, 0.075);

    --illus-page: #17181b;
    --illus-card: #222327;
    --illus-edge: rgba(255, 255, 255, 0.1);
    --illus-line: rgba(255, 255, 255, 0.07);
    --illus-strong: rgba(255, 255, 255, 0.16);
    --illus-soft: rgba(61, 139, 255, 0.18);
    --illus-faint: rgba(61, 139, 255, 0.42);
    --illus-knob: #eeeff1;
    --illus-success: #4ade80;
    --illus-success-soft: rgba(74, 222, 128, 0.14);
    --illus-amber: #ffb21d;
    --illus-amber-soft: rgba(255, 178, 29, 0.16);
    --illus-shadow: none;
    --illus-bot: #a28bff;
    --illus-bot-soft: rgba(162, 139, 255, 0.18);
    --illus-scrim: rgba(0, 0, 0, 0.35);
    --illus-ink: #eeeff1;

    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --sheet: #111214;
  --text: #eeeff1;
  --text-secondary: #babdc5;
  --text-tertiary: #8f929c;
  --hairline: rgba(255, 255, 255, 0.12);
  --accent: #3d8bff;
  --accent-rgb: 61, 139, 255;
  --link: #7fb2ff;
  --link-hover: #a9cbff;
  --chip: rgba(255, 255, 255, 0.075);

  --illus-page: #17181b;
  --illus-card: #222327;
  --illus-edge: rgba(255, 255, 255, 0.1);
  --illus-line: rgba(255, 255, 255, 0.07);
  --illus-strong: rgba(255, 255, 255, 0.16);
  --illus-soft: rgba(61, 139, 255, 0.18);
  --illus-faint: rgba(61, 139, 255, 0.42);
  --illus-knob: #eeeff1;
  --illus-success: #4ade80;
  --illus-success-soft: rgba(74, 222, 128, 0.14);
  --illus-amber: #ffb21d;
  --illus-amber-soft: rgba(255, 178, 29, 0.16);
  --illus-shadow: none;
  --illus-bot: #a28bff;
  --illus-bot-soft: rgba(162, 139, 255, 0.18);
  --illus-scrim: rgba(0, 0, 0, 0.35);
  --illus-ink: #eeeff1;

  color-scheme: dark;
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--sheet);
  color: var(--text-secondary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue',
    Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 40px 32px;
}

/* One highlight ------------------------------------------------------------ */
.highlight {
  width: 100%;
  max-width: 520px;
  animation: highlight-in 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes highlight-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* The drawing on a raised mat. */
.highlight-art {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  margin: 0 0 28px;
  padding: 20px;
  overflow: hidden;
  background: var(--illus-page);
  border: 1px solid var(--hairline);
  border-radius: 16px;
}

.highlight-art svg {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
}

.highlight-product {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  margin: 0 0 12px;
  padding: 0 8px;
  background: var(--chip);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 22px;
}

.highlight-product::before {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  content: '';
}

.highlight-title {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.highlight-body {
  margin: 10px 0 0;
  text-wrap: pretty;
}

.highlight-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--link);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.highlight-cta::after {
  content: '→';
  transition: transform 160ms ease;
}

.highlight-cta:hover {
  color: var(--link-hover);
}

.highlight-cta:hover::after {
  transform: translateX(2px);
}

.highlight-cta:focus-visible {
  border-radius: 4px;
  outline: 2px solid rgba(var(--accent-rgb), 0.45);
  outline-offset: 3px;
}

/* Small frames: the drawing shrinks first. */
@media (max-height: 640px) {
  .highlight-art {
    aspect-ratio: 2 / 1;
    margin-bottom: 20px;
  }
}

/* Every highlight (?all), to review them --------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 40px 32px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 64px;
}

.gallery-header {
  grid-column: 1 / -1;
  color: var(--text-secondary);
  font-size: 13px;
}

.gallery-header strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}

.gallery .highlight {
  max-width: none;
  animation: none;
}

.gallery .highlight-title {
  font-size: 18px;
}

.gallery .highlight-body {
  font-size: 14px;
}

.gallery-meta {
  margin: 0 0 8px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.gallery-meta.is-today {
  color: var(--link);
  font-weight: 500;
}

/* The illustrations' palette ----------------------------------------------- */
.i-page {
  fill: var(--illus-card);
  stroke: var(--illus-edge);
}

.i-card {
  fill: var(--illus-card);
  stroke: var(--illus-edge);
  filter: var(--illus-shadow);
}

.i-back {
  fill: var(--illus-card);
  stroke: var(--illus-edge);
  opacity: 0.7;
}

.i-mat {
  fill: var(--illus-page);
}

.i-line {
  fill: var(--illus-line);
}

.i-strong {
  fill: var(--illus-strong);
}

.i-rule {
  stroke: var(--illus-line);
  stroke-width: 1;
  fill: none;
}

.i-soft {
  fill: var(--illus-soft);
}

.i-faint {
  fill: var(--illus-faint);
}

.i-accent {
  fill: var(--accent);
}

.i-accent-stroke {
  stroke: var(--accent);
  fill: none;
}

.i-link {
  stroke: var(--illus-strong);
  stroke-width: 1.5;
  fill: none;
}

.i-knob {
  fill: var(--illus-knob);
}

.i-success {
  fill: var(--illus-success);
}

.i-success-soft {
  fill: var(--illus-success-soft);
}

.i-amber {
  fill: var(--illus-amber);
}

.i-amber-soft {
  fill: var(--illus-amber-soft);
}

.i-white-stroke {
  stroke: var(--illus-knob);
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i-bot {
  fill: var(--illus-bot);
}

.i-bot-soft {
  fill: var(--illus-bot-soft);
}

.i-scrim {
  fill: var(--illus-scrim);
}

.i-ink {
  fill: var(--illus-ink);
  stroke: var(--illus-card);
  stroke-width: 1.25;
  stroke-linejoin: round;
}

.i-strong-stroke {
  stroke: var(--illus-strong);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.i-dashed {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  fill: none;
}

.i-dashed-neutral {
  stroke: var(--illus-strong);
  stroke-width: 1.25;
  stroke-dasharray: 3 3;
  fill: none;
}

.i-ring {
  stroke: var(--illus-card);
  stroke-width: 2;
}
