:root {
  color-scheme: light;
  --paper: #f6f5ed;
  --ink: #252c22;
  --green: #1e5038;
  --lime: #d6f479;
  --muted: #535e50;
  --line: #ccd0be;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sans: "Bricolage Grotesque", "Arial", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

button { font: inherit; }
a { color: inherit; }
p, h1, h2 { margin: 0; }

.page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(100% - 5rem, 86rem);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  font: 500 0.75rem/1.5 var(--mono);
}

.site-header {
  min-height: 5rem;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--green);
  font-size: 0.875rem;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  border-radius: 0.35rem;
  background: var(--green);
  color: var(--lime);
  font: 700 1.4rem/1 var(--sans);
}

.share {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  min-height: 2.625rem;
  min-width: 7.25rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: transparent;
  color: var(--green);
  cursor: pointer;
}

.share:hover { background: #eaeedf; }

main {
  display: grid;
  place-items: center;
  min-width: 0;
}

.hero {
  display: grid;
  justify-items: center;
  width: min(100%, 51rem);
  padding-block: 3rem 3.5rem;
  text-align: center;
}

h1 {
  color: var(--green);
  font-size: clamp(1.4rem, 3vw, 2.25rem);
  line-height: 1.13;
  letter-spacing: -0.045em;
}

.response {
  display: grid;
  justify-items: center;
  width: 100%;
  margin-top: 1.6rem;
}

.answer-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 47rem);
  min-height: clamp(12rem, 28vw, 19rem);
  padding: clamp(0.875rem, 4vw, 3rem);
  background-image: radial-gradient(#c5cbb8 0.7px, transparent 0.7px);
  background-size: 12px 12px;
}

.answer-frame.interactive { cursor: pointer; }

.corner {
  position: absolute;
  width: 0.75rem;
  height: 0.75rem;
  border: 0 solid #88947e;
  pointer-events: none;
}

.corner-top-left { inset: 0 auto auto 0; border-width: 1px 0 0 1px; }
.corner-top-right { inset: 0 0 auto auto; border-width: 1px 1px 0 0; }
.corner-bottom-left { inset: auto auto 0 0; border-width: 0 0 1px 1px; }
.corner-bottom-right { inset: auto 0 0 auto; border-width: 0 1px 1px 0; }

.answer {
  color: var(--green);
  font-size: clamp(3.15rem, 9.3vw, 7.75rem);
  font-weight: 900;
  line-height: 0.97;
  letter-spacing: -0.085em;
  text-wrap: balance;
}

.joke-area {
  display: grid;
  place-items: center;
  min-height: 5.25rem;
  max-width: 32rem;
  margin-top: 0.65rem;
  padding-inline: 0.25rem;
}

.joke {
  font-size: clamp(1.0625rem, 2vw, 1.45rem);
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.joke-controls {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
}

.another {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 3.125rem;
  padding: 0.65rem 1rem 0.65rem 1.2rem;
  border: 1px solid var(--green);
  border-radius: 0.35rem;
  background: var(--lime);
  color: var(--green);
  font: 700 0.875rem/1 var(--mono);
  cursor: pointer;
}

.another:hover { background: #e3faab; }
.another:active { background: #c9ea64; }
.refresh { font: 700 1.45rem/1 var(--sans); }

.keyboard-hint {
  color: var(--muted);
  font: 400 0.75rem/1.5 var(--mono);
}

kbd {
  display: inline-block;
  padding: 0 0.32rem;
  border: 1px solid var(--line);
  border-radius: 0.22rem;
  background: #fffdf5;
  font: inherit;
}

.site-footer {
  justify-content: center;
  min-height: 4.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.site-footer a {
  color: var(--green);
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 38rem) {
  .page { width: calc(100% - 2rem); }
  .site-header { min-height: 4rem; }
  .hero { padding-block: 3.2rem; }
  .response { margin-top: 1.35rem; }
  .joke-area { min-height: 5rem; }
}

@media (hover: none) and (pointer: coarse) {
  .keyboard-hint { display: none; }
}

@media (min-width: 90rem) {
  .page { width: min(100% - 8rem, 86rem); }
}
