/* Hatsembly support site.
   Grayscale like the app (apps/product-foundry/DESIGN.md): the hat is the only color.
   One family, Archivo; headlines use its expanded width, body its normal width. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin-var.woff2") format("woff2");
}

:root {
  --ink: #303030;
  --ink-deep: #1a1a1a;
  --ink-muted: #616161;
  --hairline: #c9cccf;
  --tile-border: #e3e3e3;
  --surface: #ffffff;
  --floor: #f1f1f1;
  --surface-hover: #fafafa;
  --link: #005bd3;
  --success: #0c5132;
  --success-bg: #ebf7f0;
  --critical: #8e1f0b;
  --critical-bg: #fff0f0;
  --button-under: #b5b5b5;

  --font: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --measure: 68ch;
  --page: 1180px;
  --gutter: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e3e3e3;
    --ink-deep: #ffffff;
    --ink-muted: #a8a8a8;
    --hairline: #4a4a4a;
    --tile-border: #3a3a3a;
    --surface: #1f1f1f;
    --floor: #171717;
    --surface-hover: #2a2a2a;
    --link: #7fb2ff;
    --success: #7fd6a4;
    --success-bg: #143324;
    --critical: #ff9b8a;
    --critical-bg: #3a1610;
    --button-under: #111111;
  }
}

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  font-stretch: 100%;
}

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

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

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus { left: var(--gutter); top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Type ---------- */

h1, h2, h3 {
  color: var(--ink-deep);
  font-weight: 700;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  letter-spacing: -0.02em;
}

h2 {
  font-stretch: 118%;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  letter-spacing: -0.01em;
}

h3 {
  font-stretch: 108%;
  font-size: 1.12rem;
  line-height: 1.25;
}

p { margin: 0; }
p + p { margin-top: 0.9em; }

.lede {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink);
  max-width: 46ch;
}

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

/* ---------- Buttons (app style: white, hairline, one ink primary last) ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--button-under);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  width: auto;
}
.button:hover { background: var(--surface-hover); }

.button.primary {
  background: var(--ink-deep);
  border-color: var(--ink-deep);
  color: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 0 rgba(0, 0, 0, 0.1);
}
.button.primary:hover { background: var(--ink); border-color: var(--ink); }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--tile-border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-deep);
  text-decoration: none;
  font-weight: 800;
  font-stretch: 125%;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--tile-border);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.site-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a:hover { background: var(--floor); }
.site-nav a[aria-current="page"] {
  background: var(--floor);
  font-weight: 700;
  color: var(--ink-deep);
}

/* ---------- Home: hero ---------- */

.hero {
  padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px);
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-copy > * + * { margin-top: 24px; }
.hero-art {
  border-radius: 12px;
  border: 1px solid var(--tile-border);
  overflow: hidden;
  max-width: 460px;
  justify-self: end;
}

.status-note {
  font-size: 0.95rem;
  color: var(--ink-muted);
}

/* ---------- Home: sections ---------- */

.band { padding: clamp(48px, 7vw, 88px) 0; }
.band.floor { background: var(--floor); }

.band-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px 48px;
  align-items: end;
  margin-bottom: 40px;
}
.band-head p { color: var(--ink-muted); max-width: 52ch; }

/* The four stations are a real sequence, so they are numbered. */
.line {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  counter-reset: station;
  border-top: 2px solid var(--ink-deep);
}
.line li {
  counter-increment: station;
  padding: 20px 24px 8px 0;
}
.line li + li { padding-left: 24px; border-left: 1px solid var(--tile-border); }
.line li::before {
  content: counter(station);
  display: block;
  font-stretch: 125%;
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--ink-deep);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
.line h3 { margin-bottom: 8px; }
.line p { font-size: 0.97rem; color: var(--ink-muted); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
}
.split > div > * + * { margin-top: 16px; }

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hairline);
}
.facts li {
  display: grid;
  grid-template-columns: minmax(130px, 0.6fr) minmax(0, 1.4fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.97rem;
}
.facts strong { color: var(--ink-deep); font-weight: 700; }

.closing .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.closing h2 { max-width: 24ch; }

/* ---------- Support pages: reading column + contents aside ---------- */

.page-head {
  padding: clamp(36px, 6vw, 64px) 0 clamp(24px, 4vw, 40px);
  border-bottom: 1px solid var(--tile-border);
}
.page-head .wrap > * + * { margin-top: 16px; }
.page-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }

.doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 64px;
  padding-top: 40px;
  padding-bottom: 80px;
}

.doc-body { max-width: var(--measure); }
.doc-body h2 {
  font-size: 1.35rem;
  margin-top: 48px;
  margin-bottom: 14px;
  scroll-margin-top: 24px;
}
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { margin-top: 28px; margin-bottom: 8px; scroll-margin-top: 24px; }
.doc-body ul,
.doc-body ol { padding-left: 1.3em; margin: 0.9em 0 0; }
.doc-body li + li { margin-top: 0.45em; }
.doc-body p + ul,
.doc-body ul + p,
.doc-body ol + p { margin-top: 0.9em; }

.doc-aside {
  position: sticky;
  top: 24px;
  align-self: start;
  font-size: 0.93rem;
}
.doc-aside h2 {
  font-size: 0.93rem;
  font-stretch: 100%;
  margin-bottom: 10px;
}
.doc-aside ol,
.doc-aside ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--tile-border);
}
.doc-aside li + li { margin-top: 6px; }
.doc-aside a { color: var(--ink-muted); text-decoration: none; }
.doc-aside a:hover { color: var(--ink-deep); text-decoration: underline; }
.doc-aside .aside-box {
  margin-top: 28px;
  padding: 16px;
  border-radius: 12px;
  background: var(--floor);
}
.doc-aside .aside-box p + .actions { margin-top: 12px; }

/* Setup steps: numbered, because they are done in order. */
.steps {
  list-style: none;
  padding: 0 !important;
  counter-reset: step;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 0 48px;
  margin-top: 22px !important;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-stretch: 112%;
  font-size: 0.95rem;
  color: var(--ink-deep);
}

/* FAQ */
.qa {
  border-top: 1px solid var(--hairline);
  margin-top: 16px;
}
.qa details { border-bottom: 1px solid var(--hairline); }
.qa summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 32px 16px 0;
  position: relative;
  font-weight: 700;
  color: var(--ink-deep);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.15s ease;
}
.qa details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.qa details > div { padding: 0 0 18px; }

/* Contact form */
.form { display: grid; gap: 18px; max-width: 560px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; color: var(--ink-deep); }
.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--link) 25%, transparent);
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice {
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 600;
  margin-bottom: 24px;
  max-width: 560px;
}
.notice.ok { background: var(--success-bg); color: var(--success); }
.notice.err { background: var(--critical-bg); color: var(--critical); }
.notice[hidden] { display: none; }

.updated { color: var(--ink-muted); font-size: 0.95rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--tile-border);
  padding: 32px 0 40px;
  font-size: 0.93rem;
  color: var(--ink-muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.site-footer a { color: var(--ink-muted); }
.site-footer a:hover { color: var(--ink-deep); }

/* ---------- Narrow screens ---------- */

@media (max-width: 1023px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .doc-aside { position: static; order: -1; }
  .doc-aside nav { display: none; }
  .doc-aside .aside-box { margin-top: 0; }
  .line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .line li:nth-child(3) { padding-left: 0; border-left: 0; }
  .line li:nth-child(n + 3) { border-top: 1px solid var(--tile-border); margin-top: 8px; }
}

@media (max-width: 767px) {
  body { font-size: 16px; }
  .hero .wrap,
  .band-head,
  .split { grid-template-columns: minmax(0, 1fr); }
  .hero-art { justify-self: start; max-width: 320px; }
  .line { grid-template-columns: minmax(0, 1fr); }
  .line li,
  .line li + li { padding: 20px 0 8px; border-left: 0; }
  .line li + li { border-top: 1px solid var(--tile-border); }
  .facts li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .form .row { grid-template-columns: minmax(0, 1fr); }
  .form .actions .button,
  .closing .actions .button { width: 100%; }
  .closing .actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
