/* atfew — work-order ticket system. Tokens first. */
:root {
  --paper: #F7F8F6;
  --ink: #17202B;
  --ink-soft: #4A5562;
  --pen: #2B47B5;
  --canary: #F2D45C;
  --canary-soft: #FBF1C4;
  --stamp: #B8322A;
  --rule: #CDD3DA;
  --white: #FFFFFF;

  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
}
img { max-width: 100%; }
a { color: var(--pen); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--white); padding: 8px 12px; z-index: 10; }

/* Header */
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 14px; flex-wrap: wrap; }
.logo {
  font-family: var(--sans);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.logo-meaning { display: block; font-family: var(--sans); font-stretch: 100%; font-weight: 500; font-size: 0.78rem; letter-spacing: 0; color: var(--ink-soft); }
.site-nav { display: flex; gap: 20px; font-family: var(--sans); font-size: 0.95rem; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; }
.site-nav .nav-cta { color: var(--pen); font-weight: 700; }

/* Type */
h1, h2, h3 { font-family: var(--sans); line-height: 1.08; margin: 0; letter-spacing: -0.015em; }
h1 { font-weight: 800; font-stretch: 115%; font-size: clamp(2.4rem, 6.6vw, 4.6rem); }
h2 { font-weight: 750; font-stretch: 110%; font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-weight: 700; font-size: 1.15rem; line-height: 1.25; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: clamp(1.15rem, 2vw, 1.35rem); color: var(--ink-soft); max-width: 46ch; }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 22px;
  border: 2px solid var(--ink);
  background: var(--canary);
  color: var(--ink);
  text-decoration: none;
  border-radius: 3px;
}
.btn:hover { background: var(--ink); color: var(--canary); }
.btn-quiet { background: transparent; }

/* Hero */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); overflow-x: clip; } /* the stamp starts at 1.6x scale; keep it from widening the page on phones */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { margin-bottom: 22px; }
.hero .lede { margin-bottom: 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* The ticket: the one loud object on the page */
.ticket {
  position: relative;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: 22px 24px 24px 34px;
  box-shadow: 6px 6px 0 var(--ink);
  font-family: var(--sans);
  font-size: 0.98rem;
  transform: rotate(-1.2deg);
}
.ticket::before {
  /* tear-off stub */
  content: "";
  position: absolute;
  left: 16px; top: 10px; bottom: 10px;
  border-left: 2px dashed var(--rule);
}
.ticket dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; }
.ticket dt { color: var(--ink-soft); font-weight: 500; }
.ticket dd { margin: 0; font-weight: 600; }
.ticket .t-problem { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 1.1rem; }
.ticket .t-line { grid-column: 1 / -1; border-top: 1px solid var(--rule); }
.stamp {
  position: absolute;
  right: -10px; bottom: -22px;
  font-family: var(--sans);
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.05rem;
  color: var(--stamp);
  border: 3px solid var(--stamp);
  border-radius: 6px;
  padding: 6px 12px;
  transform: rotate(-9deg);
  background: rgba(255,255,255,0.86);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .stamp { animation: stamp-in 420ms cubic-bezier(.2,1.6,.4,1) 500ms both; }
  @keyframes stamp-in { from { opacity: 0; transform: rotate(-9deg) scale(1.6); } to { opacity: 1; transform: rotate(-9deg) scale(1); } }
}

/* Sections */
.section { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--rule); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px 48px; align-items: end; margin-bottom: 36px; }
.section-head p { margin: 0; color: var(--ink-soft); }

/* Menu */
.cat { margin-top: 44px; }
.cat:first-of-type { margin-top: 0; }
.cat-head { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.cat-head h3 { font-size: 1.3rem; font-stretch: 108%; }
.cat-head p { margin: 0; color: var(--ink-soft); font-size: 1rem; }
.fixes { list-style: none; margin: 0; padding: 0; }
.fix-row { border-bottom: 1.5px dashed var(--rule); }
.fix-row a {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 6px 32px;
  padding: 18px 8px;
  color: var(--ink);
  text-decoration: none;
}
.fix-row a:hover, .fix-row a:focus-visible { background: var(--canary-soft); }
.fix-problem { font-style: italic; }
.fix-name { font-family: var(--sans); font-weight: 700; }
.fix-name span { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.95rem; margin-top: 2px; }

/* Steps: a real sequence, so numbers carry meaning */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 16px; }
.steps li::before { content: counter(step); display: block; font-family: var(--sans); font-weight: 800; font-stretch: 125%; font-size: 2.6rem; line-height: 1; color: var(--pen); margin-bottom: 12px; }
.steps h3 { margin-bottom: 8px; }
.steps p { font-size: 1.02rem; color: var(--ink-soft); }

.proof-band { background: var(--ink); color: var(--paper); }
.proof-band .wrap { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 72px); }
.proof-band h2 { color: var(--paper); max-width: 22ch; margin-bottom: 18px; }
.proof-band p { color: #C9D0D8; }
.proof-band a { color: var(--canary); }

/* Item page */
.item-hero { padding: clamp(32px, 6vw, 72px) 0 clamp(28px, 4vw, 48px); }
.crumb { font-family: var(--sans); font-size: 0.95rem; margin-bottom: 22px; }
.crumb a { color: var(--ink-soft); }
.test-line { font-family: var(--sans); font-size: 1.05rem; color: var(--ink-soft); margin: -10px 0 18px; } /* the headline under test, so posts linking ?h= show it here too */
.test-line-brand { font-weight: 800; color: var(--ink); margin-right: 6px; }
.item-hero h1 { font-family: var(--serif); font-weight: 600; font-style: italic; font-stretch: 100%; letter-spacing: -0.01em; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.12; max-width: 24ch; margin-bottom: 20px; }
.item-hero .item-title { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; color: var(--pen); margin-bottom: 10px; }
.item-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); padding-bottom: clamp(48px, 7vw, 88px); }
.item-body h2 { font-size: 1.35rem; font-stretch: 105%; margin: 0 0 12px; }
.item-body section + section { margin-top: 34px; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 8px 0 8px 32px; position: relative; border-bottom: 1px solid var(--rule); }
.checks li::before { content: ""; position: absolute; left: 4px; top: 0.85em; width: 14px; height: 8px; border-left: 2.5px solid var(--pen); border-bottom: 2.5px solid var(--pen); transform: rotate(-45deg); }
.proof-card { position: relative; background: var(--white); border: 1.5px solid var(--ink); border-radius: 4px; padding: 20px 22px 26px; margin-top: 4px; }
.proof-card .stamp { position: static; display: inline-block; margin-bottom: 14px; transform: rotate(-3deg); font-size: 0.95rem; animation: none; }
.proof-card p { margin: 0; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; position: relative; padding: 10px 32px 10px 0; font-family: var(--sans); font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 8px; font-weight: 700; color: var(--pen); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }
.faq details p { margin: 0 0 14px; }
.note { font-size: 1rem; color: var(--ink-soft); border-left: 3px solid var(--canary); padding-left: 14px; }

/* Form */
.form-panel { background: var(--white); border: 1.5px solid var(--ink); border-radius: 4px; padding: clamp(20px, 3vw, 32px); box-shadow: 6px 6px 0 var(--canary); }
.form-panel h2 { margin-bottom: 8px; }
.form-panel > p { color: var(--ink-soft); font-size: 1rem; }
.field { margin-bottom: 18px; }
.field label, .field legend { display: block; font-family: var(--sans); font-weight: 600; font-size: 0.98rem; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=url], select, textarea {
  width: 100%;
  font: inherit;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 11px 12px;
  border: 1.5px solid var(--ink-soft);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--pen); outline: 2px solid var(--pen); outline-offset: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.hp { position: absolute; left: -9999px; }
.form-foot { font-size: 0.92rem; color: var(--ink-soft); margin: 14px 0 0; }

.start-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(28px, 5vw, 64px); padding-top: clamp(32px, 6vw, 72px); padding-bottom: clamp(48px, 7vw, 88px); align-items: start; }
.start-grid h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 18px; }

.prose { padding-top: clamp(32px, 6vw, 72px); padding-bottom: clamp(48px, 7vw, 88px); } /* keep .wrap side gutters */
.prose h1 { margin-bottom: 24px; max-width: 18ch; }
.prose h2 { margin: 40px 0 12px; font-size: 1.5rem; }
.effective { font-family: var(--sans); font-size: 0.95rem; color: var(--ink-soft); }
.meaning { font-family: var(--sans); font-size: clamp(1.2rem, 2.6vw, 1.7rem); font-weight: 500; line-height: 1.35; margin: 0 0 24px; }
.meaning b { font-weight: 800; color: var(--pen); }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 28px 0 40px; font-family: var(--sans); font-size: 0.92rem; color: var(--ink-soft); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-foot a { color: var(--ink-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* Small screens */
@media (max-width: 860px) {
  .hero-grid, .section-head, .item-body, .start-grid { grid-template-columns: 1fr; }
  .ticket { transform: rotate(-0.8deg); margin: 8px 10px 24px 0; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 620px) {
  .fix-row a { grid-template-columns: 1fr; padding: 16px 4px; }
  .two { grid-template-columns: 1fr; }
  .site-nav { gap: 16px; }
  .stamp { right: 4px; }
}
