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

:root {
  color-scheme: light dark;

  --light-color: #f4eeeb;
  --dark-color: #653449;
  --light-color-lighter: color-mix(in oklch, var(--light-color), #fff 10%);
  --light-color-darker: color-mix(in oklch, var(--light-color), #000 10%);
  --light-color-translucent: color-mix(
    in srgb,
    var(--light-color),
    transparent 25%
  );
  --dark-color-lighter: color-mix(in oklch, var(--dark-color), #fff 10%);
  --dark-color-darker: color-mix(in oklch, var(--dark-color), #000 10%);
  --dark-color-translucent: color-mix(
    in srgb,
    var(--dark-color),
    transparent 25%
  );

  --color-bg: var(--light-color);
  --color-bg-alt: var(--light-color-darker);
  --color-text: var(--dark-color);
  --color-text-muted: var(--dark-color-lighter);
  --color-muted: color-mix(in oklab, var(--color-text), var(--color-bg));
  --color-border: color-mix(in oklab, var(--color-text) 30%, var(--color-bg));
  --color-accent: color-mix(in oklab, var(--color-text) 80%, var(--color-bg));

  --input-bg-color: var(--light-color);
  --input-text-color: var(--dark-color);
  --input-border-color: var(--color-border);
  --input-padding: 0.5rem;

  --footer-bg: color-mix(
    in srgb,
    var(--dark-color-translucent),
    transparent 20%
  );
  --footer-text: var(--light-color);
  --footer-text-hover: var(--light-color-lighter);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: var(--dark-color);
    --color-bg-alt: var(--dark-color-darker);
    --color-text: var(--light-color);
    --color-text-muted: var(--light-color-lighter);
    --color-muted: color-mix(in oklab, var(--color-text), var(--color-bg));
    --color-border: color-mix(in oklab, var(--color-text) 30%, var(--color-bg));
    --color-accent: color-mix(in oklab, var(--color-text) 80%, var(--color-bg));

    --input-bg-color: var(--dark-color);
    --input-text-color: var(--light-color);

    --footer-bg: color-mix(
      in srgb,
      var(--light-color-translucent),
      transparent 20%
    );
    --footer-text: var(--dark-color);
    --footer-text-hover: var(--dark-color-darker);
  }
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  margin-block: 2rem 3rem;
  min-block-size: 100vh;
}

header,
main {
  margin-inline: auto;
  max-inline-size: 37.5rem;
  inline-size: calc(100% - 2rem);
}

header {
  margin-block-end: 2rem;
  padding-block-end: 1rem;
}

h1 {
  color: var(--color-accent);
  font-size: 2rem;
  letter-spacing: 0.025em;
  line-height: 1.2;
  margin-block-end: 0.25rem;
}

.lead {
  color: var(--color-muted);
  font-size: 1rem;
}

code {
  background: var(--dark-color-translucent);
  border-radius: 0.1875rem;
  color: var(--light-color);
  font-family: "Courier New", monospace;
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  word-break: break-word;
}

.unsupported-message {
  display: none;
  background: var(--light-color-lighter);
  border: thin solid var(--color-border);
  border-radius: 0.25rem;
  margin-block-end: 1.5rem;
  padding-block: 0.75rem;
  padding-inline: 1rem;
}

@media (prefers-color-scheme: dark) {
  .unsupported-message {
    background: var(--dark-color-darker);
  }
}

@supports not (appearance: base-select) {
  .unsupported-message {
    display: block;
  }
}

.form-group {
  margin-block-end: 1.5rem;
  position: relative;
}

label {
  color: var(--dark-color);
  display: block;
  font-weight: 500;
  margin-block-end: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  label {
    color: var(--light-color);
  }
}

select {
  appearance: base-select;
  background: var(--input-bg-color);
  border: thin solid var(--input-border-color);
  border-radius: 0.25rem;
  color: var(--input-text-color);
  font-family: inherit;
  font-size: 1rem;
  line-height: inherit;
  padding: var(--input-padding);
  transition: background-color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
  inline-size: 100%;
}

select:focus {
  outline: none;
}

select::picker(select) {
  appearance: base-select;
  background: var(--input-bg-color);
  border: thin solid var(--input-border-color);
  border-radius: 0.25rem;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.1);
  margin-block-start: 0.25rem;
  max-block-size: 30rem;
  overflow-y: auto;
  padding: 0.5rem;
}

select option {
  background: transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  list-style: none;
  margin-block-end: 0.5rem;
  padding: 0;
}

select option::checkmark {
  display: none !important;
  visibility: hidden !important;
  content: "" !important;
  inline-size: 0 !important;
}

select option:checked::before,
select option::before,
select option::-webkit-details-marker,
select option::marker {
  content: "" !important;
  display: none !important;
  visibility: hidden !important;
  inline-size: 0 !important;
  block-size: 0 !important;
}

.model-option::before {
  display: none !important;
}

select option:last-child {
  margin-block-end: 0;
}

select option:hover {
  background: var(--color-bg-alt);
}

select option:checked {
  background: var(--color-bg-alt);
}

.model-option {
  align-items: center;
  column-gap: 1rem;
  display: grid;
  grid-template-columns: 4rem 1fr 5rem 4rem;
  padding: 0.75rem;
  inline-size: 100%;
}

.model-preview {
  aspect-ratio: 1;
  background: var(--color-bg-alt);
  border: thin solid var(--color-border);
  border-radius: 0.25rem;
  block-size: 4rem;
  overflow: hidden;
  inline-size: 4rem;
}

.model-canvas {
  display: block;
  block-size: 100%;
  inline-size: 100%;
}

.model-info {
  min-inline-size: 0;
}

.model-name {
  color: var(--color-accent);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  margin-block-end: 0.25rem;
}

.model-details {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.3;
}

.model-size {
  color: var(--color-text);
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  text-align: right;
  white-space: nowrap;
}

.model-type {
  background: var(--dark-color-translucent);
  border-radius: 0.1875rem;
  color: var(--light-color);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.375rem;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.preview-section {
  background: var(--light-color-lighter);
  border: thin solid var(--color-border);
  border-radius: 0.5rem;
  margin-block-start: 1.5rem;
  padding: 1rem;
  position: relative;
}

@media (prefers-color-scheme: dark) {
  .preview-section {
    background: var(--dark-color-darker);
  }
}

.preview-section h2 {
  color: var(--color-accent);
  font-size: 1.25rem;
  letter-spacing: 0.025em;
  line-height: 1.2;
  margin-block-end: 1rem;
}

.info-toggle {
  appearance: none;
  background: var(--color-bg);
  border: thin solid var(--color-border);
  border-radius: 0.25rem;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 1.5rem;
  block-size: 1.5rem;
  padding: 0;
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-end: 1rem;
  transition: all 0.2s ease;
}

.info-toggle span {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.info-toggle:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.info-toggle:focus-visible {
  outline: 0.125rem solid var(--color-accent);
  outline-offset: 0.125rem;
}

.info-toggle svg {
  display: block;
}

.tech-details {
  background: var(--color-bg);
  border: thin solid var(--color-border);
  border-radius: 0.25rem;
  margin-block-start: 1rem;
  padding: 1rem;
}

.tech-details h3 {
  color: var(--color-accent);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-block-end: 0.75rem;
  text-transform: uppercase;
}

.tech-details dl {
  display: grid;
  gap: 0.5rem 1rem;
  grid-template-columns: max-content auto;
}

.tech-details dt {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: right;
}

.tech-details dd {
  color: var(--color-text);
  font-size: 0.8125rem;
  margin: 0;
}

.selected-preview {
  background: var(--color-bg-alt);
  border: thin solid var(--color-border);
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  block-size: 20rem;
  margin-inline: auto;
  margin-block-end: 1rem;
  max-inline-size: 20rem;
  overflow: hidden;
}

.selected-canvas {
  display: block;
  block-size: 100%;
  inline-size: 100%;
}

.selected-info {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.resources-layer {
  position: fixed;
  inset-block-end: 0;
  inset-inline-end: 0;
  z-index: 1000;
  pointer-events: none;
}

.resources {
  backdrop-filter: blur(0.375rem);
  background: var(--footer-bg);
  display: grid;
  grid-auto-flow: column;
  gap: 0;
  font-size: 0.75rem;
  line-height: 1.3;
  padding-block: 0.375rem;
  padding-inline: 0.625rem;
  pointer-events: auto;
}

.resources a {
  color: var(--footer-text);
  text-decoration: none;
  padding-inline: 0.5rem;
  border-inline-start: thin solid
    color-mix(in srgb, currentColor, transparent 50%);
  transition: color 0.25s ease, opacity 0.25s ease;
}

.resources a:first-child {
  border: none;
}

.resources a:hover,
.resources a:focus-visible {
  color: var(--footer-text-hover);
  opacity: 0.85;
}

@media (max-width: 40em) {
  body {
    margin-block: 1rem 2rem;
  }

  header,
  main {
    inline-size: calc(100% - 1rem);
  }

  .selected-preview {
    block-size: 16rem;
    max-inline-size: 16rem;
  }
}