/* AdLinkt website layer (DECISIONS.md PV-6). Load it after dist/tokens.css.
   Hand-written: every value is a token from tokens.css, except the two media-query widths, which CSS cannot
   read from a variable (they are web-bp-tablet and web-bp-desktop). Night only: the website has no light theme.
   Rules and examples: artifact/project/website.md. */

/* ---------------------------------------------------------------- phone baseline
   The site is a scrolling document, so pull-to-refresh stays on. Never disable zoom. */

html {
  color-scheme: dark;
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a, button, summary, [role="button"] { touch-action: manipulation; }
button, summary, [role="button"], .web-button { -webkit-user-select: none; user-select: none; }
/* iOS zooms the page into any field under 16 px. */
input, select, textarea { font-size: max(16px, 1em); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--text); color: var(--ground); }

/* ---------------------------------------------------------------- page frame */

.web-page {
  --web-inset: max(clamp(var(--web-inset-min), 5vw, var(--web-inset-max)), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  width: min(100% - 2 * var(--web-inset), var(--web-max));
  margin-inline: auto;
}
.web-section { padding-block: var(--web-section); }
.web-rule { border-top: 1px solid var(--line); }

/* "Skip to content": hidden until it takes keyboard focus. */
.web-skip {
  position: absolute;
  left: max(16px, env(safe-area-inset-left, 0px));
  top: max(16px, env(safe-area-inset-top, 0px));
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-control);
  background: var(--control);
  box-shadow: var(--btn2-ring);
  color: var(--text);
  transform: translateY(-200%);
}
.web-skip:focus-visible { transform: none; }

/* Grids stack on phones, take two columns from web-bp-tablet and three from web-bp-desktop. */
.web-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--web-gap) var(--web-gap-wide); }
@media (min-width: 720px) { .web-grid-2, .web-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .web-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- statements */

.web-statement { margin: 0; text-wrap: balance; }
.web-lead { margin: 0; max-width: var(--web-lead-measure); color: var(--text-2); text-wrap: pretty; }

/* ---------------------------------------------------------------- surfaces
   Panels are square with one 45° cut at the top-right (web-cut). Only real objects get a panel. */

.web-panel {
  background: var(--raised);
  box-shadow: var(--raised-edge);
  padding: var(--pad);
  clip-path: polygon(0 0, calc(100% - var(--web-cut)) 0, 100% var(--web-cut), 100% 100%, 0 100%);
}
/* Full-bleed fields. Lime (the logo's) takes web-on-lime words; grey takes white words of 24 px and up only. */
.web-field-lime { background: var(--web-field-lime); color: var(--web-on-lime); }
.web-field-grey { background: var(--web-field-grey); color: var(--text); }

/* ---------------------------------------------------------------- actions
   Buttons and fields keep the app's radii so their focus rings stay whole. One lime button per view. */

.web-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--r-control);
  background: var(--accent);
  color: var(--on-accent);
  font: 500 17px/1.3 var(--font-sans);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-tint) ease;
}
.web-button:active { transform: scale(var(--scale-press-primary)); background: var(--accent-press); }
.web-button:focus-visible { outline-offset: 3px; }
.web-button-secondary {
  min-height: 48px;
  background: var(--control);
  color: var(--text);
  box-shadow: var(--btn2-ring);
}
.web-button-secondary:active { transform: scale(var(--scale-press)); background: var(--control); }
@media (hover: hover) and (pointer: fine) {
  .web-button:hover { background: var(--accent-hover); }
  .web-button-secondary:hover { background: var(--control-hover); }
}

/* Links in running text: never lime, never blue. */
.web-link, .web-prose a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-3);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
@media (hover: hover) and (pointer: fine) {
  .web-link:hover, .web-prose a:hover { text-decoration-color: var(--text); }
}

/* ---------------------------------------------------------------- articles
   Type comes from the article roles in tokens.css, which also style plain h1, h2, h3, p, li, blockquote,
   figcaption and caption inside .web-prose. This adds only spacing, lists, quotes, tables and media. */

.web-prose { max-width: var(--web-measure); }
.web-prose > * { margin-block: 0; }
.web-prose > * + * { margin-top: 1em; }
.web-prose > h2, .web-prose > h3 { margin-top: 1.6em; text-wrap: balance; }
.web-prose > h2 + *, .web-prose > h3 + * { margin-top: 0.5em; }
.web-prose ul, .web-prose ol { padding-left: 1.25em; }
.web-prose li + li { margin-top: 0.4em; }
.web-prose li::marker { color: var(--text-3); }
.web-prose blockquote { margin-inline: 0; padding-left: 1.25em; color: var(--text-2); }
.web-prose strong { font-weight: 600; }
.web-prose img, .web-prose video { display: block; max-width: 100%; height: auto; }
.web-prose figure { margin-inline: 0; }
.web-prose figcaption { margin-top: 8px; color: var(--text-2); }
.web-prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }
.web-prose .web-table { overflow-x: auto; }
.web-prose table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.web-prose th, .web-prose td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.web-prose th { color: var(--text-2); font-weight: 500; }
.web-prose caption { caption-side: bottom; padding-top: 8px; color: var(--text-2); text-align: left; }
