@font-face {
  font-family: 'Sofia Sans';
  src: url('/assets/fonts/sofia-sans.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: optional;
}
@font-face {
  font-family: 'Sofia Sans Extra Condensed';
  src: url('/assets/fonts/sofia-sans-extra-condensed.woff2') format('woff2');
  font-weight: 800 900;
  font-style: normal;
  font-display: optional;
}

/* Metric-matched fallbacks: text keeps its size while the brand fonts load, so the page does not jump. */
@font-face {
  font-family: 'Sofia Sans Fallback';
  src: local('Arial'), local('ArialMT'), local('Helvetica'), local('Roboto');
  font-weight: 100 600;
  size-adjust: 97.6%;
  ascent-override: 92.2%;
  descent-override: 30.7%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Sofia Sans Fallback';
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'), local('Roboto Bold');
  font-weight: 700 900;
  size-adjust: 93.4%;
  ascent-override: 96.4%;
  descent-override: 32.1%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Sofia Sans Extra Condensed Fallback';
  src: local('Arial Narrow Bold'), local('ArialNarrow-Bold'), local('Arial Narrow');
  size-adjust: 73.9%;
  ascent-override: 121.8%;
  descent-override: 40.6%;
  line-gap-override: 0%;
}

:root {
  --signal: #FF5A1F;
  --ink: #15161B;
  --concrete: #F1F2F4;
  --white: #FFFFFF;
  --text-2: #2E3038;
  --muted: #5A5D66;
  --line: #E1E3E8;
  --line-dark: #3A3C45;
  --orange-text: #C2410C;
  --orange-soft: #FFF1E8;
  --c-scratch: #FFC21A;
  --c-roblox: #7A45F0;
  --c-roblox-text: #5B21B6;
  --c-web: #13A9CC;
  --c-prog: #A6E22E;
  --text-2-dark: #C9CBD2;

  --font-display: 'Sofia Sans Extra Condensed', 'Sofia Sans Extra Condensed Fallback', 'Arial Narrow', sans-serif;
  --font-body: 'Sofia Sans', 'Sofia Sans Fallback', sans-serif;

  --border: 3px solid var(--ink);
  --border-thin: 2px solid var(--ink);
  --shadow: 8px 8px 0 var(--ink);
  --cut: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);

  --accent: var(--signal);
  --accent-fg: var(--ink);
  --header-h: 76px;
  --header-offset: 0px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--concrete);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.5;
}

a { color: var(--ink); transition: color 0.18s ease; }
a:hover, a:focus-visible { color: var(--orange-text); }

img { max-width: 100%; height: auto; display: block; }
p, li, td, dd { overflow-wrap: break-word; }

button { font-family: inherit; cursor: pointer; }

h1, h2, h3, .d {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.9;
  margin: 0;
  overflow-wrap: break-word;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.mono { font-family: var(--font-body); }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 30px 10px 22px;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 22px;
  text-decoration: none;
  border: none;
  clip-path: var(--cut);
  background: var(--accent);
  color: var(--accent-fg);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--white); }
.btn:focus-visible { outline-offset: 4px; }
.btn:active { transform: scale(0.97); }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-secondary {
  background: var(--ink);
  color: var(--white);
}
.btn-secondary:hover, .btn-secondary:focus-visible { background: var(--accent); color: var(--accent-fg); }

.btn-outline {
  background: var(--white);
  color: var(--ink);
  border: var(--border-thin);
  clip-path: none;
  font-family: var(--font-body);
  text-transform: none;
  font-weight: 700;
  font-size: 16px;
  padding: 8px 18px;
}

.card {
  background: var(--white);
  border: var(--border);
  box-shadow: none;
  transform: none;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}
.card[aria-pressed="true"], .card.is-selected {
  box-shadow: var(--shadow);
  transform: translate(-4px, -4px);
}

.chip {
  min-height: 44px;
  padding: 8px 18px;
  border: var(--border-thin);
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
  font-size: 18px;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}

.tab {
  min-height: 48px;
  padding: 8px 18px;
  border: var(--border);
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
  font-size: 16px;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.tab[aria-selected="true"] {
  background: var(--ink);
  color: var(--white);
}

details.accordion {
  border-top: var(--border-thin);
  padding: 18px 0;
}
details.accordion summary {
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  min-height: 44px;
  list-style: none;
}
details.accordion summary::-webkit-details-marker { display: none; }
details.accordion p { font-size: 19px; line-height: 1.5; margin: 10px 0 0; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 17px; font-weight: 700; }
.field input, .field select {
  min-height: 48px;
  border: var(--border-thin);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  padding: 0 14px;
}
.field .error-message { color: var(--orange-text); font-size: 15px; font-weight: 700; }
.field input.error, .field select.error { border-color: var(--orange-text); }

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-bar {
  background: var(--ink);
  color: var(--white);
}
.status-bar .container {
  padding-top: 12px;
  padding-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  align-items: center;
  font-size: 17px;
}
.status-bar .status-tag {
  background: var(--signal);
  color: var(--ink);
  font-weight: 800;
  padding: 2px 10px;
}
.status-bar .status-text { font-weight: 700; }
.status-bar a { color: var(--white); font-weight: 800; margin-left: auto; text-decoration: none; }

.site-header {
  background: var(--white);
  border-bottom: var(--border-thin);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.site-header.is-pinned {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  box-shadow: 0 4px 0 rgba(21, 22, 27, 0.06);
}
.site-header.is-pinned.is-hidden { transform: translateY(-100%); }
.site-header .container {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-wordmark { display: flex; flex-direction: column; line-height: 0.9; }
.brand-wordmark .eyebrow { font-family: var(--font-body); font-size: 10px; letter-spacing: 0.32em; font-weight: 700; }
.brand-wordmark .name { font-family: var(--font-display); font-size: 30px; font-weight: 900; text-transform: uppercase; }

.nav-links { display: flex; gap: 22px; font-weight: 600; font-size: 16px; flex-grow: 1; }
.nav-links a { text-decoration: none; white-space: nowrap; }

.category-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border: var(--border-thin);
  padding: 8px 12px;
  font-weight: 700;
  font-size: 15px;
  min-height: 44px;
  color: var(--ink);
  background: var(--white);
}
.category-pill .swatch { width: 12px; height: 12px; display: inline-block; flex: 0 0 auto; }
.category-pill { max-width: 240px; }
.category-pill .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.header-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }

.hamburger-btn {
  display: none;
  width: 44px;
  height: 44px;
  border: var(--border-thin);
  background: var(--white);
  align-items: center;
  justify-content: center;
}
.hamburger-btn span, .hamburger-btn span::before, .hamburger-btn span::after {
  content: "";
  display: block;
  width: 22px;
  height: 3px;
  background: var(--ink);
  position: relative;
}
.hamburger-btn span::before { position: absolute; top: -7px; }
.hamburger-btn span::after { position: absolute; top: 7px; }

.mobile-menu {
  display: flex;
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 50;
  padding: 24px;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}
.mobile-menu[hidden] { display: none; }
html.menu-open, html.menu-open body { overflow: hidden; }
.mobile-menu { overflow-y: auto; overscroll-behavior: contain; }
.mobile-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.mobile-menu .close-btn { align-self: flex-end; width: 44px; height: 44px; border: var(--border-thin); background: var(--white); }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 24px;
  text-decoration: none;
  color: var(--ink);
  border-top: var(--border-thin);
  padding: 16px 0;
  transition: color 0.18s ease, padding-left 0.18s ease;
}
.mobile-menu a:hover, .mobile-menu a:focus-visible { color: var(--orange-text); padding-left: 6px; }

.site-footer { background: var(--ink); color: var(--text-2-dark); }
.site-footer .container {
  padding: 48px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 32px;
  font-size: 17px;
}
.site-footer .footer-title { font-family: var(--font-display); font-size: 34px; color: var(--white); text-transform: uppercase; }
.site-footer a { color: var(--text-2-dark); text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--white); }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col b { color: var(--white); }

.perforated { border-top: 3px dashed var(--ink); }

/* The full nav plus actions needs ~1240px, so the header collapses earlier than the rest of the layout. */
@media (max-width: 1240px) {
  .nav-links { display: none; }
  .hamburger-btn { display: flex; flex: 0 0 auto; }
  .header-actions { justify-content: flex-end; min-width: 0; }
  .site-header .container { gap: 16px; }
}
@media (max-width: 860px) {
  .header-actions { margin-left: 0; flex: 1 1 auto; }
  .header-actions .btn { display: none; }
  .category-pill { font-size: 13px; padding: 6px 10px; min-width: 0; max-width: 150px; }
  .brand-wordmark .name { font-size: 24px; }
  .site-header .container { gap: 12px; }
}

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.doc-card { background: var(--white); border: var(--border-thin); display: flex; flex-direction: column; }
.doc-card .doc-band { height: 8px; background: var(--doc-color, var(--signal)); border-bottom: var(--border-thin); }
.doc-card .doc-body { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.doc-card .doc-title { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: 28px; line-height: 0.95; }
.doc-card .doc-desc { font-size: 16px; line-height: 1.45; color: var(--text-2); flex: 1; }
.doc-card .doc-actions { display: flex; border-top: var(--border-thin); }
.doc-card .doc-actions a { flex: 1 1 0; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 15px; text-decoration: none; padding: 8px 10px; }
.doc-card .doc-actions a + a { border-left: var(--border-thin); }
.doc-card .doc-actions a.view { background: var(--white); color: var(--ink); }
.doc-card .doc-actions a.download { background: var(--ink); color: var(--white); }
.doc-card .doc-actions a.view:hover, .doc-card .doc-actions a.view:focus-visible { background: var(--concrete); }
.doc-card .doc-actions a.download:hover, .doc-card .doc-actions a.download:focus-visible { background: var(--text-2); color: var(--white); }
.doc-card .doc-meta { font-size: 14px; color: var(--muted); }

.more-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; font-size: 17px; }

/* Touch targets: at least 44px high on phones and tablets. */
@media (max-width: 860px) {
  .footer-col { gap: 0; }
  .footer-col a { display: flex; align-items: center; min-height: 44px; }
  .status-bar a { display: inline-flex; align-items: center; min-height: 44px; }
  .status-bar .container { padding-top: 4px; padding-bottom: 8px; gap: 0 12px; font-size: 15px; line-height: 1.35; }
  /* Tag and call to action share the first row; the status text takes the full second row. */
  .status-bar a { order: 2; }
  .status-bar .status-text { order: 3; flex-basis: 100%; }
}
