/* How 'Bout This One - break-room / blue-collar aesthetic */

:root {
  --paper: #e9dcc0;
  --paper-deep: #ddcba6;
  --ink: #201c16;
  --ink-soft: #4a4137;
  --dewalt: #febd11;
  --dewalt-deep: #e0a200;
  --orange: #ff5b1e;
  --card: #fffdf4;
  --card-line: #b9c7d6;
  --card-margin: #e8907f;
  --stamp: #c5391b;
  --shadow: rgba(32, 28, 22, 0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  font-family: "Courier Prime", "Courier New", monospace;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.45), transparent 42%),
    radial-gradient(circle at 85% 88%, rgba(120, 92, 48, 0.18), transparent 50%),
    repeating-linear-gradient(115deg, rgba(120, 92, 48, 0.05) 0 2px, transparent 2px 7px);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* paper grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 3rem) clamp(1.1rem, 4vw, 2rem) 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.4rem, 3.5vw, 2.2rem);
}

/* ---------- masthead ---------- */
.masthead { text-align: center; width: 100%; }

.title {
  font-family: "Anton", "Arial Narrow", sans-serif;
  font-weight: 400;
  line-height: 0.84;
  letter-spacing: 0.01em;
  font-size: clamp(3.1rem, 17vw, 6.4rem);
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.18em;
  text-shadow: 3px 3px 0 var(--dewalt), 5px 5px 0 var(--ink);
}
.title span { animation: drop 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) backwards; }
.title span:nth-child(1) { animation-delay: 0.04s; }
.title span:nth-child(2) { animation-delay: 0.10s; }
.title span:nth-child(3) { animation-delay: 0.16s; }
.title span:nth-child(4) { animation-delay: 0.22s; }
.title-pop {
  color: var(--orange);
  text-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-3deg);
}
@keyframes drop {
  from { opacity: 0; transform: translateY(-16px) rotate(-4deg); }
}

/* ---------- the index card ---------- */
.stage {
  width: 100%;
  display: flex;
  justify-content: center;
  perspective: 900px;
}

.card {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: clamp(190px, 42vw, 240px);
  background: var(--card);
  background-image:
    linear-gradient(var(--card-line) 1px, transparent 1px);
  background-size: 100% 2.2rem;
  background-position: 0 3.0rem;
  border-radius: 4px;
  padding: clamp(1.6rem, 5vw, 2.2rem) clamp(1.3rem, 5vw, 2rem) 1.6rem clamp(2.4rem, 8vw, 3.2rem);
  box-shadow: 0 1px 0 #fff inset, 6px 10px 0 -2px var(--shadow), 0 18px 30px -12px var(--shadow);
  transform: rotate(-1.4deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
}
/* red margin line */
.card::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: clamp(1.6rem, 6vw, 2.3rem);
  width: 2px;
  background: var(--card-margin);
  opacity: 0.7;
}

.card.pop { animation: slap 0.42s cubic-bezier(0.18, 1.4, 0.4, 1); }
@keyframes slap {
  0% { transform: rotate(2deg) scale(1.05); }
  60% { transform: rotate(-2.4deg) scale(0.995); }
  100% { transform: rotate(-1.4deg) scale(1); }
}

.quote {
  font-size: clamp(1.1rem, 4.7vw, 1.5rem);
  line-height: 1.5;
  font-weight: 700;
  color: var(--ink);
  position: relative;
  z-index: 2;
}
.card[data-empty="true"] .quote { color: var(--ink-soft); font-weight: 400; font-style: italic; }

.note {
  font-size: clamp(0.72rem, 3vw, 0.85rem);
  font-style: italic;
  font-weight: 700;
  color: #b8390f; /* darkened for AA contrast on the cream card */
  z-index: 2;
}

/* tape + pushpin trimmings */
.tape {
  position: absolute;
  top: -12px;
  width: 74px;
  height: 26px;
  background: rgba(245, 236, 200, 0.55);
  border: 1px solid rgba(180, 160, 110, 0.35);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.tape-l { left: 16px; transform: rotate(-7deg); }
.tape-r { right: 16px; transform: rotate(6deg); }
.pin {
  position: absolute;
  top: -9px; left: 50%;
  width: 20px; height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a5b, var(--orange) 55%, #b8390f);
  box-shadow: 0 3px 5px rgba(0,0,0,0.3);
}

/* ---------- big button ---------- */
.controls { width: 100%; display: flex; justify-content: center; }

.big-btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  max-width: 460px;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.big-btn-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: var(--dewalt);
  border: 4px solid var(--ink);
  border-radius: 14px;
  padding: clamp(1rem, 4vw, 1.4rem) 1.2rem;
  box-shadow: 0 8px 0 0 var(--dewalt-deep), 0 9px 0 4px var(--ink), 0 16px 22px -10px var(--shadow);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.big-btn-label {
  font-family: "Anton", sans-serif;
  font-size: clamp(1.5rem, 7vw, 2.3rem);
  letter-spacing: 0.02em;
  color: var(--ink);
  text-transform: uppercase;
}
.big-btn-sub {
  font-size: clamp(0.66rem, 2.8vw, 0.82rem);
  font-style: italic;
  color: #6b5413;
}
.big-btn:hover .big-btn-face { transform: translateY(-2px); }
.big-btn:active .big-btn-face {
  transform: translateY(8px);
  box-shadow: 0 0 0 0 var(--dewalt-deep), 0 1px 0 4px var(--ink), 0 4px 8px -4px var(--shadow);
}
.big-btn:focus-visible .big-btn-face { outline: 3px dashed var(--ink); outline-offset: 4px; }
.big-btn:disabled { opacity: 0.5; cursor: progress; }
.big-btn:disabled .big-btn-face { transform: none; }

/* ---------- AI section ---------- */
.ai {
  width: 100%;
  max-width: 560px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 12px;
  padding: clamp(1.3rem, 5vw, 1.8rem);
  box-shadow: 6px 8px 0 -2px var(--shadow);
  border: 3px solid var(--ink);
  background-image: repeating-linear-gradient(45deg, rgba(254,189,17,0.06) 0 10px, transparent 10px 20px);
}
.ai-head h2 {
  font-family: "Anton", sans-serif;
  font-size: clamp(1.4rem, 6vw, 2rem);
  letter-spacing: 0.03em;
  color: var(--dewalt);
  text-transform: uppercase;
}
.ai-head p { font-size: clamp(0.8rem, 3.2vw, 0.95rem); color: #d8ccae; margin-bottom: 1rem; font-style: italic; }

.ai-form { display: flex; flex-direction: column; gap: 0.7rem; }
.ai-input {
  font-family: inherit;
  font-size: clamp(0.95rem, 4vw, 1.1rem);
  padding: 0.85rem 1rem;
  border: 3px solid var(--dewalt);
  border-radius: 8px;
  background: #2c271f;
  color: #fff;
  width: 100%;
}
.ai-input::placeholder { color: #b3a587; }
.ai-input:focus { outline: none; border-color: var(--orange); background: #332d24; }

.ai-btn {
  font-family: "Anton", sans-serif;
  font-size: clamp(1.05rem, 4.6vw, 1.35rem);
  letter-spacing: 0.04em;
  cursor: pointer;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--orange);
  border: 3px solid var(--paper);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  box-shadow: 0 5px 0 0 #c5391b;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
  -webkit-tap-highlight-color: transparent;
}
.ai-btn:active { transform: translateY(5px); box-shadow: 0 0 0 0 #c5391b; }
.ai-btn:disabled { opacity: 0.7; cursor: progress; }
.ai-btn:focus-visible { outline: 3px dashed var(--paper); outline-offset: 3px; }
.ai-btn.thinking .ai-btn-label::after {
  content: "";
  animation: dots 1.1s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; }
}

.fineprint { margin-top: 0.85rem; font-size: 0.7rem; color: #a79a7c; text-align: center; }

/* ---------- footer ---------- */
.foot {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-align: center;
  letter-spacing: 0.04em;
  border-top: 2px dashed rgba(74,65,55,0.4);
  padding-top: 1rem;
  width: 100%;
  max-width: 560px;
}

.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;
}

@media (prefers-reduced-motion: reduce) {
  .title span, .card.pop { animation: none; }
  .big-btn-face, .ai-btn { transition: none; }
}
