/*
 * TShirtGen policy and help pages.
 *
 * Same dark streetwear look as the app: the values below are the app's design
 * tokens (theme/tokens.ts). Depth comes from surface steps and borders, never
 * shadows. Lime is reserved for the one primary action (Open the app) and for
 * focus; links are underlined, not coloured, as in the app.
 *
 * Fonts are self-hosted Latin subsets (fonts/, SIL OFL: fonts/LICENSES.txt),
 * so visitors' browsers make no third-party font requests.
 */

@font-face { font-family: 'Anton'; font-weight: 400; font-display: swap; src: url('/policies/fonts/anton-400.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 400; font-display: swap; src: url('/policies/fonts/archivo-400.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 600; font-display: swap; src: url('/policies/fonts/archivo-600.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 700; font-display: swap; src: url('/policies/fonts/archivo-700.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url('/policies/fonts/jetbrains-mono-500.woff2') format('woff2'); }

:root {
  color-scheme: dark;

  --bg: #0A0A0B;
  --surface: #131316;
  --elevated: #1C1C21;
  --pressed: #26262D;
  --border-subtle: #232329;
  --border: #33333B;
  --border-strong: #4A4A55;
  --text: #F4F1EA;
  --text-secondary: #A8A6A0;
  --text-tertiary: #7C7B76;
  --on-accent: #0A0A0B;
  --accent: #CCFF00;
  --accent-pressed: #B3E600;
  --accent-muted: rgba(204, 255, 0, 0.12);
  --danger: #FF4D4D;
  --success: #34D399;

  --font-display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --font-body: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --radius-control: 8px;
  --radius-card: 16px;
  --gutter: 20px;
  --content: 720px;
  --wide: 1120px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

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

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
}

header .container {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: block;
  flex: none;
  line-height: 0;
  border-radius: 4px;
}

.brand img {
  display: block;
  height: 36px;
  width: auto;
}

header nav {
  flex: 1;
  min-width: 0;
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}

header nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-tertiary);
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}

header nav a:hover {
  color: var(--text);
  background: var(--surface);
}

header nav a[aria-current='page'] {
  color: var(--accent);
  background: var(--accent-muted);
}

.cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.15s;
}

.cta:hover {
  background: var(--accent-pressed);
}

/* ------------------------------------------------------------------------ */
/* Content                                                                  */
/* ------------------------------------------------------------------------ */

main {
  max-width: var(--content);
  margin: 0 auto;
  padding: 56px var(--gutter) 72px;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  margin: 0;
}

main h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 8vw, 64px);
  line-height: 1;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}

/* The "Last Updated" line under the title reads like the app's section labels. */
main > h1 + p {
  margin: 16px 0 40px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

main > h1 + p strong {
  color: var(--text-tertiary);
  font-weight: 500;
}

main h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 5vw, 32px);
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 56px 0 16px;
  scroll-margin-top: 88px;
}

main h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
  line-height: 26px;
  margin: 36px 0 12px;
  scroll-margin-top: 88px;
}

main h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 17px;
  line-height: 24px;
  margin: 28px 0 8px;
}

p {
  margin: 0 0 16px;
}

strong,
b {
  color: var(--text);
  font-weight: 600;
}

em {
  color: var(--text);
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  transition: text-decoration-color 0.15s;
}

a:hover {
  text-decoration-color: var(--accent);
}

ul,
ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

li {
  margin: 0 0 8px;
  padding-left: 4px;
}

li::marker {
  color: var(--text-tertiary);
}

ol > li::marker {
  font-family: var(--font-mono);
  font-size: 14px;
}

/* Lists whose items start with their own ✅ / ❌ mark. */
ul.x-list,
ul.check-list {
  list-style: none;
  padding-left: 0;
}

ul.x-list li,
ul.check-list li {
  padding-left: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 48px 0;
}

/* Tables become cards: surface fill, subtle border, mono column labels. */
table {
  width: 100%;
  margin: 24px 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--elevated);
}

td:first-child {
  color: var(--text);
}

tbody tr:last-child td {
  border-bottom: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 1px 6px;
}

blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-control);
  color: var(--text);
}

blockquote p:last-child {
  margin-bottom: 0;
}

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

footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg);
}

footer .container {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 40px var(--gutter) 48px;
  display: grid;
  gap: 20px;
  justify-items: start;
}

footer .brand img {
  height: 32px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.footer-links a {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 32px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-links a[aria-current='page'] {
  color: var(--accent);
}

.footer-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

/* ------------------------------------------------------------------------ */
/* Back to top                                                              */
/* ------------------------------------------------------------------------ */

.back-to-top {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, border-color 0.15s;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.back-to-top:hover {
  border-color: var(--accent);
}

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

@media (max-width: 767px) {
  header .container {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-top: 10px;
    padding-bottom: 6px;
  }

  .brand img {
    height: 32px;
  }

  .cta {
    margin-left: auto;
    min-height: 36px;
    padding: 0 14px;
    font-size: 14px;
  }

  /* Nav becomes a scrolling row of chips under the logo. */
  header nav {
    order: 3;
    flex-basis: 100%;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  header nav::-webkit-scrollbar {
    display: none;
  }

  main {
    padding-top: 36px;
  }

  main h2 {
    margin-top: 44px;
  }

  /* Wide tables scroll inside their card instead of the page. */
  table {
    display: block;
    overflow-x: auto;
  }

  th,
  td {
    padding: 12px;
    min-width: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

/* ------------------------------------------------------------------------ */
/* Print: plain black on white                                              */
/* ------------------------------------------------------------------------ */

@media print {
  :root {
    color-scheme: light;
  }

  body {
    background: #fff;
    color: #000;
  }

  header,
  footer,
  .back-to-top,
  .skip-link {
    display: none;
  }

  main {
    max-width: none;
    padding: 0;
  }

  h1,
  h2,
  h3,
  h4,
  strong,
  em,
  a,
  td:first-child,
  main > h1 + p,
  main > h1 + p strong {
    color: #000;
  }

  table,
  th,
  code,
  blockquote {
    background: none;
    color: #000;
  }
}
