:root {
  --bg: #f3f2ef;
  --surface: #e4e2dc;
  --ink: #1a1a1a;
  --bg-ink: #f3f2ef;
  --margin: clamp(20px, 3vw, 32px);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --font: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--ink) var(--bg);
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.5;
  font-optical-sizing: auto;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--ink); }

[hidden] { display: none !important; }

h1 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-wrap: balance;
  max-width: 18ch;
}

p { margin: 0; }

a {
  color: var(--ink);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.06em;
}

img { display: block; max-width: 100%; }

::selection { background: var(--ink); color: var(--bg-ink); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.nums { font-variant-numeric: tabular-nums; }

.skip {
  position: absolute;
  left: var(--margin);
  top: -48px;
  background: var(--bg);
  color: var(--ink);
  padding: 10px 14px;
  z-index: 5;
}

.skip:focus { top: 12px; }

.wordmark {
  color: var(--ink);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px 28px;
  flex-wrap: wrap;
  padding: 22px var(--margin);
  background: var(--bg);
}

.bar-nav,
.bar-nav form {
  display: flex;
  align-items: center;
  gap: 8px 22px;
  margin: 0;
}

.bar-nav a,
.text-btn {
  color: var(--ink);
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.06em;
  transition: text-decoration-color 180ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .bar-nav a:hover,
  .text-btn:hover,
  .aside a:hover { text-decoration-color: currentColor; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 48px;
  min-width: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--bg-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms var(--ease), transform 140ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #000; color: var(--bg-ink); }
}

.btn:active { transform: scale(0.96); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.home,
.page {
  padding: clamp(48px, 12vh, 140px) var(--margin) 96px;
}

.home h1 {
  font-size: clamp(4.5rem, 18vw, 6rem);
  max-width: none;
}

.home .btn,
.page .btn,
.page form { margin-top: 36px; }

.home .lead {
  max-width: 36rem;
  margin-top: 20px;
}

.page { max-width: 40rem; }
.page-wide { max-width: 52rem; }

.lead { max-width: 38rem; }

.hint,
.meta {
  margin-top: 14px;
}

.notice {
  background: var(--surface);
  padding: 16px 18px;
  margin-top: 24px;
  max-width: 36rem;
}

.aside { margin-top: 22px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 22px 0 0;
}

.page form > .field:first-of-type { margin-top: 0; }

.field input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  caret-color: var(--ink);
}

.field input[type="file"] {
  min-height: 44px;
  padding: 8px 0;
  background: transparent;
  cursor: pointer;
}

.check {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 0;
  max-width: 36rem;
  min-height: 44px;
  cursor: pointer;
}

.check input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--ink);
  flex: none;
}

.sheet-head {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 20px 32px;
  flex-wrap: wrap;
}

.sheet-head .btn { margin-top: 0; }

.job-list { margin-top: 28px; }

.job-line {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 8rem 9rem;
  width: max-content;
  max-width: 100%;
  gap: 8px 28px;
  align-items: baseline;
  padding: 18px 0;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.25;
}

.job-name {
  overflow-wrap: anywhere;
  min-width: 0;
}

.job-state,
.job-date { font-size: 1.125rem; }

@media (hover: hover) and (pointer: fine) {
  .job-line:hover .job-name { text-decoration: underline; text-underline-offset: 0.14em; }
}

.progress { margin-top: 28px; max-width: 28rem; }

.track {
  margin-top: 10px;
  height: 12px;
  background: var(--surface);
  overflow: hidden;
}

.fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 140ms var(--ease);
}

.indeterminate {
  margin-top: 28px;
  height: 12px;
  max-width: 240px;
  background: var(--surface);
  overflow: hidden;
}

.indeterminate span {
  display: block;
  height: 100%;
  width: 38%;
  background: var(--ink);
}

@media (max-width: 640px) {
  .job-line {
    width: 100%;
    grid-template-columns: 1fr auto;
  }

  .job-name { grid-column: 1 / -1; }

  .home h1 { font-size: clamp(3.25rem, 18vw, 4.5rem); }
}

@media (prefers-reduced-motion: no-preference) {
  .indeterminate span {
    animation: slide 1.3s var(--ease) infinite;
  }
}

@keyframes slide {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:active { transform: none; }
  .indeterminate span { width: 100%; }
}
