/*
Font settings:

Ligatures:       "ss01": true,
Arrows:          "ss02": true,
Smart Case:      "ss03": true,
Symbol Spacing:  "ss04": true,
Smart Kerning:   "ss05": true,

Alternate 'a':                "cv01": false,
Alternate 'g':                "cv02": true,
Square Dots:                  "cv03": false,
Alternate 'i':                "cv04": false,
Standard '@':                 "cv05": false,
Alternate '6' & '9':          "cv06": true,
Dotted '0':                   "cv07": false,
Alternate 'aefgy' in italic:  "cv08": false,
Lifted: '*':                  "cv09": true,
Alternate 'l':                "cv10": false,
Alternate '1':                "cv11": true
*/

/*

"#ab9df2" -> Purple
"#ffccff" -> Pink
"#78dce8" -> Blue
"#a9dc76" -> Green
"#ffd866" -> Yellow
"#fc9867" -> Orange
"#ff6188" -> Red
*/

@font-face {
  font-family: "CommitMono";
  src: url("/CommitMono.woff2") format("woff2");
}

:root {
  /* Typography */
  --font-family: "CommitMono", "Roboto Mono", Menlo, Courier, Consolas, Monaco, "Liberation Mono", "Lucida Console",
    monospace;
  --font-feature-settings: "ss01", "ss02", "ss03", "ss04", "ss05", "cv02", "cv06", "cv09", "cv11";
  --font-size: 16px;
  --line-height: 1.2rem;
  --font-weight-normal: 400;
  --font-weight-medium: 600;
  --font-weight-bold: 800;

  /* Colours */
  --font-light: #fcfcfc; /* off-white */
  --font-light-alt: #827878; /* off-white */
  --font-dark: #000000; /* black */
  --font-dark-alt: #827878; /* off-white */
  --bg-light: #fffbed; /* off-white */
  --bg-dark: #212121; /* off-black */
  --link: #0d47a1; /* dark blue */
  --link-hover: #1266e2; /* light blue */
  --success-light: #a9dc76; /* green */
  --success-dark: #98c66a; /* green */
  --failure-light: #ff6188; /* red */
  --failure-dark: #e5577a; /* red */
  --warning-light: #ffd866; /* yellow */
  --warning-dark: #e5c25b; /* yellow */
  --danger-light: #fc9867; /* orange */
  --danger-dark: #e2885c; /* orange */
  --disabled-light: #939293; /* grey */
  --disabled-dark: #474448; /* grey */

  /* Variables */
  --border-radius: 5px;
  --border-thickness: 2px;
  font-variant-numeric: tabular-nums lining-nums;
  text-decoration-thickness: var(--border-thickness);
  --status-marker-size: 20px;

  --background-color: var(--bg-light);
  --text-color: var(--font-dark);
  --text-color-alt: var(--font-dark-alt);
  --highlight-font-color: var(--font-dark);
  --highlight-background-color: var(--danger);
  --button-background-hover: var(--bg-dark);
  --button-text-hover: var(--font-light);
  --success: var(--success-dark);
  --failure: var(--failure-dark);
  --warning: var(--warning-dark);
  --danger: var(--danger-dark);
  --disabled: var(--disabled-light);
}

/* @media (prefers-color-scheme: dark) {
  :root {
    --background-color: var(--bg-dark);
    --text-color: var(--font-light);
    --text-color-alt: var(--font-dark-alt);
    --highlight-font-color: var(--font-dark);
    --highlight-background-color: var(--warning);
    --button-background-hover: var(--bg-light);
    --button-text-hover: var(--font-dark);
    --success: var(--success-light);
    --failure: var(--failure-light);
    --warning: var(--warning-light);
    --danger: var(--danger-light);
    --disabled: var(--disabled-light);
  }
} */

/* Reset */
/* Box sizing and font smoothing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  line-height: var(--line-height);
  min-height: 100vh;
}

/* Remove default margin in favour of better control in authored CSS */
* {
  margin: 0;
}

/* Set shorter line heights for headings and interactives */
h1,
h2,
button,
label {
  line-height: var(--line-height);
}

/* Avoid text overflows */
p,
h1,
h2 {
  overflow-wrap: break-word;
}

/* Text wrapping on headings */
h1,
h2 {
  text-wrap: balance;
}

/* Improve media defaults */
img,
picture,
svg {
  display: block;
  max-width: 100%;
}

/* Improve content defaults */
footer,
header,
nav,
section {
  display: block;
}

/* Remove built-in form typography styles */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove default styling on lists */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* anchor elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  /* This messes with the default */
  color: currentColor;
}

/* textareas without a rows shouldn't be tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

/* Stacking for JS */
#root {
  isolation: isolate;
}

/*****************/
/* Default Theme */

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-delay: -1ms !important;
    animation-duration: -1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}

* + * {
  margin-top: var(--line-height);
}

/*
  We only want to use h1 and h2 for headers, p and textarea for text.
*/
html {
  font-size: var(--font-size);
  font-family: var(--font-family);
  font-feature-settings: var(--font-feature-settings);
  -moz-font-feature-settings: var(--font-feature-settings);
  -webkit-font-feature-settings: var(--font-feature-settings);

  display: flex;
  width: 100%;
  padding: 0;
  flex-direction: column;
  align-items: center;
  background: var(--background-color);
  color: var(--text-color);
}

body {
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  line-height: var(--line-height);
  position: relative;
  width: 100%;

  padding: var(--line-height) 2ch;
  max-width: calc(min(80ch, round(down, 100%, 1ch)));
}

@media screen and (max-width: 480px) {
  :root {
    font-size: 14px;
  }
  body {
    padding: var(--line-height) 1ch;
  }
}

::-webkit-scrollbar {
  height: var(--line-height);
}

/* Link Styling */
a {
  color: var(--link);
  outline: none;
  text-decoration-skip: ink edges;
  text-decoration-thickness: var(--border-thickness);
}

a:focus {
  box-shadow: 0 0 0 0.1rem rgba(0, 0, 0, 0.2);
}

a:focus,
a:hover,
a:active,
a.active {
  text-decoration: underline;
  color: var(--link-hover);
  cursor: pointer;
}

/* a:link,
a:visited {
  color: var(--text-color);
} */

/* Text Styling*/
h1,
h2 {
  font-size: 1.2rem;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height);
  margin: calc(var(--line-height) * 2) 0 var(--line-height);
  color: inherit;
}

h1 {
  font-size: 2rem;
  line-height: calc(2 * var(--line-height));
  margin-bottom: calc(var(--line-height) * 2);
  text-transform: uppercase;
}
h2 {
  font-size: 1rem;
  text-transform: uppercase;
}

p {
  margin-bottom: var(--line-height);
  /* word-break: break-word;
  word-wrap: break-word;
  hyphens: auto; */
}

strong {
  font-weight: var(--font-weight-bold);
}

em {
  font-style: italic;
}

small {
  font-size: 0.7rem;
}

/* List Styling */
ul,
ol {
  margin: 0 0 var(--line-height);
  padding: 0;
}

ul {
  list-style-type: decimal;
  padding: 0 0 0 2ch;
}
ol {
  list-style-type: disc;
  counter-reset: item;
  padding: 0;
}
ol ul,
ol ol,
ul ol,
ul ul {
  padding: 0 0 0 3ch;
  margin: 0;
}
ol li:before {
  content: counters(item, ".") ". ";
  counter-increment: item;
  font-weight: var(--font-weight-medium);
}

li {
  margin: 0;
  padding: 0;
}

li::marker {
  line-height: 0;
}

/* Highlighted Text */
mark {
  padding: 0.05rem 0.1rem 0;
  color: var(--font-);
  border-bottom: 0.05rem solid var(--background-color);
  border-radius: 0;
  background: var(--highlight-background-color);
}

/* Double Line Horizontal Rule */
hr {
  position: relative;
  display: block;
  height: var(--line-height);
  margin: calc(var(--line-height) * 1.5) 0;
  border: none;
  color: var(--text-color);
}

hr:after {
  display: block;
  content: "";
  position: absolute;
  top: calc(var(--line-height) / 2 - var(--border-thickness));
  left: 0;
  width: 100%;
  border-top: calc(var(--border-thickness) * 3) double var(--text-color);
  height: 0;
}

/* Aligned Table */
table {
  position: relative;
  top: calc(var(--line-height) / 2);
  width: calc(round(down, 100%, 1ch));
  border-collapse: collapse;
  margin: 0 0 calc(var(--line-height) * 2);
}

th,
td {
  border: var(--border-thickness) solid var(--text-color);
  padding: calc((var(--line-height) / 2)) calc(1ch - var(--border-thickness) / 2)
    calc((var(--line-height) / 2) - (var(--border-thickness)));
  line-height: var(--line-height);
  vertical-align: top;
  text-align: left;
}
table tbody tr:first-child > * {
  padding-top: calc((var(--line-height) / 2) - var(--border-thickness));
}

th {
  font-weight: var(--font-weight-medium);
}
.width-min {
  width: 0%;
}
.width-auto {
  width: 100%;
}

.header {
  margin-bottom: calc(var(--line-height) * 2);
}
.header h1 {
  margin: 0;
}
.header tr td:last-child {
  text-align: right;
}

/* Layout Grid */
.grid {
  --grid-cells: 0;
  display: flex;
  gap: 1ch;
  width: calc(round(down, 100%, (1ch * var(--grid-cells)) - (1ch * var(--grid-cells) - 1)));
  margin-bottom: var(--line-height);
}

.grid > *,
.grid > input {
  flex: 0 0 calc(round(down, (100% - (1ch * (var(--grid-cells) - 1))) / var(--grid-cells), 1ch));
}
.grid:has(> :last-child:nth-child(1)) {
  --grid-cells: 1;
}
.grid:has(> :last-child:nth-child(2)) {
  --grid-cells: 2;
}
.grid:has(> :last-child:nth-child(3)) {
  --grid-cells: 3;
}
.grid:has(> :last-child:nth-child(4)) {
  --grid-cells: 4;
}
.grid:has(> :last-child:nth-child(5)) {
  --grid-cells: 5;
}
.grid:has(> :last-child:nth-child(6)) {
  --grid-cells: 6;
}
.grid:has(> :last-child:nth-child(7)) {
  --grid-cells: 7;
}
.grid:has(> :last-child:nth-child(8)) {
  --grid-cells: 8;
}
.grid:has(> :last-child:nth-child(9)) {
  --grid-cells: 9;
}
.grid:has(> :last-child:nth-child(10)) {
  --grid-cells: 10;
}
.grid:has(> :last-child:nth-child(11)) {
  --grid-cells: 11;
}
.grid:has(> :last-child:nth-child(12)) {
  --grid-cells: 12;
}

/* Media Styling */
img,
video {
  display: block;
  width: 100%;
  object-fit: contain;
  overflow: hidden;
}

/* Pop Down Section */
details {
  border: var(--border-thickness) solid var(--text-color);
  padding: calc(var(--line-height) - var(--border-thickness)) 1ch;
  margin-bottom: var(--line-height);
}

summary {
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}
details[open] summary {
  margin-bottom: var(--line-height);
}

details ::marker {
  display: inline-block;
  content: "▶";
  margin: 0;
}
details[open] ::marker {
  content: "▼";
}

details :last-child {
  margin-bottom: 0;
}

/* Different Block Styles */
pre {
  white-space: pre;
  overflow-x: auto;
  margin: var(--line-height) 0;
  overflow-y: hidden;
}

pre,
code {
  font-family: var(--font-family);
}

code {
  font-weight: var(--font-weight-medium);
}

/* Inputs */
label {
  display: block;
  width: calc(round(down, 100%, 1ch));
  height: auto;
  line-height: var(--line-height);
  font-weight: var(--font-weight-medium);
  margin: 0;
}

label input {
  width: 100%;
}

input,
button,
textarea {
  border: var(--border-thickness) solid var(--text-color);
  padding: calc(var(--line-height) / 2 - var(--border-thickness)) calc(1ch - var(--border-thickness));
  margin: 0;
  font: inherit;
  font-weight: inherit;
  height: calc(var(--line-height) * 2);
  width: auto;
  overflow: visible;
  background: var(--background-color);
  color: var(--text-color);
  line-height: normal;
  -webkit-font-smoothing: inherit;
  -moz-osx-font-smoothing: inherit;
  -webkit-appearance: none;
}

input[type="checkbox"] {
  display: inline-grid;
  place-content: center;
  vertical-align: top;
  width: 2ch;
  height: var(--line-height);
  cursor: pointer;
}

input[type="checkbox"]:checked:before {
  content: "";
  width: 1ch;
  height: calc(var(--line-height) / 2);
  background: var(--text-color);
}

input {
  width: calc(round(down, 100%, 1ch));
}

input:focus {
  --border-thickness: 3px;
  outline: none;
}

::placeholder {
  color: var(--text-color-alt);
  opacity: 1;
}

::-ms-input-placeholder {
  color: var(--text-color-alt);
}

/* Button */
button:focus {
  --border-thickness: 3px;
  outline: none;
}

button::-moz-focus-inner {
  padding: 0;
  border: 0;
}

button {
  text-transform: uppercase;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

button:hover {
  background: var(--button-background-hover);
  color: var(--button-text-hover);
}
button:active {
  transform: translate(2px, 2px);
}

/* Alternative Grid Layout using data-grid */
/* Usage Example
<div data-grid="columns:12 gap:20px">
  <div data-span="12" data-span-md="6" data-span-lg="4" style="background-color: #f0f0f0; padding: 1rem;">
    Column 1
  </div>
  <div data-span="12" data-span-md="6" data-span-lg="4" style="background-color: #e0e0e0; padding: 1rem;">
    Column 2
  </div>
  <div data-span="12" data-span-md="12" data-span-lg="4" style="background-color: #d0d0d0; padding: 1rem;">
    Column 3
  </div>
</div>
*/

/* [data-grid] {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 12), 1fr);
  gap: var(--grid-gap, 1rem);
}

[data-grid] > * {
  grid-column: span var(--span, 12);
}

@media (min-width: 768px) {
  [data-grid] > * {
    grid-column: span var(--span-md, var(--span, 12));
  }
}

@media (min-width: 1024px) {
  [data-grid] > * {
    grid-column: span var(--span-lg, var(--span-md, var(--span, 12)));
  }
} */

.desktop {
  display: block;
}

.tablet {
  display: none;
}

.mobile {
  display: none;
}

/* Tablet Size */
@media (max-width: 771px) and (min-width: 560px) {
  .desktop {
    display: none;
  }

  .tablet {
    display: block;
  }

  .mobile {
    display: none;
  }
}

/* Mobile Size */
@media (max-width: 559px) {
  .desktop {
    display: none;
  }

  .tablet {
    display: none;
  }

  .mobile {
    display: block;
  }
}

/* Utility Classes */
.inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

/* Status Markers & Colours */
/* .status-marker {
  display: inline-block;
  width: var(--status-marker-size);
  max-width: var(--status-marker-size);
  height: var(--status-marker-size);
  max-height: var(--status-marker-size);
  border-radius: 50%;
} */

.status-marker {
  width: var(--status-marker-size);
  max-width: var(--status-marker-size);
  min-width: var(--status-marker-size);
  height: var(--status-marker-size);
  max-height: var(--status-marker-size);
  min-height: var(--status-marker-size);
  clip-path: circle();
}

.success {
  color: var(--success);
}

.bg-success {
  background-color: var(--success);
}

.warning {
  color: var(--warning);
}

.bg-warning {
  background-color: var(--warning);
}

.danger {
  color: var(--danger);
}

.bg-danger {
  background-color: var(--danger);
}

.failure {
  color: var(--failure);
}

.bg-failure {
  background-color: var(--failure);
}

.disabled {
  color: var(--disabled);
}

.bg-disabled {
  background-color: var(--disabled);
}

/* Hover Popup */
/* Hover Popup */
.popup-container {
  position: relative;
  display: inline-block;
  margin-top: 0;
}

.popup-trigger {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.popup-content {
  visibility: hidden;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--background-color);
  color: var(--text-color);
  border: var(--border-thickness) solid var(--text-color);
  padding: calc(var(--line-height) / 2 - var(--border-thickness)) calc(1ch - var(--border-thickness));
  width: calc(round(down, 20ch, 1ch));
  text-align: left;
  line-height: var(--line-height);

  display: flex;
  flex-direction: column;
}

.popup-container:hover .popup-content {
  visibility: visible;
}

/* Arrow */
.popup-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--text-color) transparent transparent transparent;
}

/* History Line */
.history-line {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: calc(var(--border-thickness) * 2);
}

.history-marker {
  width: calc(var(--border-thickness) * 2);
  margin-top: 0;
}

.footer-box {
  position: absolute;
  left: calc(50% - 48ch / 2);
  font-size: 0.7rem;
  line-height: 1.2;
}
