:root {
  --paper: #f6f4ef;
  --paper-deep: #efede5;
  --ink: #202822;
  --muted: #59635a;
  --line: #d4d9d1;
  --accent: #245c43;
  --accent-ink: #f7f6f1;
  --danger: #8a2b21;
  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
  --page: 1180px;
  --pad: 40px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 140ms ease-out;
}

a:hover {
  color: var(--accent);
}

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

button {
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Header and footer */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--page);
  width: 100%;
  margin: 0 auto;
  padding: 20px var(--pad);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
}

.wordmark:hover {
  color: var(--ink);
}

.wordmark-mark {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 13px;
  background: var(--accent);
}

.wordmark-mark::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 6px;
  background: var(--paper);
}

.site-nav {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 14px;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--accent);
}

.nav-form {
  margin: 0;
}

.nav-button {
  border: 0;
  background: none;
  padding: 0;
  font-size: 14px;
  color: inherit;
}

.nav-button:hover {
  color: var(--accent);
}

.nav-strong {
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--page);
  width: 100%;
  margin: 64px auto 0;
  padding: 20px var(--pad) 28px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.footer-note {
  max-width: 34ch;
  text-align: right;
}

/* Shared controls */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 11px 19px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 140ms ease-out,
    border-color 140ms ease-out;
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button-wide {
  width: 100%;
}

.button-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button-quiet:hover {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.text-link {
  font-size: 14px;
  color: var(--accent);
}

.text-link.small {
  font-size: 12px;
}

.link-button {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.link-button:hover {
  color: var(--danger);
}

.notice {
  border-left: 2px solid var(--accent);
  padding: 10px 0 10px 14px;
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--accent);
}

.form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fbfaf6;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

.field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.field-note {
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.field-static p {
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.form-error {
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid #cbb0a8;
  background: #f4e9e5;
  color: #6e231a;
  font-size: 14px;
}

.form-foot {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

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

/* Landing */

.landing {
  max-width: var(--page);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 72px;
  align-items: center;
  padding: 76px 0 68px;
}

.hero-copy h1 {
  max-width: 12ch;
  font-size: clamp(2.7rem, 5.4vw, 4.3rem);
  line-height: 1.02;
}

.lede {
  max-width: 46ch;
  margin-top: 24px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 32px;
}

.specimen {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}

.specimen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.plate-frame {
  display: grid;
  gap: 8px;
}

.plate {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #e8e3d7;
  border: 1px solid rgba(32, 40, 34, 0.16);
}

.plate-sun {
  position: absolute;
  top: 16%;
  left: 56%;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #b45c37;
}

.plate-hill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #2e4a3a;
}

.plate-hill-a {
  height: 56%;
  clip-path: polygon(0 72%, 20% 42%, 38% 58%, 62% 16%, 84% 46%, 100% 34%, 100% 100%, 0 100%);
}

.plate-hill-b {
  height: 38%;
  background: #59635a;
  clip-path: polygon(0 70%, 24% 44%, 48% 62%, 72% 32%, 100% 56%, 100% 100%, 0 100%);
}

.plate-rule {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 9%;
  height: 1px;
  background: rgba(246, 244, 239, 0.7);
}

.plate-ink {
  filter: grayscale(1) contrast(1.55) brightness(0.95);
}

.plate-caption {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.specimen figcaption {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.feature-band {
  padding: 46px 0 50px;
  border-top: 1px solid var(--line);
}

.band-title {
  margin-bottom: 32px;
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.features article {
  padding: 2px 26px 2px 0;
}

.features article + article {
  padding-left: 26px;
  border-left: 1px solid var(--line);
}

.features h3 {
  margin-bottom: 10px;
  font-size: 19px;
}

.features p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.statement {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 56px;
  align-items: start;
  padding: 56px 0 24px;
  border-top: 1px solid var(--line);
}

.statement h2 {
  font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.statement p {
  max-width: 54ch;
  color: var(--muted);
}

.statement .text-link {
  grid-column: 2;
  justify-self: start;
}

/* Auth */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  gap: 88px;
  align-items: start;
  max-width: var(--page);
  width: 100%;
  margin: 0 auto;
  padding: 76px var(--pad) 40px;
}

.auth-intro h1 {
  max-width: 13ch;
  font-size: clamp(2.3rem, 4.2vw, 3.4rem);
}

.auth-intro p {
  max-width: 42ch;
  margin-top: 20px;
  color: var(--muted);
}

.auth-panel {
  padding: 30px;
  border: 1px solid var(--line);
  background: #f1efe7;
}

.panel-title {
  margin-bottom: 22px;
  font-size: 22px;
}

/* Studio */

.studio {
  max-width: var(--page);
  width: 100%;
  margin: 0 auto;
  padding: 44px var(--pad) 0;
}

.studio-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.studio-head h1 {
  font-size: clamp(2.2rem, 3.8vw, 3rem);
}

.studio-lede {
  max-width: 46ch;
  font-size: 14px;
  color: var(--muted);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.65fr);
  gap: 44px;
  align-items: start;
  padding-top: 32px;
}

.stage-panel {
  min-width: 0;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 24px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  transition: border-color 140ms ease-out;
}

.stage.is-dragover {
  border-color: var(--accent);
}

.stage-empty {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-input:focus-visible + .button {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--paper);
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.before-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 50% 0 0);
}

.before-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(32, 40, 34, 0.4);
  pointer-events: none;
}

.compare-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  transform: translate(-50%, -50%);
  background: var(--paper);
  border: 1px solid var(--ink);
}

.compare-control {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.compare-control label {
  flex: none;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.compare-control input {
  flex: 1;
  accent-color: var(--accent);
}

.stage-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
}

.preset-set {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.preset-set legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-size: 13px;
  line-height: 1;
}

.preset:hover {
  border-color: var(--ink);
}

.preset[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.stage-status {
  margin-top: 12px;
  min-height: 1.5em;
  font-size: 12px;
  color: var(--muted);
}

.save-panel {
  display: grid;
  gap: 36px;
  min-width: 0;
}

.save-panel h2 {
  margin-bottom: 14px;
  font-size: 21px;
}

.recent {
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.section-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-row h2 {
  margin-bottom: 10px;
}

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.work-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.work-row:first-child {
  border-top: 0;
}

.work-thumb {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.work-meta {
  display: grid;
  min-width: 0;
}

.work-title {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-sub {
  font-size: 11px;
  color: var(--muted);
}

/* Works */

.works {
  max-width: var(--page);
  width: 100%;
  margin: 0 auto;
  padding: 48px var(--pad) 0;
}

.works-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.works-head h1 {
  font-size: clamp(2.2rem, 3.8vw, 3rem);
}

.works-head p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
}

.work-card {
  min-width: 0;
}

.work-card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}

.work-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-card-body {
  padding-top: 12px;
}

.work-card-body h2 {
  overflow: hidden;
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-card-meta {
  margin: 4px 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-top: 32px;
  padding: 42px;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* Settings */

.settings {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 52px var(--pad) 0;
}

.settings > h1 {
  font-size: clamp(2.2rem, 3.8vw, 3rem);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  margin-top: 32px;
}

.settings-panel {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.settings-panel h2 {
  margin-bottom: 18px;
  font-size: 21px;
}

.settings-panel p {
  font-size: 14px;
  color: var(--muted);
}

.settings-panel form {
  margin-top: 20px;
}

/* Message */

.message {
  max-width: 560px;
  margin: 0 auto;
  padding: 96px var(--pad);
}

.message-code {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.message h1 {
  margin: 10px 0 16px;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.message p {
  margin-bottom: 20px;
  color: var(--muted);
}

/* Responsive */

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 56px;
  }

  .hero-copy h1 {
    max-width: 16ch;
  }

  .specimen {
    max-width: 560px;
  }

  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 0;
  }

  .features article:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .studio-grid {
    grid-template-columns: 1fr;
  }

  .save-panel {
    max-width: 560px;
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --pad: 20px;
  }

  .site-header {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .site-nav {
    gap: 14px;
    font-size: 13px;
  }

  .nav-button {
    font-size: 13px;
  }

  .hero {
    padding-top: 42px;
    padding-bottom: 46px;
  }

  .lede {
    font-size: 16px;
  }

  .statement {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .statement .text-link {
    grid-column: 1;
  }

  .auth {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 48px;
  }

  .studio-head {
    display: block;
  }

  .studio-lede {
    margin-top: 10px;
  }

  .stage {
    min-height: 300px;
    padding: 14px;
  }

  .stage-actions {
    display: grid;
    gap: 16px;
  }

  .stage-actions .button-quiet {
    justify-self: start;
  }

  .works-head {
    align-items: flex-start;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .site-footer {
    flex-direction: column;
    gap: 6px;
    margin-top: 48px;
  }

  .footer-note {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .features {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .features article,
  .features article + article {
    padding: 18px 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .features article:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .works-grid {
    grid-template-columns: 1fr;
  }

  .works-head {
    display: grid;
    gap: 18px;
    justify-items: start;
  }

  .compare-control {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .auth-panel {
    padding: 24px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
