/* Hallmark · pre-emit critique: P5 H4 E5 S5 R5 V4
 * Hallmark · genre: playful · macrostructure: Workbench · theme: Hum
 * tone: tactile-playful · anchor hue: pear · enrichment: paper artifact
 * nav: N1 · footer: Ft5 · audience: Chinese everyday users
 */
@import url("/tokens.css");

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

html,
body {
  min-width: 20rem;
  margin: 0;
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
}

[hidden] {
  display: none !important;
}

button,
textarea {
  font: inherit;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: var(--rule-strong) solid var(--color-focus);
  outline-offset: var(--space-2xs);
}

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

.skip-link {
  position: fixed;
  inset-block-start: var(--space-sm);
  inset-inline-start: var(--space-sm);
  z-index: 20;
  min-height: 2.75rem;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-ink);
  color: var(--color-paper);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
.foot-stmt {
  width: min(100%, 76rem);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.nav-min {
  min-height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.nav-min ul {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-min a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
}

.wordmark {
  gap: var(--space-sm);
  font-weight: 700;
}

.wordmark-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: var(--rule-strong) solid var(--color-negative);
  border-radius: var(--radius-sm);
  color: var(--color-negative);
  font-family: var(--font-paper);
  line-height: 1;
  transform: rotate(-5deg);
}

.engine-badge {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  padding-inline: var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-pill);
  color: var(--color-ink-soft);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.decision-workbench {
  padding-block: var(--space-2xl) var(--space-3xl);
}

.workbench-heading {
  max-width: 42rem;
  margin-block-end: var(--space-xl);
}

.eyebrow {
  margin: 0 0 var(--space-xs);
  color: var(--color-ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-style: normal;
  letter-spacing: 0;
  line-height: 1.15;
}

h1 {
  font-size: var(--text-xl);
  font-weight: 700;
}

h2 {
  font-size: var(--text-xl);
  font-weight: 650;
}

form {
  display: grid;
  gap: var(--space-lg);
}

.paper-wrap {
  position: relative;
  width: min(100%, 48rem);
  min-height: 27rem;
  margin-inline: auto;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-sm);
  background-color: var(--color-sheet);
  background-image:
    linear-gradient(to bottom, transparent 2.35rem, var(--color-sheet-line) 2.4rem, transparent 2.45rem);
  background-size: 100% 2.5rem;
  box-shadow: 0 1.25rem 2.5rem var(--color-shadow), 0 0.25rem 0.75rem var(--color-shadow-soft);
  transform: rotate(-0.35deg);
  animation: paper-arrive var(--dur-result) var(--ease-out) both;
}

.paper-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% 30%, var(--color-shadow-soft) 0 0.04rem, transparent 0.05rem);
  background-size: 1.1rem 1.3rem;
  opacity: 0.3;
}

.paper-pin {
  position: absolute;
  inset-block-start: -0.65rem;
  inset-inline-start: 50%;
  width: 4.5rem;
  height: 1.35rem;
  background: color-mix(in oklch, var(--color-accent) 60%, transparent);
  transform: translateX(-50%) rotate(1deg);
}

.paper-wrap label {
  position: relative;
  z-index: 1;
  display: block;
  margin-block-end: var(--space-sm);
  font-weight: 700;
}

textarea {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 15rem;
  resize: vertical;
  padding: var(--space-xs) var(--space-sm);
  border: var(--rule-hair) solid transparent;
  border-radius: var(--radius-sm);
  outline: var(--rule-strong) solid transparent;
  outline-offset: var(--space-2xs);
  background: transparent;
  color: var(--color-ink);
  font-family: var(--font-paper);
  font-size: var(--text-lg);
  line-height: 2;
}

textarea::placeholder {
  color: var(--color-ink-faint);
  opacity: 1;
}

textarea:focus-visible {
  outline-color: var(--color-focus);
}

textarea[aria-invalid="true"] {
  border-color: var(--color-negative);
  background: var(--color-negative-soft);
}

textarea[data-state="success"] {
  border-color: var(--color-positive);
}

.paper-meta {
  position: relative;
  z-index: 1;
  min-height: 2.5rem;
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin-block-start: var(--space-xs);
  color: var(--color-ink-soft);
  font-size: var(--text-xs);
}

.paper-meta p {
  margin: 0;
}

.paper-meta span {
  flex: 0 0 auto;
  font-family: var(--font-mono);
}

.voice-note {
  position: relative;
  z-index: 1;
  max-width: 32rem;
  margin: var(--space-xs) 0 0;
  color: var(--color-ink-faint);
  font-size: var(--text-xs);
}

.stamp-slot {
  position: absolute;
  z-index: 2;
  inset-inline-end: var(--space-lg);
  inset-block-end: 4.5rem;
  width: 8rem;
  height: 8rem;
  pointer-events: none;
}

.stamp {
  width: 100%;
  height: 100%;
  display: none;
  place-items: center;
  border: 0.42rem double currentColor;
  border-radius: 50%;
  font-family: var(--font-paper);
  font-size: var(--text-display);
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: rotate(-9deg) scale(1.35);
}

.stamp.is-visible::after {
  content: "已定";
  position: absolute;
  inset-block-end: 0.45rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
}

.stamp.is-visible {
  display: grid;
  animation: stamp-land var(--dur-result) var(--ease-out) forwards;
}

.stamp.is-do {
  color: var(--color-positive);
}

.stamp.is-dont {
  color: var(--color-negative);
}

.form-actions {
  min-height: 5rem;
  display: grid;
  justify-items: center;
  gap: var(--space-sm);
}

.btn {
  min-width: 8.75rem;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0.25rem 0 var(--color-accent-deep), 0 0.5rem 1rem var(--color-shadow-soft);
  transform: translateY(0);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}

.btn:active,
.btn.is-active {
  transform: translateY(0.2rem);
  box-shadow: 0 0.05rem 0 var(--color-accent-deep), 0 0.15rem 0.4rem var(--color-shadow-soft);
  transition-duration: var(--dur-fast);
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 0.15rem solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.btn.is-loading .button-label {
  display: none;
}

.btn.is-loading .button-spinner {
  display: block;
}

.btn.is-error {
  background: var(--color-negative-soft);
  color: var(--color-negative);
  box-shadow: 0 0.25rem 0 var(--color-negative), 0 0.5rem 1rem var(--color-shadow-soft);
}

.btn.is-success {
  background: var(--color-positive-soft);
  color: var(--color-positive);
  box-shadow: 0 0.25rem 0 var(--color-positive), 0 0.5rem 1rem var(--color-shadow-soft);
}

.form-status {
  min-height: 1.6rem;
  margin: 0;
  color: var(--color-ink-soft);
  font-size: var(--text-sm);
  text-align: center;
}

.form-status.is-error {
  color: var(--color-negative);
}

.history-section {
  padding-block: var(--space-3xl);
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-block-end: var(--space-xl);
}

.text-button {
  min-height: 2.75rem;
  padding: var(--space-xs) var(--space-sm);
  border: var(--rule-hair) solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-ink-soft);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  white-space: nowrap;
  cursor: pointer;
}

.text-button:active,
.text-button.is-active {
  background: var(--color-paper-deep);
}

.text-button:disabled,
.text-button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.text-button.is-error {
  color: var(--color-negative);
}

.text-button.is-success {
  color: var(--color-positive);
}

.history-empty {
  min-height: 12rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-md);
  border-block: var(--rule-hair) solid var(--color-rule);
  color: var(--color-ink-soft);
  text-align: center;
}

.history-empty p {
  margin: 0;
}

.empty-stamp {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  border: var(--rule-strong) double var(--color-ink-faint);
  border-radius: 50%;
  font-family: var(--font-paper);
  font-size: var(--text-lg);
  transform: rotate(-7deg);
}

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

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-md);
  padding-block: var(--space-lg);
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.history-copy {
  min-width: 0;
}

.history-text {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-paper);
  font-size: var(--text-lg);
  line-height: 1.5;
}

.history-time {
  color: var(--color-ink-faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.mini-stamp {
  grid-row: span 2;
  align-self: center;
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border: var(--rule-strong) double currentColor;
  border-radius: 50%;
  font-family: var(--font-paper);
  font-size: var(--text-xl);
  font-weight: 700;
  transform: rotate(-7deg);
}

.mini-stamp.is-do {
  color: var(--color-positive);
}

.mini-stamp.is-dont {
  color: var(--color-negative);
}

.history-actions {
  display: flex;
  gap: var(--space-xs);
}

.foot-stmt {
  padding-block: var(--space-3xl) var(--space-xl);
}

.foot-stmt-line {
  max-width: 22ch;
  margin: 0 0 var(--space-2xl);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
}

.foot-stmt-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block-start: var(--space-sm);
  border-block-start: var(--rule-hair) solid var(--color-rule);
  color: var(--color-ink-soft);
  font-size: var(--text-xs);
}

.wordmark-text {
  color: var(--color-ink);
  font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
  .nav-min a:hover,
  .text-button:hover {
    color: var(--color-focus);
  }

  .btn:hover,
  .btn.is-hover {
    transform: translateY(-0.12rem);
    box-shadow: 0 0.38rem 0 var(--color-accent-deep), 0 0.75rem 1.4rem var(--color-shadow);
  }

  textarea:hover {
    background: color-mix(in oklch, var(--color-accent) 8%, transparent);
  }
}

@media (min-width: 40rem) {
  .site-header,
  main,
  .foot-stmt {
    padding-inline: var(--space-xl);
  }

  .decision-workbench {
    padding-block-start: var(--space-3xl);
  }

  h1 {
    font-size: 2.5rem;
  }

  .paper-wrap {
    min-height: 31rem;
    padding: var(--space-2xl) var(--space-xl) var(--space-xl);
  }

  textarea {
    min-height: 18rem;
    font-size: 1.4rem;
  }

  .history-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }

  .history-actions {
    grid-column: 3;
  }
}

@keyframes paper-arrive {
  from {
    opacity: 0;
    transform: translateY(0.75rem) rotate(-0.35deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-0.35deg);
  }
}

@keyframes stamp-land {
  0% {
    opacity: 0;
    transform: rotate(-9deg) scale(1.35);
  }
  72% {
    opacity: 1;
    transform: rotate(-9deg) scale(0.96);
  }
  100% {
    opacity: 0.9;
    transform: rotate(-9deg) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
