@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600 800;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/InstrumentSerif-Italic.woff2') format('woff2');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4f1e8;
  --paper-raised: #faf7ef;
  --ivory: #f4f1e8;
  --ivory-deep: #e9e4d8;
  --ink: #191d23;
  --muted: #59616b;
  --line: #d7d1c4;
  --graphite: #171b21;
  --graphite-deep: #0f1318;
  --graphite-raised: #242a32;
  --graphite-line: #333c46;
  --paper-ink: #eeeae0;
  --paper-muted: #aab4bc;
  --accent: #e07a4c;
  --accent-dark: #8a3a0c;
  --accent-display: #b4490d;
  --accent-mid: #c8580a;
  --accent-light: #ffc4a6;
  --accent-mist: #ffe2d2;
  --accent-ink: #8a3a0c;
  --plate-mat: #e5ded1;
  --header-bg: rgb(244 241 232 / 88%);
  --amber: #ebc874;
  --added: #a8c98e;
  --working: #8fc7d6;
  --failed: #ec959c;
}

:root[data-theme='light'] {
  color-scheme: light;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #12181d;
  --paper-raised: #182027;
  --ivory: #12181d;
  --ivory-deep: #1b242b;
  --ink: #ece9e1;
  --muted: #a3adb5;
  --line: #303a42;
  --graphite: #161d23;
  --graphite-deep: #0b1014;
  --graphite-raised: #232d34;
  --graphite-line: #36434b;
  --paper-ink: #f0ece3;
  --paper-muted: #b4bec5;
  --accent: #e58a60;
  --accent-dark: #f0a078;
  --accent-display: #f0a078;
  --accent-mid: #e07a4c;
  --accent-light: #ffc4a6;
  --accent-mist: #ffe2d2;
  --accent-ink: #8a3a0c;
  --plate-mat: #29323a;
  --header-bg: rgb(18 24 29 / 88%);
}

.theme-toggle {
  display: inline-flex;
  min-width: 82px;
  min-height: 40px;
  padding: 8px 13px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: 10px/1.4 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: border-color 160ms ease, color 160ms ease;
}

/* The script is the only owner of the toggle's label; hide it until it has run. */
.theme-toggle[data-theme-pending] {
  visibility: hidden;
}

.theme-toggle:hover {
  color: var(--accent-dark);
}

.theme-toggle::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--theme-icon) center / contain no-repeat;
  mask: var(--theme-icon) center / contain no-repeat;
}

.theme-toggle[aria-pressed='true'] {
  --theme-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='2.4' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Cpath d='M8 1.4v2.2M8 12.4v2.2M1.4 8h2.2M12.4 8h2.2M3.3 3.3l1.6 1.6M11.1 11.1l1.6 1.6M12.7 3.3l-1.6 1.6M4.9 11.1l-1.6 1.6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.theme-toggle[aria-pressed='false'] {
  --theme-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9.4 1.7A5.4 5.4 0 1 0 14.3 9 4.1 4.1 0 0 1 9.4 1.7z' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 4px;
}

[data-theme='dark'] .brand img {
  filter: brightness(0) invert(1);
}

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 320ms;
    animation-timing-function: ease;
  }
}
