/*
 * AFK AI site: the warm local workbench.
 * Paper ground, one warm material surface the app's windows sit on, near-black ink,
 * one dark primary action. Green is reserved for a qualified success and is not used here.
 * Fonts are self-hosted (OFL 1.1).
 */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin-var.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f8f7f3;
  --material: #eee8dc;
  --ink: #1f211d;
  --support: #5f625a;
  --separator: #d5d3ca;
  --focus: #435f8d;

  --display: "Bricolage Grotesque", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --text: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --machine: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(1.25rem, 3.4vw, 2.75rem);
  --wrap: 78rem;
  --measure: 36rem;
  --section: clamp(3.5rem, 8vw, 6.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  scrollbar-color: var(--support) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul,
figure {
  margin: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.machine {
  font-family: var(--machine);
  font-size: 0.86em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: 0.5rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  transform: translateY(-200%);
}

.skip:focus-visible {
  transform: none;
}

/* Buttons: one dark primary action per region. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.25rem;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 140ms ease-out;
}

.button:hover {
  background: #3a3d36;
}

.button-small {
  min-height: 44px;
  padding: 0.4rem 1rem;
  font-size: 0.9375rem;
}

/* Top bar ----------------------------------------------------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid var(--separator);
}

@supports (backdrop-filter: blur(1px)) {
  .top {
    backdrop-filter: blur(10px);
  }
}

.top-row {
  display: flex;
  align-items: center;
  gap: 1rem 2rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.top nav {
  display: flex;
  gap: 0 1.5rem;
  margin-left: auto;
}

.top nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--support);
  font-size: 0.9375rem;
  text-decoration: none;
}

.top nav a:hover {
  color: var(--ink);
}

@media (max-width: 47.99rem) {
  .top nav {
    display: none;
  }
  .top .button-small {
    margin-left: auto;
  }
}

/* Intro: the copy on the paper, the real window on the bench. -------- */

.intro {
  padding-block: clamp(2.5rem, 6vw, 5rem) var(--section);
  /* The bench bleeds to the page edge; never let its entrance cause sideways scroll. */
  overflow-x: clip;
}

.intro-grid {
  display: grid;
  gap: 2.5rem;
}

.intro-copy {
  display: grid;
  gap: 1.25rem;
  align-content: center;
  max-width: var(--measure);
}

h1 {
  font-family: var(--display);
  font-weight: 620;
  font-size: clamp(2.6rem, 5.6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 0.5rem;
}

.quiet-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}

.file {
  color: var(--support);
  font-size: 0.875rem;
}

/* A window is a real capture sitting on the warm material. */
.window {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.window picture {
  display: block;
  min-width: 0;
}

.window img {
  width: 100%;
  padding: clamp(0.6rem, 1.8vw, 1.5rem);
  background: var(--material);
  border-radius: 8px;
}

.window figcaption {
  max-width: var(--measure);
  color: var(--support);
  font-size: 0.875rem;
  line-height: 1.5;
  text-wrap: pretty;
}

@media (min-width: 64rem) {
  .intro-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(2rem, 4vw, 4rem);
    align-items: center;
  }

  /* The bench runs off the right edge of the page. */
  .window-lead img {
    width: calc(100% + (100vw - min(100vw - 2 * var(--gutter), var(--wrap))) / 2);
    max-width: none;
    padding: clamp(1.25rem, 2.6vw, 2.5rem);
    border-radius: 8px 0 0 8px;
  }
}

/* Sections ---------------------------------------------------------- */

.how,
.ships,
.before,
.data,
.next {
  padding-block: var(--section);
  border-top: 1px solid var(--separator);
}

h2 {
  font-family: var(--display);
  font-weight: 620;
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h3 {
  font-size: 1.125rem;
  line-height: 1.35;
  font-weight: 650;
}

.section-head {
  display: grid;
  gap: 1rem;
  max-width: 44rem;
}

.section-head p,
.section-note {
  color: var(--support);
  text-wrap: pretty;
}

.section-note {
  margin-top: 0.85rem;
  max-width: 24rem;
}

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.75rem;
  margin-block: clamp(2rem, 4vw, 3.25rem);
}

.steps li {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
}

.steps p {
  color: var(--support);
  text-wrap: pretty;
}

.pair {
  display: grid;
  gap: 1.75rem;
}

.capture-note {
  margin-top: 1.5rem;
  color: var(--support);
  font-size: 0.875rem;
}

@media (min-width: 48rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: clamp(1.25rem, 3vw, 2.5rem);
  }
}

@media (min-width: 64rem) {
  .pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(1.25rem, 3vw, 2.5rem);
  }
}

/* Two-column fact sections: the heading on the left, the facts on the right. */
.two-col {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 56rem) {
  .two-col {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    column-gap: clamp(2rem, 5vw, 5rem);
  }
}

.facts {
  display: grid;
  border-top: 1px solid var(--separator);
}

.facts div {
  display: grid;
  gap: 0.2rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--separator);
}

.facts dt {
  font-weight: 650;
}

.facts dd {
  color: var(--support);
  text-wrap: pretty;
}

@media (min-width: 40rem) {
  .facts div {
    grid-template-columns: 9rem 1fr;
    column-gap: 1.5rem;
  }
}

.before-body {
  display: grid;
  gap: 2rem;
}

.limits {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.limits li {
  color: var(--support);
  text-wrap: pretty;
}

.limits strong {
  display: block;
  color: var(--ink);
  font-weight: 650;
}

/* The one warm emphasis on the page: where the data goes. */
.data {
  background: var(--material);
  border-top: 0;
}

.boundary {
  display: grid;
  gap: 1.5rem;
}

.boundary > div {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
}

.boundary p {
  color: #4d5048;
  text-wrap: pretty;
}

@media (min-width: 40rem) {
  .boundary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2rem;
  }
}

.data + .next {
  border-top: 0;
}

/* Final ------------------------------------------------------------- */

.final {
  padding-block: var(--section);
  background: var(--ink);
  color: var(--paper);
}

.final ::selection {
  background: var(--paper);
  color: var(--ink);
}

.final :focus-visible {
  outline-color: #b9c7e2;
}

.final-row {
  display: grid;
  gap: 1.5rem;
  align-items: end;
}

.final h2 {
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
}

.final-action {
  display: grid;
  gap: 1rem;
  justify-items: start;
}

.final .button {
  background: var(--paper);
  color: var(--ink);
}

.final .button:hover {
  background: #e4e2dc;
}

.final-action p {
  color: #c8c9c2;
  font-size: 0.9375rem;
  max-width: 34rem;
}

@media (min-width: 56rem) {
  .final-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 3rem;
  }
}

/* Footer ------------------------------------------------------------ */

.foot {
  padding-block: 2rem;
  font-size: 0.9375rem;
  color: var(--support);
}

.foot-row {
  display: grid;
  gap: 0.75rem;
}

.foot-name {
  color: var(--ink);
  font-weight: 650;
}

.foot-name span {
  margin-left: 0.5rem;
  color: var(--support);
  font-weight: 400;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.foot nav a,
.maker a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (min-width: 56rem) {
  .foot-row {
    grid-template-columns: 1fr auto auto;
    align-items: center;
    column-gap: 2.5rem;
  }
}

/* Motion: the lead window slides onto the bench once. Visible without it. */
@media (prefers-reduced-motion: no-preference) {
  .window-lead img {
    animation: onto-bench 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@keyframes onto-bench {
  from {
    transform: translateX(2.5rem);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
