:root {
  --paper: #f2efe7;
  --ink: #11110f;
  --muted: #6f6d66;
  --line: rgba(17, 17, 15, 0.19);
  --line-strong: rgba(17, 17, 15, 0.42);
  --panel: #f8f6f0;
  --accent: #d84a35;
  --success: #2e6e4c;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  min-width: 320px;
}

button, textarea, select {
  font: inherit;
}

button, select, summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  height: 72px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand,
.header-note,
.eyebrow,
.section-number,
.editor-label-row,
.rule-index,
footer,
.privacy-copy,
.result-status {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.brand {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

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

main {
  overflow: hidden;
}

.hero {
  min-height: 660px;
  padding: clamp(72px, 10vw, 144px) clamp(20px, 6vw, 96px) 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  grid-template-rows: auto 1fr;
  column-gap: 7vw;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  grid-column: 1 / -1;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 11px;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  align-self: end;
  font-size: clamp(72px, 10.2vw, 164px);
  font-weight: 620;
  letter-spacing: -.075em;
  line-height: .91;
}

.hero-copy {
  align-self: end;
  max-width: 470px;
  padding-bottom: 8px;
  color: #4e4c47;
  font-size: clamp(16px, 1.5vw, 21px);
}

.hero-copy > p:first-child {
  margin-bottom: 44px;
}

.privacy-copy {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-size: 9px;
}

.privacy-copy span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex: 0 0 auto;
}

.workspace {
  padding: clamp(64px, 8vw, 112px) clamp(20px, 6vw, 96px);
  background: var(--ink);
  color: var(--paper);
}

.workspace-head {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 520px);
  gap: 48px;
  align-items: end;
  margin-bottom: 48px;
}

.section-number {
  margin-bottom: 12px;
  color: #88867f;
  font-size: 10px;
}

.workspace h2,
.notes h2 {
  margin-bottom: 0;
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 560;
  letter-spacing: -.055em;
  line-height: 1.05;
}

.workspace-lead {
  margin: 0;
  color: #aaa79e;
  font-size: 14px;
}

.rule-list {
  margin-bottom: 54px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid rgba(242, 239, 231, .28);
}

.rule-option {
  position: relative;
  min-height: 128px;
  padding: 24px 66px 24px 24px;
  border-right: 1px solid rgba(242, 239, 231, .18);
  border-bottom: 1px solid rgba(242, 239, 231, .28);
  color: var(--paper);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: background-color 160ms ease;
}

.rule-option:nth-child(even) {
  border-right: 0;
}

.rule-option:hover {
  background: rgba(242, 239, 231, .05);
}

.rule-option:has(input:checked) {
  background: rgba(242, 239, 231, .09);
}

.rule-option.is-disabled {
  opacity: .42;
  cursor: not-allowed;
}

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

.rule-check {
  position: relative;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 1px solid rgba(242, 239, 231, .42);
  flex: 0 0 auto;
}

.rule-option input:focus-visible + .rule-check {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.rule-option input:checked + .rule-check {
  border-color: var(--paper);
  background: var(--paper);
}

.rule-option input:checked + .rule-check::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}

.rule-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rule-copy strong {
  font-size: 15px;
  font-weight: 570;
  line-height: 1.5;
}

.rule-copy small {
  color: #8e8b84;
  font-size: 11px;
  line-height: 1.6;
}

.rule-index {
  position: absolute;
  top: 22px;
  right: 22px;
  color: #77746e;
  font-size: 9px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px minmax(0, 1fr);
  align-items: start;
}

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

.editor-label-row {
  min-height: 34px;
  display: flex;
  justify-content: space-between;
  color: #85827b;
  font-size: 9px;
}

.editor-label-row label {
  color: #cbc8bf;
}

.editor-label-row strong {
  color: #cbc8bf;
  font-weight: 500;
}

textarea {
  width: 100%;
  height: 500px;
  padding: 22px;
  border: 1px solid rgba(242, 239, 231, .23);
  border-radius: 0;
  resize: vertical;
  background: #171714;
  color: var(--paper);
  font-size: 16px;
  line-height: 1.9;
  caret-color: var(--accent);
}

textarea::placeholder {
  color: #6e6b65;
}

textarea:focus {
  border-color: rgba(242, 239, 231, .58);
  outline: none;
}

#output {
  background: #1d1d19;
}

.format-action {
  padding: 34px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#format-btn,
.copy-button {
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease, background-color 150ms ease;
}

#format-btn {
  min-height: 74px;
  padding: 14px;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 13px;
  font-weight: 650;
}

#format-btn span:last-child {
  align-self: flex-end;
  font-size: 20px;
}

#format-btn:hover,
.copy-button:hover {
  transform: translateY(-2px);
}

#format-btn:active,
.copy-button:active {
  transform: translateY(0);
}

.text-button {
  width: fit-content;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: #8f8c84;
  cursor: pointer;
  font-size: 11px;
}

.text-button:hover {
  color: var(--paper);
}

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

.copy-button {
  min-width: 144px;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

button:disabled {
  opacity: .34;
  cursor: not-allowed;
  transform: none !important;
}

.result-status {
  margin-top: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8c8982;
  font-size: 9px;
}

.status-mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #75726b;
}

.result-status.has-result .status-mark {
  background: var(--success);
}

.notes {
  padding: clamp(72px, 10vw, 148px) clamp(20px, 6vw, 96px);
}

.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12vw;
  align-items: start;
}

.notes-grid > div {
  max-width: 620px;
  color: #595750;
  font-size: clamp(15px, 1.5vw, 20px);
}

.notes-grid > div p + p {
  margin-top: 32px;
}

footer {
  min-height: 112px;
  padding: 32px clamp(20px, 6vw, 96px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: calc(100vw - 48px);
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero {
    min-height: 600px;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    margin-top: 48px;
  }

  .workspace-head,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .editor-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .format-action {
    padding: 0;
    flex-direction: row;
    align-items: center;
  }

  #format-btn {
    width: min(100%, 360px);
    min-height: 54px;
    flex-direction: row;
    align-items: center;
  }

  #format-btn span:last-child {
    align-self: auto;
  }
}

@media (max-width: 560px) {
  .site-header {
    height: 62px;
  }

  .header-note {
    display: none;
  }

  .hero {
    min-height: 560px;
    padding-top: 72px;
  }

  .eyebrow {
    margin-bottom: 28px;
    font-size: 9px;
  }

  h1 {
    font-size: clamp(62px, 20vw, 92px);
    line-height: .94;
  }

  .hero-copy {
    font-size: 15px;
  }

  .hero-copy > p:first-child {
    margin-bottom: 30px;
  }

  .privacy-copy {
    align-items: flex-start;
    line-height: 1.6;
  }

  .workspace {
    padding-top: 72px;
  }

  .workspace-head {
    gap: 24px;
    margin-bottom: 34px;
  }

  .rule-list {
    grid-template-columns: 1fr;
  }

  .rule-option,
  .rule-option:nth-child(even) {
    min-height: 118px;
    padding: 20px 54px 20px 16px;
    border-right: 0;
  }

  .rule-index {
    top: 19px;
    right: 16px;
  }

  textarea {
    height: 390px;
    padding: 17px;
    font-size: 16px;
  }

  .format-action,
  .output-actions {
    align-items: stretch;
  }

  #format-btn {
    width: 100%;
  }

  .output-actions {
    flex-direction: column;
    gap: 10px;
  }

  .copy-button,
  .output-actions .text-button {
    width: 100%;
  }

  .output-actions .text-button {
    text-align: center;
  }

  .notes-grid {
    gap: 48px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    max-width: calc(100vw - 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
