@font-face { font-family: "Atkinson Hyperlegible Next"; src: url(fonts/atkinson-next.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(fonts/newsreader.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--ground); color: var(--ink); font: 18px/1.6 "Atkinson Hyperlegible Next", system-ui, sans-serif; }
img { max-width: 100%; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: #fff; padding: 12px; z-index: 10; }

/* header */
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 84px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--mark); font-weight: 700; font-size: 21px; }
.brand svg { width: 38px; height: 38px; }
.brand span { color: var(--ink); }
.desk-nav { display: flex; align-items: center; gap: 6px; }
.desk-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 18px; padding: 12px 16px; border-radius: var(--r-btn); min-height: 48px; display: inline-flex; align-items: center; }
.desk-nav a:not(.btn):hover { background: var(--surface-soft); }
.menu-btn { display: none; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px; font: 600 18px "Atkinson Hyperlegible Next", sans-serif; color: var(--ink); background: var(--surface); border: var(--btn-border); border-radius: var(--r-btn); box-shadow: var(--shadow-btn); cursor: pointer; }
.menu-btn svg { width: 24px; height: 24px; }
.phone-menu { display: grid; gap: 8px; padding-bottom: 16px; }
.phone-menu[hidden] { display: none; }
.phone-menu a { display: flex; align-items: center; min-height: 60px; padding: 0 20px; background: var(--surface); border: var(--btn-border); border-radius: var(--r-btn); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 20px; }
@media (max-width: 820px) { .desk-nav { display: none; } .menu-btn { display: inline-flex; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 26px; border-radius: var(--r-btn); font-weight: 700; font-size: 18px; text-decoration: none; transition: transform .12s, background .12s; }
.btn:hover { transform: translateY(-1px); }
.btn-sm { min-height: 48px; padding: 0 20px; margin-left: 8px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-soft); color: var(--ink); border: var(--btn-border); }
.badge { display: inline-flex; align-items: center; min-height: 48px; }
.badge img { height: 48px; width: auto; display: block; }

/* hero */
.hero { text-align: var(--hero-align); padding-top: var(--hero-pad); padding-bottom: 40px; }
.hero h1 { font-family: var(--display); font-weight: var(--display-weight); font-size: clamp(40px, 6.4vw, 66px); line-height: 1.06; letter-spacing: var(--display-track); margin: 0 auto 20px; max-width: 15ch; }
.hero .lede { font-size: 21px; color: var(--ink-soft); max-width: 40em; margin: 0 auto 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: var(--hero-justify); }

/* chooser */
.chooser { margin-bottom: 24px; }
.chooser-title { font-size: 24px; margin: 0 0 16px; text-align: var(--hero-align); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; justify-content: center; min-height: 104px; padding: 20px 24px; background: var(--tile-bg); border: var(--card-border); border-radius: var(--r-tile); box-shadow: var(--shadow-card); text-decoration: none; color: var(--ink); transition: transform .12s, border-color .12s; }
.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.tile-name { font-size: 22px; font-weight: 700; }
.tile-sub { font-size: 16px; color: var(--ink-soft); }

/* sections */
.section { padding-top: var(--section-gap); }
.section > h2, .panel h2 { font-family: var(--display); font-weight: var(--display-weight); font-size: clamp(32px, 4vw, 40px); letter-spacing: var(--display-track); margin: 0 0 6px; }
.section-sub { color: var(--ink-soft); margin: 0 0 8px; font-size: 19px; }
.group-h { font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 36px 0 14px; }
.cards { display: flex; flex-wrap: wrap; gap: 24px; }

.app, .project { flex: 1 1 min(320px, 100%); min-width: 0; background: var(--surface); border: var(--card-border); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.app-wide { flex-basis: 100%; }
.app-top { display: flex; gap: 18px; align-items: center; }
.icon { width: 72px; height: 72px; border-radius: 18px; flex: none; }
.app h3, .project h4 { font-size: 25px; margin: 0; line-height: 1.2; }
.chips { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .pill { font-size: 14px; font-weight: 700; background: var(--pill); color: var(--ink-tag); padding: 4px 12px; border-radius: 999px; }
.pill { align-self: flex-start; }
.tagline { margin: 4px 0 0; font-size: 19px; color: var(--ink); }
.know { margin: 0; font-size: 16px; color: var(--ink-soft); background: var(--know-bg); border-left: 4px solid var(--know-rule); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.app-actions { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.project p { margin: 0; color: var(--ink-soft); }
.sample-note { font-size: 15px !important; font-style: italic; }
details { border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; font-weight: 700; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
details p { margin-top: 8px !important; }

.panel { background: var(--panel-bg); color: var(--panel-ink); border: var(--card-border); border-radius: var(--r-panel); box-shadow: var(--shadow-card); padding: 40px; }
.panel p { max-width: 44em; font-size: 19px; }
.panel h2 { color: var(--panel-ink); }
.help { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.help-actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* support page message box */
.msg-form { flex: 1 1 100%; display: grid; gap: 8px; max-width: 640px; padding-top: 8px; border-top: 1px solid var(--line); }
.msg-form[hidden] { display: none; }
.msg-form label { font-weight: 700; font-size: 18px; margin-top: 12px; }
.msg-form input, .msg-form select, .msg-form textarea { width: 100%; min-height: 54px; padding: 12px 16px; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--ink-soft); border-radius: var(--r-btn); }
.msg-form textarea { resize: vertical; line-height: 1.5; }
.msg-form .help-actions { margin-top: 12px; }
.msg-form button[disabled] { opacity: .6; cursor: default; }
.msg-trap { position: absolute; left: -9999px; }
.panel .msg-note { font-size: 16px; color: var(--ink-soft); margin: 8px 0 0; }
.panel .msg-status { font-size: 18px; font-weight: 700; margin: 4px 0 0; min-height: 1.6em; }
.panel .msg-done { flex: 1 1 100%; font-weight: 700; margin: 0; }

.site-footer { margin-top: var(--section-gap); border-top: 1px solid var(--line); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 24px; padding-bottom: 32px; font-size: 16px; color: var(--ink-soft); }
.footer-row nav { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-row a { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; }

@media (max-width: 600px) {
  .panel { padding: 28px 22px; }
  .app, .project { padding: 22px; }
  .hero-actions .btn, .help-actions .btn { width: 100%; }
}

/* trademark notice after the brand name (header + footer) */
.brand .tm { font-size: 0.5em; font-weight: 600; vertical-align: super; line-height: 0; margin-left: 1px; letter-spacing: 0; }

/* header search link (search.js turns it into a dialog; without JavaScript it goes to /search/) */
.search-link { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; min-height: 48px; padding: 0 14px; border-radius: var(--r-btn); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 18px; }
.search-link:hover { background: var(--surface-soft); }
.search-link svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 820px) {
  .search-link { min-width: 52px; min-height: 52px; justify-content: center; padding: 0; }
  .search-link .search-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}
/* phones: a compact icon, tighter gaps and a slimmer Menu button so the logo keeps its full width; under 380px there is
   no room at all, so Search moves into the phone menu */
.phone-menu .menu-search { display: none; margin-left: 0; }
@media (max-width: 420px) { .header-row { gap: 6px; } .header-row > .search-link { min-width: 44px; } .menu-btn { padding: 0 12px; } }
@media (max-width: 379px) { .header-row > .search-link { display: none; } .phone-menu .menu-search { display: flex; } }
