/* Inter and Fira Code 5.3.0 from Fontsource. The OFL licenses are in fonts/. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("fonts/fira-code-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("fonts/fira-code-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --text: #1c2024;
  --muted: #5e5548;
  --border: #dfe3e8;
  --surface: #f6f7f9;
  --peach: #ffd8be;
  --apricot: #e8935a;
  --paper: #fffdf6;
  --error: #b3261e;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

/* Ligatures are off, so "!=" in code or a file shows as the user typed it. */
h1,
h2,
h3,
.logo,
.nav-link,
.profile-link,
.account button,
.num,
.invite-field input,
code,
pre {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

.num {
  font-size: 14px;
}

/* Links have the same color as the text, so an underline identifies them. */
a {
  color: var(--text);
  text-decoration: underline 1px var(--text);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 16px;
  font-size: 28px;
}

h2 {
  margin: 32px 0 12px;
  font-size: 20px;
}

h3 {
  margin: 24px 0 8px;
  font-size: 16px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 24px;
  /* With the 1px border of the header, the bar is 64px high. */
  min-height: 63px;
  max-width: 960px;
  margin: 0 auto;
  padding: 11px 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.logo-mark {
  flex: none;
}

.nav-link {
  color: var(--muted);
}

.signup-link {
  color: var(--text);
  font-weight: 600;
}

.logo,
.nav-link,
.signup-link,
.profile-link,
.tabs a,
.button,
.challenge-card h2 a {
  text-decoration: none;
}

.challenge-card h2 a:hover {
  text-decoration: underline 2px var(--text);
}

.nav-link:hover {
  color: var(--text);
}

.signup-link:hover {
  color: var(--muted);
}

.account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account form {
  margin: 0;
}

.avatar {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.profile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

/* Home page */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 0 80px;
  text-align: center;
}

.hero-boxer {
  width: 340px;
  max-width: 100%;
  height: auto;
  margin-bottom: 32px;
}

.hero-spark {
  fill: var(--apricot);
}

.hero h1 {
  margin-bottom: 16px;
  font-size: 48px;
}

.hero p {
  max-width: 520px;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 18px;
}

.button.button-primary {
  padding: 10px 20px;
  border-color: var(--text);
  background: var(--text);
  color: var(--paper);
}

.button.button-primary:hover {
  border-color: var(--muted);
  background: var(--muted);
  color: var(--paper);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 0;
  padding: 32px 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
}

.steps h2 {
  margin: 4px 0;
  font-size: 16px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* Challenge list and challenge page header */

.challenge-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 30px;
}

.challenge-card,
.challenge-header {
  display: flex;
  gap: 24px;
}

.challenge-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 25.92px;
}

.challenge-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.challenge-card p {
  margin: 0 0 8px;
  color: var(--muted);
}

.challenge-header {
  padding-bottom: 24px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tabs a {
  margin-bottom: -1px;
  padding-bottom: 10px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
}

.tabs a:hover {
  color: var(--text);
  text-decoration: none;
}

.tabs a.active {
  border-bottom-color: var(--text);
  color: var(--text);
  font-weight: 600;
}

.thumb {
  flex: none;
  display: block;
  width: 200px;
  height: 150px;
  border-radius: 17.28px;
  background: var(--surface);
  object-fit: cover;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0;
}

.facts div {
  display: flex;
  gap: 6px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-weight: 600;
}

/* Profile */

.profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.profile-summary {
  flex: 1 1 200px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-github {
  flex: none;
}

.info-line {
  margin: 4px 0;
}

.section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin: 32px 0 12px;
}

.section-title h2 {
  margin: 0;
}

.section-title a {
  font-size: 15px;
}

.profile-form {
  max-width: 480px;
}

.profile-form .note {
  font-weight: 400;
}

.profile-header h1 {
  margin-bottom: 4px;
}

.profile-header p {
  margin: 0;
  color: var(--muted);
}

.avatar-large {
  flex: none;
  width: 96px;
  height: 96px;
  border-radius: 50%;
}

.note {
  color: var(--muted);
  font-size: 15px;
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

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

th {
  color: var(--muted);
  font-weight: 600;
}

th.align-right,
td.align-right {
  text-align: right;
}

.my-team td {
  background: var(--peach);
}

.my-team td:first-child {
  box-shadow: inset 3px 0 0 var(--apricot);
}

.my-team .team-name {
  font-weight: 700;
}

/* Forms */

label {
  display: block;
  margin-bottom: 16px;
  font-weight: 600;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

label input,
label textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8.64px;
  font-weight: 400;
}

label input[readonly] {
  background: var(--surface);
  color: var(--muted);
}

button,
.button {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--text);
  border-radius: 8.64px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

button:hover,
.button:hover {
  text-decoration: none;
  border-color: var(--muted);
  color: var(--muted);
}

.quiet,
.quiet:hover {
  border-color: var(--border);
  color: var(--text);
}

.quiet:hover {
  border-color: var(--muted);
}

button:disabled,
button:disabled:hover {
  border-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

.contact {
  max-width: 560px;
}

.legal {
  max-width: 672px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: break-word;
}

.legal h1,
.legal h2,
.legal dt {
  color: var(--text);
}

.legal h1 {
  margin-bottom: 8px;
}

.legal h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.legal p {
  margin: 12px 0;
}

.legal-intro {
  margin-bottom: 32px;
}

.legal-intro span {
  display: block;
  margin-top: 4px;
}

.legal section {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.legal-rows {
  margin: 0;
}

.legal-rows div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.legal-rows div:last-child {
  border-bottom: 0;
}

.legal-rows dd {
  margin: 0;
  text-align: right;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.site-footer a,
.site-footer a:hover {
  color: inherit;
  text-decoration: none;
}

/* Team */

.team-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  overflow-wrap: anywhere;
}

.avatars {
  display: inline-flex;
  flex: none;
}

.avatars a {
  display: block;
  margin-left: -6px;
}

.avatars a:first-child {
  margin-left: 0;
}

.avatars img,
.avatar-letter {
  display: block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  box-sizing: content-box;
}

.avatar-letter {
  background: var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
}

td .team-cell {
  flex-wrap: nowrap;
}

.team-summary {
  margin-bottom: 16px;
}

.invite-field {
  margin-bottom: 4px;
}

.invite-field input {
  font-size: 14px;
}

.team-settings {
  margin-top: 16px;
}

.team-settings summary {
  color: var(--muted);
  cursor: pointer;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  margin-top: 12px;
}

.inline-form label {
  flex: 1 1 240px;
  margin-bottom: 0;
}

/* Submit panel */

.submit-panel {
  margin-top: 32px;
}

.team-panel,
.submit-panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12.96px;
}

.team-panel h2,
.submit-panel h2 {
  margin-top: 0;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 12px;
  padding: 32px 16px;
  border: 1px dashed var(--muted);
  border-radius: 12.96px;
  background: var(--surface);
  text-align: center;
  overflow-wrap: anywhere;
}

.dropzone:hover,
.dropzone:focus-within {
  border-color: var(--text);
}

/* The file input covers the zone, so the browser handles both the click and the drop. */
.dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.form-error {
  margin: 0 0 12px;
  color: var(--error);
}

.panel-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 24px;
}

.panel-title h3 {
  margin: 0 0 8px;
}

.usage {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.file-cell {
  overflow-wrap: anywhere;
}

.date-cell {
  color: var(--muted);
  white-space: nowrap;
}

.status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 8.64px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.status-queued {
  background: var(--surface);
  color: var(--muted);
}

.status-running {
  background: #e3effa;
  color: var(--text);
}

.status-done {
  background: #e4f4e8;
  color: #1a6b34;
}

.status-failed {
  background: #fbe9e7;
  color: var(--error);
}

.score-name {
  color: var(--muted);
}

td pre {
  max-width: 480px;
  margin: 8px 0 0;
}

/* Subject text */

.subject {
  overflow-wrap: anywhere;
}

code,
pre {
  font-size: 14px;
}

code {
  padding: 1px 4px;
  border-radius: 6.48px;
  background: var(--surface);
}

pre {
  overflow-x: auto;
  padding: 12px;
  border-radius: 8.64px;
  background: var(--surface);
}

pre code {
  padding: 0;
}

.math.block {
  overflow-x: auto;
}

td details summary {
  cursor: pointer;
  color: var(--error);
}

@media (max-width: 600px) {
  .hero {
    padding: 32px 0 48px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .challenge-card,
  .challenge-header {
    flex-direction: column;
    gap: 12px;
  }

  .thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  th,
  td {
    padding: 6px;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .team-panel,
  .submit-panel {
    padding: 16px;
  }

  .id-cell,
  .date-cell {
    display: none;
  }

  .file-cell {
    min-width: 88px;
  }

  .status {
    white-space: normal;
  }
}
