/*
 * Insta Job policy pages (privacy, terms, cookies, accessibility, service).
 * Served under a strict CSP: this file is the only styling, no inline styles.
 * Manrope is not loaded here, so a system font stack is used.
 *
 * Contrast (WCAG 2.2 AA needs 4.5:1 for text, 3:1 for focus indicators),
 * computed with the WCAG relative-luminance formula:
 *   on --bg #0e0f11:      text 17.00, muted 7.87, link 9.17, accent 7.99
 *   on --surface #17181c: text 15.73, muted 7.28, link 8.48, accent 7.39
 *   on footer #121315:    text 16.48, muted 7.63, link 8.89
 *   skip link #0e0f11 on #ff8557: 7.99; focus ring #ff996f on --bg: 9.17
 * Table and box borders (#2b2d32) are decorative; meaning never depends on them.
 */
:root {
  color-scheme: dark;
  --bg: #0e0f11;
  --surface: #17181c;
  --line: #2b2d32;
  --text: #f1f1f3;
  --muted: #a3a6ae;
  --accent: #ff8557;
  --link: #ff996f;
  --focus: #ff996f;
  --radius: 12px;
  --measure: 70ch;
  --font:
    system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue",
    Arial, sans-serif;
}

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

html {
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

::selection {
  background: #ff855747;
  color: #fff;
}

/* Links: always underlined, never colour alone. */
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--text);
  text-decoration-thickness: 2px;
}

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

main:focus,
main:focus-visible {
  outline: none;
}

/* Skip link: hidden until focused. */
.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  outline-color: var(--text);
}

/* Header */
.site-header {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-weight: 600;
}

.wordmark {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Main column */
main {
  display: block;
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  margin: 0.5rem 0 0.5rem;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 2.75rem);
  letter-spacing: -0.02em;
}

h2 {
  margin: 3rem 0 0.75rem;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.15rem;
}

p,
li,
dd {
  max-width: var(--measure);
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

li {
  margin: 0.35rem 0;
}

li::marker {
  color: var(--accent);
}

strong {
  color: var(--text);
  font-weight: 700;
}

code {
  font-family:
    ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;
  font-size: 0.92em;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

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

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

/* Plain-language summary box */
.summary {
  margin: 0 0 2.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}

.summary h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--accent);
}

.summary ul {
  margin: 0;
}

.summary p:last-child {
  margin-bottom: 0;
}

/* Table of contents */
.toc {
  margin: 0 0 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toc ol {
  margin: 0;
  columns: 2 16rem;
  column-gap: 2rem;
}

.toc li {
  break-inside: avoid;
  margin: 0.2rem 0;
}

/* Sections */
section {
  scroll-margin-top: 1.5rem;
}

section:target > h2 {
  color: var(--accent);
}

/* Definition-style contact block */
.contact-card {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.contact-card p {
  margin: 0.25rem 0;
}

/* Responsive tables: the wrapper scrolls, the page does not. */
.table-wrap {
  margin: 1rem 0 1.75rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.table-wrap:focus-visible {
  outline-offset: 2px;
}

table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}

caption {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

th,
td {
  padding: 0.7rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

thead th {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface);
  white-space: nowrap;
}

tbody th {
  font-weight: 700;
  color: var(--text);
}

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #121315;
}

.site-footer .footer-inner {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
}

.site-footer p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin: 0;
}

.site-footer a {
  display: inline-block;
  padding: 0.35rem 0;
  font-size: 0.95rem;
}

.site-footer a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 40rem) {
  body {
    font-size: 1rem;
  }

  main {
    padding: 1.5rem 1.25rem 3rem;
  }

  .site-header,
  .site-footer .footer-inner {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  h2 {
    margin-top: 2.5rem;
    font-size: 1.35rem;
  }

  .summary,
  .toc {
    padding: 1rem 1.1rem;
  }
}

@media (forced-colors: active) {
  .summary,
  .toc,
  .table-wrap,
  .contact-card {
    border: 1px solid CanvasText;
  }

  .skip-link {
    border: 2px solid ButtonText;
  }
}

@media print {
  :root {
    color-scheme: light;
    --bg: #fff;
    --surface: #fff;
    --line: #999;
    --text: #000;
    --muted: #333;
    --accent: #000;
    --link: #000;
  }

  .skip-link,
  .toc {
    display: none;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
  }

  main a[href^="http"]::after,
  main a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}

/* Licence texts on /licenses/: wrap long lines instead of widening the page. */
details {
  margin: 0.5rem 0;
  border: 1px solid #3a3f47;
  border-radius: 8px;
  padding: 0.5rem 0.875rem;
}
summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 24px;
}
summary:focus-visible {
  outline: 2px solid #ff996f;
  outline-offset: 2px;
}
pre {
  margin: 0.75rem 0 0;
  max-height: 24rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------------
 * Content pages (how it works, about, resume builder, career guides).
 * Same tokens and contrast as above. Button text #171412 on #ff8557: 7.40.
 * ------------------------------------------------------------------ */
.brand-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
}
.brand-link img {
  width: 30px;
  height: 30px;
  /* Spacing on the image only, so "insta job" and its dot stay together. */
  margin-right: 0.55rem;
}
.brand-link span {
  color: var(--accent);
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav li {
  margin: 0;
}
.site-nav a {
  display: inline-block;
  padding: 0.55rem 0;
  min-height: 44px;
  font-size: 0.95rem;
  font-weight: 600;
}
.site-nav a[aria-current="page"] {
  color: var(--text);
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
}
.breadcrumbs li {
  margin: 0;
}
.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.35rem;
  color: var(--muted);
}
.lede {
  font-size: 1.2rem;
  color: #d6d8dd;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  background: var(--accent);
  color: #171412;
  font-weight: 800;
  text-decoration: none;
}
.button:hover {
  background: #ff996f;
  color: #171412;
}
.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid #6e7380;
}
.button.secondary:hover {
  border-color: var(--link);
  color: var(--text);
}
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}
.steps > li {
  counter-increment: step;
  position: relative;
  margin: 0 0 1.25rem;
  padding: 1rem 1rem 1rem 3.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: #171412;
  font-weight: 800;
  text-align: center;
  line-height: 1.75rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
  padding: 0;
  list-style: none;
}
.card {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.card h3 {
  margin-top: 0;
}
.card p:last-child {
  margin-bottom: 0;
}
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.5rem;
  padding: 0;
  list-style: none;
}
.skill-list li {
  margin: 0;
  padding: 0.3rem 0.7rem;
  border: 1px solid #6e7380;
  border-radius: 999px;
  font-size: 0.9rem;
}
.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.site-footer .footer-guides {
  margin-bottom: 1rem;
}
