:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --muted: #707070;
  --quiet-rule: #d8d8d8;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Arial, Helvetica, sans-serif;
  --page-gutter: clamp(1.5rem, 4.2vw, 4rem);
  --focus: 2px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 20rem;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button {
  border-radius: 0;
}

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

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 0.9rem;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.page-shell {
  display: grid;
  grid-template-rows: auto minmax(26rem, 1fr) auto;
  min-height: 100vh;
  min-height: 100svh;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(2rem, 4.5vw, 4.25rem) var(--page-gutter) 1rem;
}

.brand-lockup {
  min-width: 0;
}

.wordmark-heading {
  margin: 0;
  font-size: inherit;
  line-height: 1;
}

.wordmark {
  color: var(--ink);
  font-size: clamp(1.65rem, 2.4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
}

.baseline {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.45vw, 1.22rem);
  line-height: 1.25;
}

.language-switcher {
  display: flex;
  align-items: center;
  flex: none;
  gap: 0.8rem;
  padding-top: 0.15rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.language-option,
.footer-link,
.dialog-close {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.language-option {
  min-width: 2rem;
  min-height: 2rem;
  color: var(--muted);
  font-size: inherit;
  letter-spacing: inherit;
}

.language-option[aria-pressed="true"] {
  color: var(--ink);
}

.language-option:hover,
.footer-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.main-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: clamp(2rem, 5vh, 4rem) var(--page-gutter) clamp(4rem, 10vh, 7.5rem);
}

.oracle {
  width: min(46rem, 100%);
}

.field-label {
  display: inline-block;
  margin-bottom: 1.15rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
}

.question-field {
  position: relative;
  border-bottom: 1.5px solid var(--ink);
}

.question-field:focus-within {
  border-bottom-width: 3px;
}

#question {
  display: block;
  width: 100%;
  min-height: 4.25rem;
  max-height: 11rem;
  padding: 0 4.75rem 0.8rem 0;
  overflow-y: hidden;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.25vw, 2.45rem);
  line-height: 1.24;
}

#question::placeholder {
  color: #919191;
  opacity: 1;
}

.character-count {
  position: absolute;
  right: 0;
  bottom: 0.95rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.form-error {
  margin: 1rem 0 -0.2rem;
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.45;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.2rem;
  padding: 1rem 1.5rem;
  border: 1px solid var(--ink);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  transition: background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 2.7rem;
  background: var(--ink);
  color: var(--paper);
}

.primary-button:hover:not(:disabled) {
  background: #262626;
}

.secondary-button {
  background: var(--paper);
  color: var(--ink);
}

.secondary-button:hover:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.56;
}

#oracle-form[aria-busy="true"] .question-field {
  border-bottom-color: var(--quiet-rule);
}

.result-view {
  text-align: center;
  animation: verdict-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.verdict {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(5.5rem, 15vw, 9rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.verdict:focus {
  outline: 0;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: clamp(2.5rem, 6vh, 4rem);
}

.compact-button {
  width: min(14rem, 45%);
  min-height: 3.3rem;
  margin-top: 0;
  font-size: 0.68rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 5rem;
  padding: 1rem var(--page-gutter) clamp(1.6rem, 3.5vw, 3rem);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.86rem;
  line-height: 1.4;
}

.site-footer p {
  margin: 0;
}

.footer-link {
  color: var(--muted);
  font-family: inherit;
  font-size: inherit;
}

.footer-separator {
  width: 1px;
  height: 1.1rem;
  background: var(--muted);
}

.toast {
  position: fixed;
  z-index: 30;
  right: 1rem;
  bottom: 1rem;
  max-width: min(22rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.noscript-notice {
  position: fixed;
  z-index: 40;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  text-align: center;
}

.privacy-dialog {
  width: min(34rem, calc(100% - 2rem));
  max-width: none;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.privacy-dialog::backdrop {
  background: rgba(255, 255, 255, 0.9);
}

.dialog-shell {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--ink);
}

.dialog-header h2 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dialog-close {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
}

.dialog-close svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.5;
}

.dialog-content {
  padding-top: 1.25rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.55;
}

.dialog-content p {
  margin: 0 0 1rem;
}

.dialog-content p:last-child {
  margin-bottom: 0;
}

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

[hidden] {
  display: none !important;
}

@keyframes verdict-in {
  from {
    transform: translateY(0.7rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 37.5rem) {
  :root {
    --page-gutter: 1.25rem;
  }

  .page-shell {
    grid-template-rows: auto minmax(24rem, 1fr) auto;
  }

  .site-header {
    gap: 1rem;
    padding-top: 1.6rem;
  }

  .wordmark {
    font-size: 1.48rem;
  }

  .baseline {
    max-width: 12rem;
    margin-top: 0.42rem;
    font-size: 0.9rem;
  }

  .language-switcher {
    gap: 0.5rem;
    font-size: 0.72rem;
  }

  .language-option {
    min-width: 1.8rem;
    min-height: 1.8rem;
  }

  .main-content {
    padding-top: 2.5rem;
    padding-bottom: 3.5rem;
  }

  #question {
    min-height: 3.8rem;
    padding-right: 0;
    font-size: 1.85rem;
  }

  .character-count {
    position: static;
    display: block;
    padding: 0 0 0.65rem;
    text-align: right;
  }

  .primary-button,
  .secondary-button {
    min-height: 3.7rem;
  }

  .result-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .compact-button {
    width: 100%;
  }

  .site-footer {
    gap: 0.9rem;
    min-height: 4rem;
    padding-bottom: 1.4rem;
    font-size: 0.76rem;
  }
}

@media (max-height: 42rem) and (min-width: 37.6rem) {
  .page-shell {
    grid-template-rows: auto minmax(20rem, 1fr) auto;
  }

  .site-header {
    padding-top: 1.75rem;
  }

  .main-content {
    padding-top: 1.5rem;
    padding-bottom: 2.25rem;
  }

  .site-footer {
    min-height: 3.5rem;
    padding-bottom: 1.25rem;
  }
}

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