/* Cyber Challenge Ireland, over CTFd's core theme.
 *
 * CTFd's core theme is Bootstrap 5.3. This file is loaded after it, from
 * <link> tags injected through the theme_header config, and it does two
 * things: it repoints Bootstrap's own custom properties at the poster
 * palette, and it restyles the handful of components players actually look
 * at. Nothing in CTFd is forked, so a CTFd upgrade cannot break a template
 * that no longer exists.
 *
 * Caddy serves this file, and everything beside it, from /opt/cci-ctfd/brand
 * on the instance. That means it can be edited in place during an event and
 * takes effect on the next reload, with no container restart and no database
 * write. The next terraform apply puts it back.
 *
 * The colours, the two typefaces and the structural devices (skewed accent
 * bars, hexagon markers, a four-pixel accent edge on a raised surface, square
 * corners everywhere) are the homepage's, so a heat site and the homepage
 * read as one event. See homepage/static/styles.css.
 */

/* ------------------------------------------------------------------ fonts */
/* The same files the homepage serves, copied onto the box at deploy time out
   of homepage/static/fonts so there is only ever one set. */
@font-face {
  font-family: 'Chakra Petch';
  src: url('/brand/fonts/chakra-petch-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('/brand/fonts/chakra-petch-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/brand/fonts/ibm-plex-sans-var.woff2') format('woff2');
  font-weight: 100 700; font-style: normal; font-display: swap;
}

/* ----------------------------------------------------------------- tokens */
/* Declared for light as well as dark. CTFd ships a theme switch, and a half
   converted light mode looks broken rather than light, so there is one
   palette and the switch is hidden below. */
:root,
[data-bs-theme=light],
[data-bs-theme=dark] {
  color-scheme: dark;

  --cci-ink:#0A0E15;
  --cci-raise:#121926;
  --cci-raise-hi:#18212F;
  --cci-rule:#1E2736;
  --cci-paper:#E9EEF5;
  --cci-mute:#8C9AAE;

  --cci-cyan:#60C6DE;
  --cci-violet:#A06BC8;
  --cci-lime:#AECC48;
  --cci-amber:#F6DE42;
  --cci-magenta:#E44896;
  --cci-azure:#5B9BE0;

  /* Every accented component reads this. Category sections reassign it. */
  --accent:var(--cci-cyan);

  --cci-display:'Chakra Petch',system-ui,sans-serif;
  --cci-text:'IBM Plex Sans',system-ui,sans-serif;

  /* Bootstrap, repointed. The -rgb pairs matter: Bootstrap composes several
     of its own colours as rgba(var(--bs-...-rgb), opacity). */
  --bs-body-bg:#0A0E15;
  --bs-body-bg-rgb:10,14,21;
  --bs-body-color:#E9EEF5;
  --bs-body-color-rgb:233,238,245;
  --bs-body-font-family:var(--cci-text);
  --bs-body-font-size:1.0625rem;
  --bs-body-line-height:1.65;

  --bs-emphasis-color:#FFFFFF;
  --bs-emphasis-color-rgb:255,255,255;
  --bs-heading-color:#E9EEF5;

  --bs-secondary-color:#8C9AAE;
  --bs-secondary-color-rgb:140,154,174;
  --bs-secondary-bg:#121926;
  --bs-secondary-bg-rgb:18,25,38;
  --bs-tertiary-color:#8C9AAE;
  --bs-tertiary-color-rgb:140,154,174;
  --bs-tertiary-bg:#121926;
  --bs-tertiary-bg-rgb:18,25,38;

  --bs-border-color:#1E2736;
  --bs-border-color-translucent:rgba(233,238,245,.12);
  /* The poster has no rounded corner anywhere on it. */
  --bs-border-radius:0;
  --bs-border-radius-sm:0;
  --bs-border-radius-lg:0;
  --bs-border-radius-xl:0;
  --bs-border-radius-2xl:0;
  --bs-border-radius-pill:999px;

  --bs-link-color:#60C6DE;
  --bs-link-color-rgb:96,198,222;
  --bs-link-hover-color:#8FDAEC;
  --bs-link-hover-color-rgb:143,218,236;

  --bs-primary:#60C6DE;
  --bs-primary-rgb:96,198,222;
  --bs-success:#AECC48;
  --bs-success-rgb:174,204,72;
  --bs-info:#5B9BE0;
  --bs-info-rgb:91,155,224;
  --bs-warning:#F6DE42;
  --bs-warning-rgb:246,222,66;
  --bs-danger:#E44896;
  --bs-danger-rgb:228,72,150;
  --bs-secondary:#8C9AAE;
  --bs-secondary-rgb:140,154,174;
  /* .bg-dark is what paints the navbar. */
  --bs-dark:#0A0E15;
  --bs-dark-rgb:10,14,21;
  --bs-light:#E9EEF5;
  --bs-light-rgb:233,238,245;

  --bs-code-color:#AECC48;
  --bs-highlight-bg:#1E2736;
  --bs-highlight-color:#E9EEF5;
}

/* Accent utilities, so page content can pick a colour without a style
   attribute. Same names as the homepage. */
.a-cyan{--accent:var(--cci-cyan)}
.a-violet{--accent:var(--cci-violet)}
.a-lime{--accent:var(--cci-lime)}
.a-amber{--accent:var(--cci-amber)}
.a-magenta{--accent:var(--cci-magenta)}
.a-azure{--accent:var(--cci-azure)}

/* ------------------------------------------------------------------- base */
/* The core theme sets Lato on `.container` as well as on body, so overriding
   body alone leaves most of the page in Lato. */
html, body, .container, .container-fluid {
  font-family:var(--cci-text);
}

body {
  background-color:var(--cci-ink);
  /* The homepage's signal grid, at the same pitch. */
  background-image:
    linear-gradient(transparent 95%, rgba(96,198,222,.045) 95%),
    linear-gradient(90deg, transparent 95%, rgba(96,198,222,.045) 95%);
  background-size:52px 52px;
  background-attachment:fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family:var(--cci-display);
  font-weight:700;
  letter-spacing:-.005em;
  color:var(--cci-paper);
}
/* The core theme tracks h1 and h2 out by 2px, which Chakra Petch does not
   need and which makes a long challenge name wrap early. */
h1, h2 { letter-spacing:-.01em; }

code, pre, kbd, samp { font-family:ui-monospace,'SFMono-Regular',Menlo,Consolas,monospace; }
code { color:var(--cci-lime); }

hr { border-color:var(--cci-rule); opacity:1; }

blockquote {
  border-left:4px solid var(--accent);
  padding-left:1rem;
  color:#C3CDDA;
}

:where(a, button, input, select, textarea, .btn, [tabindex]):focus-visible {
  outline:3px solid var(--cci-lime);
  outline-offset:2px;
  box-shadow:none;
}

/* ---------------------------------------------------------------- navbar */
.navbar.bg-dark {
  background-color:var(--cci-ink) !important;
  border-bottom:1px solid var(--cci-rule);
  --bs-navbar-color:#8C9AAE;
  --bs-navbar-hover-color:#E9EEF5;
  --bs-navbar-active-color:#E9EEF5;
  --bs-navbar-brand-color:#E9EEF5;
  --bs-navbar-brand-hover-color:#E9EEF5;
  --bs-navbar-toggler-border-color:var(--cci-rule);
}

/* CTFd pins the navbar and then pushes the page down by a fixed 3.5rem. On
   a narrow screen the bar is taller than that, because the event name and
   the menu button stop fitting on one line, and the top of the page ends up
   underneath it. Sticky instead of fixed keeps the bar pinned while leaving
   it in the flow, so whatever height it takes is height the page has
   accounted for, at any width and any length of event name. */
.navbar.fixed-top { position:sticky; }
main { padding-top:0; }
/* A page with no title block (the front page, the rules) would otherwise
   start hard against the bar. Pages that do have one get their space from
   .jumbotron below. */
main > .container:first-child { padding-top:2.5rem; }

.navbar-brand {
  font-family:var(--cci-display);
  font-weight:700;
  font-size:.95rem;
  letter-spacing:.12em;
  text-transform:uppercase;
}
/* "Cyber Challenge Ireland: North East" is a long thing to put on a phone.
   Set small enough that it still shares a line with the menu button. */
@media (max-width:575.98px) {
  .navbar-brand { font-size:.7rem; letter-spacing:.06em; }
}

.navbar .nav-link {
  border-bottom:1px solid transparent;
  transition:color .12s ease, border-color .12s ease;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
  border-bottom-color:var(--cci-cyan);
}

.navbar .dropdown-menu {
  --bs-dropdown-bg:var(--cci-raise);
  --bs-dropdown-border-color:var(--cci-rule);
  --bs-dropdown-link-color:var(--cci-paper);
  --bs-dropdown-link-hover-bg:var(--cci-raise-hi);
  --bs-dropdown-link-hover-color:var(--cci-paper);
  --bs-dropdown-link-active-bg:var(--cci-cyan);
  --bs-dropdown-link-active-color:var(--cci-ink);
}

/* One palette, so the light/dark switch has nothing to switch. */
.theme-switch { display:none !important; }

/* ------------------------------------------------------- page title block */
/* CTFd puts every page title in a centred dark slab. Emptied out: the title
   carries itself, under a short skewed rule taken from the poster's date
   chips. */
.jumbotron {
  background-color:transparent;
  color:var(--cci-paper);
  text-align:left;
  padding:2.5rem 0 0;
  margin-bottom:2rem;
  border-bottom:1px solid var(--cci-rule);
}
@media (min-width:576px) { .jumbotron { padding:3.25rem 0 0; } }

.jumbotron .container { font-family:var(--cci-text); }

.jumbotron h1 {
  font-family:var(--cci-display);
  font-weight:700;
  font-size:clamp(2.1rem,5.5vw,3.25rem);
  line-height:1;
  margin:0 0 1.75rem;
}
.jumbotron h1::after {
  content:"";
  display:block;
  width:3.25rem;
  height:4px;
  margin-top:1.1rem;
  background:var(--cci-cyan);
  transform:skewX(-20deg);
}

/* --------------------------------------------------------------- buttons */
.btn {
  font-family:var(--cci-display);
  font-weight:600;
  letter-spacing:.02em;
  --bs-btn-border-radius:0;
}

.btn-primary {
  --bs-btn-bg:#60C6DE;
  --bs-btn-border-color:#60C6DE;
  --bs-btn-color:#0A0E15;
  --bs-btn-hover-bg:#8FDAEC;
  --bs-btn-hover-border-color:#8FDAEC;
  --bs-btn-hover-color:#0A0E15;
  --bs-btn-active-bg:#4FB4CC;
  --bs-btn-active-border-color:#4FB4CC;
  --bs-btn-active-color:#0A0E15;
  --bs-btn-disabled-bg:#3A5E68;
  --bs-btn-disabled-border-color:#3A5E68;
  --bs-btn-disabled-color:#0A0E15;
}

.btn-success {
  --bs-btn-bg:#AECC48;
  --bs-btn-border-color:#AECC48;
  --bs-btn-color:#0A0E15;
  --bs-btn-hover-bg:#BCD95A;
  --bs-btn-hover-border-color:#BCD95A;
  --bs-btn-hover-color:#0A0E15;
}

.btn-secondary, .btn-dark {
  --bs-btn-bg:#121926;
  --bs-btn-border-color:#1E2736;
  --bs-btn-color:#E9EEF5;
  --bs-btn-hover-bg:#18212F;
  --bs-btn-hover-border-color:#2A3547;
  --bs-btn-hover-color:#E9EEF5;
}

.btn-outline-secondary {
  --bs-btn-color:#E9EEF5;
  --bs-btn-border-color:#1E2736;
  --bs-btn-hover-bg:#18212F;
  --bs-btn-hover-border-color:#60C6DE;
  --bs-btn-hover-color:#E9EEF5;
}

/* ----------------------------------------------------------------- forms */
.form-control, .form-select {
  background-color:var(--cci-raise);
  border-color:var(--cci-rule);
  color:var(--cci-paper);
  border-radius:0;
}
.form-control:focus, .form-select:focus {
  background-color:var(--cci-raise);
  border-color:var(--cci-cyan);
  color:var(--cci-paper);
  box-shadow:none;
}
.form-control::placeholder { color:#5C6A7D; }
.form-label, .col-form-label {
  font-family:var(--cci-display);
  font-weight:600;
  letter-spacing:.02em;
  color:var(--cci-paper);
}
.form-text { color:var(--cci-mute); }
.input-group-text {
  background-color:var(--cci-raise);
  border-color:var(--cci-rule);
  color:var(--cci-mute);
}
.form-check-input { background-color:var(--cci-raise); border-color:var(--cci-rule); }
.form-check-input:checked { background-color:var(--cci-cyan); border-color:var(--cci-cyan); }

/* ------------------------------------------------- panels, modals, alerts */
.card, .modal-content, .list-group-item {
  background-color:var(--cci-raise);
  border-color:var(--cci-rule);
  color:var(--cci-paper);
}
.modal-content { border-left:4px solid var(--accent); }
.modal-header, .modal-footer { border-color:var(--cci-rule); }

.alert { border-radius:0; border-width:0 0 0 4px; }
.alert-danger  { background-color:rgba(228,72,150,.12); border-color:var(--cci-magenta); color:#F3B6D2; }
.alert-success { background-color:rgba(174,204,72,.12); border-color:var(--cci-lime);    color:#D6E79A; }
.alert-info    { background-color:rgba(91,155,224,.12); border-color:var(--cci-azure);   color:#B6D0F0; }
.alert-warning { background-color:rgba(246,222,66,.12); border-color:var(--cci-amber);   color:#F2E79B; }

.badge { border-radius:0; font-family:var(--cci-display); font-weight:600; letter-spacing:.03em; }
.badge.rounded-pill { border-radius:999px; }

.nav-tabs {
  --bs-nav-tabs-border-color:var(--cci-rule);
  --bs-nav-tabs-link-active-bg:var(--cci-raise);
  --bs-nav-tabs-link-active-color:var(--cci-paper);
  --bs-nav-tabs-link-active-border-color:var(--cci-rule) var(--cci-rule) var(--cci-raise);
}
.nav-tabs .nav-link { color:var(--cci-mute); font-family:var(--cci-display); font-weight:600; }

.pagination {
  --bs-pagination-bg:var(--cci-raise);
  --bs-pagination-border-color:var(--cci-rule);
  --bs-pagination-color:var(--cci-paper);
  --bs-pagination-hover-bg:var(--cci-raise-hi);
  --bs-pagination-hover-border-color:var(--cci-rule);
  --bs-pagination-hover-color:var(--cci-paper);
  --bs-pagination-active-bg:var(--cci-cyan);
  --bs-pagination-active-border-color:var(--cci-cyan);
  --bs-pagination-active-color:var(--cci-ink);
  --bs-pagination-disabled-bg:var(--cci-raise);
  --bs-pagination-disabled-border-color:var(--cci-rule);
  --bs-pagination-border-radius:0;
}

/* ---------------------------------------------------------------- tables */
/* The scoreboard is the table people stare at, so it gets the treatment and
   the rest inherit it. */
.table {
  --bs-table-bg:#121926;
  --bs-table-color:var(--cci-paper);
  --bs-table-border-color:var(--cci-rule);
  --bs-table-striped-bg:rgba(233,238,245,.03);
  --bs-table-striped-color:var(--cci-paper);
  --bs-table-hover-bg:rgba(96,198,222,.07);
  --bs-table-hover-color:var(--cci-paper);
}
.table > thead th,
.table > thead > tr > :first-child {
  font-family:var(--cci-display);
  font-weight:600;
  font-size:.8rem;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--cci-cyan);
  border-bottom-color:var(--cci-rule);
}
.table > tbody > tr > td { border-color:var(--cci-rule); }

/* ------------------------------------------------------- challenge board */
/* Six categories, six accents, in the poster's order. Alpine renders each
   category as a sibling div after the <template> it came from, so counting
   divs inside the board is how a category finds its colour. A category
   beyond the sixth starts the cycle again. */
[x-data="ChallengeBoard"] [x-show] > div:nth-of-type(6n+1) { --accent:var(--cci-cyan); }
[x-data="ChallengeBoard"] [x-show] > div:nth-of-type(6n+2) { --accent:var(--cci-violet); }
[x-data="ChallengeBoard"] [x-show] > div:nth-of-type(6n+3) { --accent:var(--cci-lime); }
[x-data="ChallengeBoard"] [x-show] > div:nth-of-type(6n+4) { --accent:var(--cci-amber); }
[x-data="ChallengeBoard"] [x-show] > div:nth-of-type(6n+5) { --accent:var(--cci-magenta); }
[x-data="ChallengeBoard"] [x-show] > div:nth-of-type(6n+6) { --accent:var(--cci-azure); }

.category-header {
  display:flex;
  align-items:center;
  gap:.85rem;
  padding-bottom:.7rem;
  border-bottom:1px solid var(--cci-rule);
}
/* The poster's hexagon badge, one per category. */
.category-header::before {
  content:"";
  flex:none;
  width:24px;
  height:27px;
  background:var(--accent);
  clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
}
.category-header h3 {
  margin:0;
  font-size:clamp(1.15rem,2.6vw,1.5rem);
  letter-spacing:.01em;
  color:var(--cci-paper);
}

/* A raised square with an accent edge, the same device the homepage uses for
   a heat card. The core theme's glow is dropped: nine of them in a row is a
   lot of glow. */
[data-bs-theme] .challenge-button {
  background-color:var(--cci-raise);
  border:1px solid var(--cci-rule);
  border-left:4px solid var(--accent);
  border-radius:0;
  box-shadow:none;
  color:var(--cci-paper);
  transition:background-color .14s ease, border-color .14s ease;
}
[data-bs-theme] .challenge-button:hover {
  background-color:var(--cci-raise-hi);
  border-color:var(--cci-rule);
  border-left-color:var(--accent);
}

.challenge-button .challenge-inner p {
  font-family:var(--cci-display);
  font-weight:600;
  font-size:1.15rem;
  line-height:1.2;
  margin:0 0 .45rem;
}
.challenge-button .challenge-inner span {
  font-family:var(--cci-display);
  font-weight:700;
  font-size:1.45rem;
  color:var(--accent);
}

/* Solved. CTFd's stock green is the one colour on the page that is not from
   the poster, so it becomes the poster's lime with ink on top. */
.challenge-solved,
[data-bs-theme] .challenge-button.challenge-solved {
  background-color:var(--cci-lime);
  border-color:var(--cci-lime);
  color:var(--cci-ink);
}
[data-bs-theme] .challenge-button.challenge-solved:hover {
  background-color:#BCD95A;
  border-color:#BCD95A;
}
[data-bs-theme] .challenge-button.challenge-solved .challenge-inner span { color:var(--cci-ink); }

/* Locked: a category's bonus challenge before the rest of the category is
   solved. Dashed and dimmed so it reads as not yet open, with the reason
   written on it; the click does nothing (see ctfd/CCI-CHANGES.md). */
[data-bs-theme] .challenge-button.challenge-locked {
  background-color:transparent;
  border:1px dashed var(--cci-rule);
  border-left:4px dashed var(--accent);
  cursor:not-allowed;
}
[data-bs-theme] .challenge-button.challenge-locked:hover { background-color:transparent; }
.challenge-button.challenge-locked .challenge-inner p,
.challenge-button.challenge-locked .challenge-inner > span { opacity:.6; }
.challenge-button .challenge-lock {
  /* Not Bootstrap's d-block: that is !important, and would beat the inline
     display:none Alpine's x-show uses to hide this on unlocked tiles. */
  display:block;
  font-size:.8rem;
  line-height:1.35;
  color:var(--cci-paper);
  opacity:.85;
}
.challenge-button .challenge-inner .challenge-lock span {
  font:inherit;
  color:inherit;
}

/* ------------------------------------------------- the challenge dialog */
/* Where a player spends the day: read, download, type a flag, submit. */
.challenge-name {
  font-family:var(--cci-display);
  font-weight:700;
  font-size:clamp(1.5rem,4vw,2.1rem);
  line-height:1.05;
}
.challenge-value {
  font-family:var(--cci-display);
  font-weight:700;
  color:var(--accent);
}
.challenge-desc { color:#C3CDDA; }
.challenge-desc a { color:var(--cci-cyan); text-decoration:underline !important; }
.challenge-desc code,
.challenge-connection-info code {
  background:var(--cci-ink);
  border:1px solid var(--cci-rule);
  padding:.1rem .4rem;
  color:var(--cci-lime);
}
.challenge-desc img { border:1px solid var(--cci-rule); }

/* Code blocks in a description (Flip The Switch, Repeat After Me). The inline
   code rule above must not reach inside a block, or every line becomes its
   own little box; and CTFd's highlighter (lolight) colours tokens for a white page, so
   plain text came out dark grey on the dark panel, which is unreadable.
   Tokens take the poster's accents instead. */
.challenge-desc pre {
  background:var(--cci-ink);
  border:1px solid var(--cci-rule);
  border-left:4px solid var(--accent);
  padding:.8rem 1rem;
  overflow-x:auto;
}
[data-bs-theme] .challenge-desc pre code {
  display:block;
  background:transparent;
  border:0;
  padding:0;
  color:var(--cci-paper);
  /* Wrapped, not scrolled: a student copying by dragging must not miss the
     end of a long line hidden off to the right. Wrapping adds no real line
     breaks, so what they copy still runs. */
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
/* CTFd highlights with lolight, whose tokens are ll-<kind>. */
[data-bs-theme] .challenge-desc pre .ll-key { color:var(--cci-violet); font-weight:600; }
[data-bs-theme] .challenge-desc pre .ll-num { color:var(--cci-amber); }
[data-bs-theme] .challenge-desc pre .ll-str,
[data-bs-theme] .challenge-desc pre .ll-rex { color:var(--cci-lime); }
[data-bs-theme] .challenge-desc pre .ll-com { color:var(--cci-mute); font-style:italic; }
[data-bs-theme] .challenge-desc pre .ll-nam,
[data-bs-theme] .challenge-desc pre .ll-pct,
[data-bs-theme] .challenge-desc pre .ll-unk { color:var(--cci-paper); }


/* A flag is a string to be typed exactly, so it is set in a monospace face
   where l, 1 and I are different shapes. */
.challenge-input.form-control {
  font-family:ui-monospace,'SFMono-Regular',Menlo,Consolas,monospace;
  font-size:1rem;
  letter-spacing:.01em;
}

/* Submitting is the one thing this dialog is for, so it is not an outline
   button. */
.challenge-submit.btn {
  --bs-btn-bg:#60C6DE;
  --bs-btn-border-color:#60C6DE;
  --bs-btn-color:#0A0E15;
  --bs-btn-hover-bg:#8FDAEC;
  --bs-btn-hover-border-color:#8FDAEC;
  --bs-btn-hover-color:#0A0E15;
  --bs-btn-active-bg:#4FB4CC;
  --bs-btn-active-border-color:#4FB4CC;
  --bs-btn-active-color:#0A0E15;
}

.btn-file.btn {
  --bs-btn-bg:transparent;
  --bs-btn-border-color:var(--cci-azure);
  --bs-btn-color:#B6D0F0;
  --bs-btn-hover-bg:var(--cci-azure);
  --bs-btn-hover-border-color:var(--cci-azure);
  --bs-btn-hover-color:#0A0E15;
}

/* Hints are free but collapsed, so a student tries first and opens one
   when stuck; the summary has to look like something you can open. */
.challenge-hints details {
  background:var(--cci-ink);
  border:1px solid var(--cci-rule);
  border-left:4px solid var(--cci-amber);
  padding:.7rem 1rem;
  margin-bottom:.6rem;
}
.challenge-hints summary {
  cursor:pointer;
  font-family:var(--cci-display);
  font-weight:600;
  color:var(--cci-amber);
}
.challenge-hints details[open] summary { margin-bottom:.6rem; }

.challenge-tag.badge { background-color:var(--cci-azure) !important; color:var(--cci-ink); }
.challenge-attribution, .challenge-ratings { color:var(--cci-mute) !important; }

/* ---------------------------------------------------------------- graphs */
/* The score graphs are drawn to a canvas by ECharts, with its default light
   text colours, so CSS cannot recolour their labels. They get a paper panel
   to sit on instead, which is also what the poster does with the partner
   marks: artwork drawn for white keeps its white. */
#score-graph, #solves-graph, #keys-pie-graph, #categories-pie-graph {
  background:var(--cci-paper);
  border-left:4px solid var(--cci-cyan);
  padding:.75rem;
}

/* ---------------------------------------------------------------- footer */
/* CTFd's theme ends every page with a "Powered by CTFd" link. This is a
   self-hosted install on our own domain, not a hosted account, so the badge
   is hidden. CTFd is Apache 2.0 with no NOTICE file, and its attribution
   clauses cover redistributing the source rather than a badge on a site you
   run, so nothing here depends on it. The software and its version are
   credited in infra/README.md, which is where someone looking for them would
   actually look.

   The theme reserves 100px under main for a footer that is now not there,
   so that comes back too. */
.footer { display:none; }
main { margin-bottom:0; }

/* ============================================================ front page */
/* Classes used by the page at /, written by infra/scripts/bootstrap-ctfd.py.
   They are prefixed cci- so a CTFd upgrade cannot collide with them. */

/* Two columns, the same split as the homepage's own hero: the sign on the
   left, and on the right, where the homepage puts its map of Ireland, the
   answer to the same question about where to go next. Two half-full columns
   read as composed; one third-full column reads as a page that failed to
   load. */
.cci-hero {
  display:grid;
  gap:clamp(2.5rem,6vw,5rem);
  grid-template-columns:1fr;
  align-items:center;
  padding:clamp(1rem,4vw,3rem) 0 clamp(2.5rem,6vw,4.5rem);
}
@media (min-width:62rem) {
  .cci-hero { grid-template-columns:1.1fr .9fr; }
}

/* The poster's date chip: a skewed solid block, with the text skewed back so
   it stays upright. */
.cci-chip {
  display:inline-block;
  margin:0 0 1.5rem;
  padding:.35rem 1rem;
  background:var(--cci-cyan);
  color:var(--cci-ink);
  font-family:var(--cci-display);
  font-weight:700;
  font-size:clamp(1rem,2.2vw,1.3rem);
  transform:skewX(-9deg);
}
.cci-chip > span { display:inline-block; transform:skewX(9deg); }

/* The headline carries the page almost on its own now, so it is set larger
   than it was when there were paragraphs under it. */
.cci-sign h1 {
  font-size:clamp(2.9rem,7.5vw,5rem);
  line-height:.93;
  letter-spacing:-.025em;
  margin:0;
  text-wrap:balance;
}

.cci-actions { margin:2.5rem 0 0; display:flex; flex-wrap:wrap; gap:.85rem; }
.cci-btn {
  display:inline-block;
  padding:.8rem 1.5rem;
  background:var(--cci-cyan);
  color:var(--cci-ink) !important;
  font-family:var(--cci-display);
  font-weight:700;
  letter-spacing:.03em;
}
.cci-btn:hover { background:#8FDAEC; }
.cci-btn--quiet {
  background:transparent;
  color:var(--cci-paper) !important;
  border:1px solid var(--cci-rule);
}
.cci-btn--quiet:hover { background:var(--cci-raise); border-color:var(--cci-cyan); }
/* Stacked on a phone, so two buttons of different word lengths do not leave
   a ragged edge down the left of the screen. */
@media (max-width:36rem) {
  .cci-actions { display:grid; gap:.7rem; }
  .cci-btn { text-align:center; }
}

/* The click path, drawn as a path. The line encodes the order, so the steps
   are not numbered: a number on top of a connecting rule says the same thing
   twice. The markers are the homepage map's ring and glowing dot. */
.cci-path { list-style:none; margin:0; padding:0; }

.cci-step { position:relative; padding:0 0 2.5rem 2.75rem; }
.cci-step:last-child { padding-bottom:0; }

.cci-step::before {
  content:"";
  position:absolute;
  left:0; top:.45rem;
  width:17px; height:17px;
  border:1.6px solid var(--accent);
  border-radius:50%;
  background:radial-gradient(circle at center, var(--accent) 0 3.2px, transparent 3.2px);
  filter:drop-shadow(0 0 5px var(--accent));
}

.cci-step:not(:last-child)::after {
  content:"";
  position:absolute;
  left:8px; top:1.9rem;
  width:1px; height:calc(100% - 1.9rem);
  /* Bright where it leaves the marker, fading as it travels, so the eye is
     pulled down the path rather than along a flat rule. */
  background:linear-gradient(var(--accent) 0, #38465C 55%, #38465C 100%);
}

.cci-step__name {
  display:block;
  font-family:var(--cci-display);
  font-weight:700;
  font-size:1.5rem;
  line-height:1.1;
  color:var(--accent);
}
.cci-step__note { display:block; color:var(--cci-mute); margin-top:.2rem; }

/* --------------------------------------------------------- partner strip */
/* A paper panel, because several of these marks are flattened artwork on an
   opaque white box and have no usable reverse version. The homepage does the
   same thing for the same reason. */
.cci-partners {
  margin:4.5rem 0 2rem;
  background:#fff;
  padding:2.25rem 1.5rem 2.5rem;
}
.cci-partners h2 {
  font-size:.8rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:#4A5768;
  font-weight:600;
  text-align:center;
  margin:0 0 1.9rem;
}
.cci-partners__strip {
  display:grid;
  grid-template-columns:repeat(2,1fr);
  place-items:center;
  gap:2rem 1.5rem;
  max-width:52rem;
  margin-inline:auto;
}
.cci-partners__strip > :last-child:nth-child(odd) { grid-column:1/-1; }
@media (min-width:36rem) {
  .cci-partners__strip { grid-template-columns:repeat(3,1fr); }
  .cci-partners__strip > :last-child:nth-child(odd) { grid-column:auto; }
}
/* Sized one at a time: these range from a square crest to a wordmark five
   times as wide, so one fixed box would make half of them look wrong. */
.cci-logo { display:block; width:auto; max-width:100%; object-fit:contain; }
.cci-logo--nicsc    { height:44px; }
.cci-logo--techfirst{ height:28px; }
.cci-logo--zerodays { height:40px; }
.cci-logo--swc      { height:50px; }
.cci-logo--src      { height:46px; }
.cci-logo--mtu      { height:48px; }
.cci-logo--tudublin { height:52px; }
.cci-logo--setu     { height:44px; }
.cci-logo--grosafe  { height:34px; }
@media (max-width:36rem) {
  .cci-partners { padding-inline:1rem; }
  .cci-partners__strip { gap:1.6rem 1rem; }
  .cci-logo { height:32px; }
  .cci-logo--swc, .cci-logo--tudublin { height:40px; }
  .cci-logo--mtu { height:36px; }
  .cci-logo--grosafe { height:30px; }
  .cci-logo--techfirst { height:22px; }
}
