/* Colours for each theme. Change these to restyle the whole site. */
:root, [data-theme="light"] {
  --bg: #f7f7f5;
  --text: #1c1c1e;
  --muted: #5f6368;
  --accent: #1f4fd1;
  --accent-text: #ffffff;
  --panel: #ffffff;
  --border: #dcdcdc;
  --ok: #16794a;
  --bad: #b3261e;
}
/* Challenge pages: the main site's background and teal, with their own font. */
[data-theme="dark"] {
  --bg: #1C1C24;
  --text: #e6edf3;
  --muted: #8b98a5;
  --accent: #03B3DB;
  --accent-text: #FFFFFF;
  --panel: #23232d;
  --border: #575769;
  --ok: #39d98a;
  --bad: #ff6b6b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[data-theme="dark"] body { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 16px; }

.page { max-width: 720px; margin: 0 auto; padding: 48px 16px 32px; }
.page.wide { max-width: 1100px; }
h1 { font-size: 2.2rem; line-height: 1.2; margin: 0 0 24px; }
h2 { font-size: 1.4rem; margin: 40px 0 12px; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; border-radius: 8px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

/* The top bar: logo on the left (links home), menu links on the right */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap;
       padding: 14px max(16px, calc((100% - 1100px) / 2)); border-bottom: 1px solid var(--border); }
.nav-logo { display: block; flex: none; line-height: 0; }
.nav-logo img { display: block; height: 52px; width: auto; border-radius: 0; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: flex-end; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 736px) { .nav-logo img { height: 44px; } .nav-links { gap: 6px 16px; font-size: 0.95rem; } }
.footer { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 24px 16px 48px; }
.footer p { margin: 0; }
.social { list-style: none; display: flex; justify-content: center; gap: 1.5rem; padding: 0; margin: 0 0 1.5rem; }
.social a {
  display: flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem;
  border: 1px solid var(--border); border-radius: 50%; color: var(--text); transition: transform .25s, border-color .25s;
}
.social a:hover { border-color: var(--text); transform: scale(1.04); }
.social svg { width: 60%; height: 60%; fill: currentColor; }
.columns { display: flex; gap: 4rem; align-items: flex-start; }
.columns > .column { flex: 1 1 0; min-width: 0; }
.columns > .column:first-child { flex-grow: 1.5; }
@media (max-width: 736px) { .columns { flex-direction: column; gap: 1rem; } }

.button-row { margin: 28px 0; }
.next-level { margin: 28px 0; }
.next-level p:first-child { font-weight: 600; }
.button {
  display: inline-block; padding: 12px 26px; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.08); }

.form { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin: 28px 0; }
.form-title { margin-top: 0; font-weight: 600; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; color: var(--muted); font-size: 0.95rem; margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
.result { margin: 14px 0 0; font-weight: 600; }
.result.ok, .ok { color: var(--ok); }
.result.bad, .error { color: var(--bad); }
.stats { color: var(--muted); font-size: 0.95rem; }

.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.table-wrap { overflow-x: auto; }
table.admin { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
table.admin th, table.admin td { border-bottom: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; }

/* ---------- company theme: the main page (same look as talentstill.com) ---------- */
[data-theme="company"] {
  --bg: #1C1C24;
  --text: #FFFFFF;
  --muted: #575769;
  --accent: #03B3DB;
  --accent-text: #FFFFFF;
  --panel: #23232d;
  --border: #575769;
  font-size: 19pt;
}
@media (max-width: 1680px) { [data-theme="company"] { font-size: 14pt; } }
@media (max-width: 1280px) { [data-theme="company"] { font-size: 12pt; } }
@media (max-width: 736px)  { [data-theme="company"] { font-size: 11pt; } }
[data-theme="company"] body {
  font-family: "Plus Jakarta Sans", sans-serif; font-weight: 300; font-size: 1rem; line-height: 1.875;
  text-align: center;
}
/* the faint hexagon pattern from the original site, on the main page and the challenge pages */
[data-theme="company"] body, [data-theme="dark"] body {
  background: #1C1C24 url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20512%20512%22%20width%3D%22512%22%20height%3D%22512%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23272733%22%20stroke-width%3D%221.01%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20vector-effect%3D%22non-scaling-stroke%22%20d%3D%22M424%2C331.8c0%2C12.5-6.7%2C24.1-17.5%2C30.3l-132%2C76.2c-10.8%2C6.3-24.2%2C6.3-35%2C0l-132-76.2C96.7%2C355.8%2C90%2C344.3%2C90%2C331.8V179.2c0-12.5%2C6.7-24.1%2C17.5-30.3l132-76.2c10.8-6.3%2C24.2-6.3%2C35%2C0l132%2C76.2c10.8%2C6.3%2C17.5%2C17.8%2C17.5%2C30.3V331.8z%20M238.5%2C73l-256%2C147.6%20M273.5%2C439l252.1-145.4%20M256%2C634.7V378.3c0-12.5%2C6.7-24.1%2C17.5-30.3l252.1-145.4%20M256-122.7v256.4c0%2C12.5-6.7%2C24.1-17.5%2C30.3l-256%2C147.6%22%2F%3E%3C%2Fsvg%3E') center / 799px repeat fixed;
}
[data-theme="company"] .page { max-width: 52rem; padding: 4.5rem 2rem 0; }
[data-theme="company"] .nav { font-family: "Plus Jakarta Sans", sans-serif; font-size: 0.9em; }
[data-theme="company"] .nav-links a { color: #a6a6b5; }
[data-theme="company"] .nav-links a:hover { color: var(--text); }
[data-theme="company"] h1,
[data-theme="company"] h2 {
  color: var(--accent); text-transform: uppercase; font-weight: 600;
  font-size: 1.5em; line-height: 1.625; letter-spacing: 0.2rem; margin: 0 0 1.125rem;
}
[data-theme="company"] h2:not(:first-child) { margin-top: 5rem; }
[data-theme="company"] h2 + p { margin-top: 0; }
[data-theme="company"] h3 {
  color: var(--text); font-weight: 600; font-size: 2.25em; line-height: 1.25; letter-spacing: 0.025rem; margin: 0 0 0.5rem;
}
[data-theme="company"] h3 a { color: inherit; text-decoration: none; }
[data-theme="company"] h3 a:hover { text-decoration: underline; }
[data-theme="company"] p { max-width: 44.625rem; margin: 1.125rem auto; }
[data-theme="company"] a { color: var(--text); }
[data-theme="company"] .footer { font-family: "Source Sans 3", sans-serif; font-size: 1em; line-height: 1.875; padding: 2rem 1.5rem 6rem; }
@media (max-width: 736px) {
  [data-theme="company"] .page { padding: 3rem 1.5rem 0; }
  [data-theme="company"] h1, [data-theme="company"] h2 { font-size: 1em; letter-spacing: 0.175rem; }
  [data-theme="company"] h2:not(:first-child) { margin-top: 3.5rem; }
  [data-theme="company"] h3 { font-size: 2em; }
}
[data-theme="company"] .page ul, [data-theme="company"] .page ol { display: inline-block; text-align: left; margin: 0 auto; padding-left: 1.2em; }
[data-theme="company"] .form { text-align: left; max-width: 36rem; margin: 2rem auto; }
[data-theme="company"] .form p { margin: 0 0 1rem; }
.field.checkbox { display: flex; gap: 10px; align-items: flex-start; }
.field.checkbox input { width: auto; flex: none; margin-top: 0.35em; }
.field.checkbox span { color: var(--text); margin: 0; }

/* Cookie banner, shown until the visitor answers (only when GA_MEASUREMENT_ID is set). */
.cookie-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 10; max-width: 560px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px;
  background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18); text-align: left; font-size: 0.85rem; line-height: 1.4;
}
.cookie-banner[hidden] { display: none; }
.cookie-text { flex: 1 1 240px; }
.cookie-text summary { list-style: none; cursor: pointer; }
.cookie-text summary::-webkit-details-marker { display: none; }
.cookie-more { color: var(--muted); text-decoration: underline; white-space: nowrap; }
.cookie-text[open] .cookie-more { display: none; }
.cookie-text p { margin: 6px 0 0; color: var(--muted); }
.cookie-buttons { display: flex; gap: 8px; margin-left: auto; }
.cookie-banner .button { padding: 6px 14px; font-size: 0.85rem; border-radius: 6px; }
.button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.cookie-link { margin-top: 8px !important; font-size: 0.85rem; }
.cookie-link a { color: var(--muted); }
[data-theme="company"] .field span, [data-theme="company"] .form-text { color: #a6a6b5; }
[data-theme="company"] strong { font-weight: 600; }
/* Columns with a picture are challenge cards (the challenges page): title and picture, then text */
[data-theme="company"] .columns:has(img) { max-width: 40rem; margin: 1rem auto 2rem; align-items: center; }
[data-theme="company"] .columns:has(img) p { margin: 0 auto; }
[data-theme="company"] .columns img { border-radius: 1rem; display: block; }
/* Columns without one are panels, two to a row ("What we build") */
[data-theme="company"] .columns:not(:has(img)) { max-width: 48rem; align-items: stretch; gap: 1.5rem; margin: 0 auto 1.5rem; }
[data-theme="company"] .columns:not(:has(img)) > .column {
  flex: 1 1 0; background: var(--panel); border: 1px solid var(--border); border-radius: 1rem;
  padding: 1.75rem 1.5rem; text-align: left;
}
[data-theme="company"] .columns:not(:has(img)) h3 { font-size: 1.5em; margin: 0 0 0.5rem; }
[data-theme="company"] .columns:not(:has(img)) p { margin: 0; }
[data-theme="company"] .columns:not(:has(img)) a { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* {numbers: ...}: a slim row of headline numbers */
.numbers { display: flex; justify-content: center; gap: 1rem; max-width: 40rem; margin: 2rem auto; }
.number { flex: 1 1 0; padding: 1.1rem 0.75rem; border: 1px solid var(--border); border-radius: 1rem; text-align: center; }
.number strong { display: block; color: var(--accent); font-size: 2em; font-weight: 600; line-height: 1.2; }
.number span { display: block; color: #a6a6b5; font-size: 0.85em; line-height: 1.4; margin-top: 0.35rem; }
@media (max-width: 736px) { .numbers { gap: 0.5rem; } .number { padding: 0.9rem 0.4rem; } }

/* About: a photo with the name above it, text beside it (columns holding a .portrait image) */
[data-theme="company"] .columns:has(.portrait) { max-width: 46rem; gap: 3rem; align-items: center; }
[data-theme="company"] .columns:has(.portrait) > .column:first-child { flex: 0 0 15rem; }
[data-theme="company"] .columns:has(.portrait) h3 { font-size: 2em; margin-bottom: 1rem; }
[data-theme="company"] .columns:has(.portrait) p { margin: 0 auto 1.125rem; }
[data-theme="company"] .columns:has(.portrait) > .column:last-child p { text-align: left; }
[data-theme="company"] img.portrait { width: 15rem; border-radius: 1.6rem; margin: 0 auto; }
@media (max-width: 736px) {
  [data-theme="company"] .columns:has(.portrait) { gap: 1.5rem; }
  [data-theme="company"] .columns:has(.portrait) > .column:first-child { flex-basis: auto; }
  [data-theme="company"] .columns:has(.portrait) > .column:last-child p { text-align: center; }
}
.or-form { color: #a6a6b5; font-size: 0.9em; margin-top: -0.75rem !important; }

/* The big headline under the small teal line at the top of the main page */
[data-theme="company"] h1 {
  color: var(--text); text-transform: none; letter-spacing: 0; font-size: 2.6em; line-height: 1.2;
  max-width: 40rem; margin: 0.5rem auto 1.5rem;
}
@media (max-width: 736px) { [data-theme="company"] h1 { font-size: 1.9em; letter-spacing: 0; } }
/* "Who it's for": three panels in one row */
[data-theme="company"] .columns:not(:has(img)):has(> .column:nth-child(3)) h3 { font-size: 1.25em; }
[data-theme="company"] .page ol { max-width: 36rem; }
[data-theme="company"] .page ol li { margin-bottom: 0.6rem; }

/* "What this teaches" on the challenge pages */
.teaches { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent);
           border-radius: 8px; padding: 14px 18px; margin: 24px 0; }
.teaches p { margin: 0 0 6px; }
.teaches ul { margin: 0; padding-left: 1.2em; }
[data-theme="company"] .columns:has(.portrait) > .column:first-child p:last-child { color: #a6a6b5; font-size: 0.9em; margin: 0.75rem auto 0; }
/* "How it works": numbered steps in squares, four to a row */
[data-theme="company"] .columns:has(.step) { max-width: 52rem; gap: 1rem; }
[data-theme="company"] .columns:has(.step) > .column { padding: 1.5rem 1.25rem; text-align: center; position: relative; }
[data-theme="company"] .columns:has(.step) h3 { font-size: 1.2em; margin: 0.9rem 0 0.4rem; }
[data-theme="company"] .columns:has(.step) p { font-size: 0.9em; line-height: 1.6; }
[data-theme="company"] .columns:has(.step) > .column > p:first-child { line-height: 0; }
.step {
  display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem;
  border-radius: 50%; border: 2px solid var(--accent); color: var(--accent); font-weight: 600; font-size: 1.1rem; line-height: 1;
  box-shadow: 0 0 18px rgba(3, 179, 219, 0.25);
}
/* a small arrow between steps on wide screens */
@media (min-width: 737px) {
  [data-theme="company"] .columns:has(.step) > .column:not(:last-child)::after {
    content: "→"; position: absolute; right: -0.9rem; top: 2.2rem; color: var(--accent); font-size: 1rem; z-index: 1;
  }
}
