:root {
  --paper: #f6f3ea;
  --ink: #151515;
  --accent: #f3ff53;
  --hot: #ff5964;
  --blue: #8ebdff;
  --purple: #bd8cff;
  --line: 2px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Space Grotesk", sans-serif;
  transition: background .35s, color .35s;
}
button { font: inherit; color: inherit; }
.noise {
  position: fixed; inset: 0; pointer-events: none; opacity: .045; z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
header {
  height: 92px; border-bottom: var(--line) solid var(--ink); display: flex;
  align-items: center; justify-content: space-between; padding: 0 5vw;
}
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 13px; font-weight: 700; line-height: .9; letter-spacing: -.04em; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border: var(--line) solid var(--ink); background: var(--accent); transform: rotate(-4deg); font-size: 20px; }
.brand-mark span { color: var(--hot); }
.theme-button, .share-button, .text-button {
  border: 0; background: transparent; cursor: pointer; font-family: "DM Mono"; font-size: 11px; letter-spacing: .08em; font-weight: 500;
}
.theme-button { border: var(--line) solid var(--ink); padding: 11px 15px; box-shadow: 3px 3px 0 var(--ink); }
.theme-button:hover { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.theme-dot { display: inline-block; width: 10px; height: 10px; background: var(--hot); border-radius: 50%; margin-right: 6px; }
main { overflow: hidden; }
.hero { min-height: 610px; padding: 76px 5vw 68px; position: relative; border-bottom: var(--line) solid var(--ink); }
.hero:after { content: "✳"; position: absolute; right: 6vw; top: 62px; font-size: clamp(80px, 12vw, 180px); color: var(--hot); animation: spin 15s linear infinite; }
.eyebrow { font: 500 11px "DM Mono"; letter-spacing: .1em; display: flex; align-items: center; gap: 9px; }
.eyebrow span { width: 32px; height: 3px; background: var(--ink); }
h1 { font-size: clamp(52px, 8.4vw, 126px); line-height: .82; letter-spacing: -.075em; margin: 34px 0 35px; max-width: 1150px; position: relative; z-index: 1; }
h1 em { font-family: Georgia, serif; font-weight: 400; color: var(--hot); }
.scribble { position: relative; z-index: 1; }
.scribble:after { content: ""; position: absolute; height: 22%; bottom: 0; left: -1%; right: -2%; background: var(--accent); z-index: -1; transform: rotate(-1deg); }
.hero p { font: 14px/1.5 "DM Mono"; max-width: 480px; }
.generate-button {
  margin-top: 22px; min-width: 360px; padding: 10px 10px 10px 25px; height: 72px;
  display: inline-flex; justify-content: space-between; align-items: center; cursor: pointer;
  border: var(--line) solid var(--ink); background: var(--accent); box-shadow: 8px 8px 0 var(--ink);
  font-weight: 700; font-size: 18px; letter-spacing: -.02em; transition: transform .15s, box-shadow .15s;
}
.generate-button b { width: 49px; height: 49px; background: var(--ink); color: var(--accent); display: grid; place-items: center; font-size: 25px; }
.generate-button:hover { transform: translate(4px,4px); box-shadow: 4px 4px 0 var(--ink); }
.generate-button:active { transform: translate(8px,8px); box-shadow: none; }
.generate-button:disabled { cursor: wait; filter: saturate(.55); }
.tiny-note { font: 9px "DM Mono"; margin: 17px 0 0 55px; opacity: .6; }
.machine { background: var(--ink); color: var(--paper); padding: 34px 5vw 78px; }
.machine-head { display: flex; justify-content: space-between; align-items: center; font: 11px "DM Mono"; letter-spacing: .08em; margin-bottom: 28px; }
.status-light { width: 9px; height: 9px; display: inline-block; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); margin-right: 9px; }
.share-button { color: var(--paper); border-bottom: 1px solid var(--paper); padding: 8px 0; }
.share-button span { color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(12,1fr); gap: 18px; }
.card {
  min-height: 255px; border: var(--line) solid var(--paper); color: var(--ink); padding: 24px;
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  transform-origin: center; animation: cardIn .48s cubic-bezier(.2,.8,.2,1) both;
}
.card:nth-child(1), .card:nth-child(4) { grid-column: span 7; }
.card:nth-child(2), .card:nth-child(3) { grid-column: span 5; }
.card:nth-child(1) { background: var(--hot); transform: rotate(-.4deg); }
.card:nth-child(2) { background: var(--blue); transform: rotate(.6deg); }
.card:nth-child(3) { background: var(--accent); transform: rotate(-.5deg); }
.card:nth-child(4) { background: var(--purple); transform: rotate(.35deg); }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.card-label { font: 500 10px "DM Mono"; letter-spacing: .12em; border: 1px solid; padding: 5px 7px; background: rgba(255,255,255,.2); }
.card-actions { display: flex; gap: 7px; }
.icon-button { border: 1px solid var(--ink); background: rgba(255,255,255,.22); width: 31px; height: 31px; cursor: pointer; display: grid; place-items: center; font-size: 14px; }
.icon-button:hover { background: var(--ink); color: var(--paper); }
.card-value { font-size: clamp(25px, 3.3vw, 52px); line-height: .98; font-weight: 700; letter-spacing: -.055em; margin: 32px 0 10px; max-width: 90%; }
.card-decoration { position: absolute; font-size: 80px; opacity: .16; right: 12px; bottom: -20px; transform: rotate(12deg); pointer-events: none; }
.history-section { padding: 70px 5vw 95px; }
.history-head { display: flex; justify-content: space-between; align-items: end; padding-bottom: 19px; border-bottom: var(--line) solid var(--ink); }
.history-head > div { display: flex; align-items: center; gap: 18px; }
.section-index { font: 11px "DM Mono"; background: var(--ink); color: var(--paper); padding: 6px; }
h2 { font-size: clamp(30px,4vw,56px); letter-spacing: -.055em; line-height: .9; margin: 0; }
.text-button { text-decoration: underline; text-underline-offset: 4px; }
.history-list { display: grid; }
.history-item { display: grid; grid-template-columns: 50px 1.2fr 2fr 38px; gap: 20px; align-items: center; border-bottom: 1px solid var(--ink); padding: 18px 5px; cursor: pointer; transition: padding .2s, background .2s; }
.history-item:hover { padding-left: 15px; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.history-num { font: 11px "DM Mono"; opacity: .55; }
.history-name { font-weight: 700; font-size: 19px; }
.history-idea { font: 12px/1.4 "DM Mono"; opacity: .7; }
.history-arrow { font-size: 22px; }
.empty { padding: 42px 5px; font: 12px "DM Mono"; opacity: .55; }
footer { background: var(--accent); color: var(--ink); border-top: var(--line) solid var(--ink); padding: 30px 5vw; display: flex; justify-content: space-between; font: 10px "DM Mono"; letter-spacing: .08em; }
footer span { color: var(--hot); }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 28px; transform: translate(-50%,120px); background: var(--ink); color: var(--paper); padding: 13px 20px; font: 11px "DM Mono"; border: 1px solid var(--paper); transition: transform .25s; }
.toast.show { transform: translate(-50%,0); }
.shake { animation: shake .4s; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(28px) rotate(2deg) scale(.96); } }
@keyframes shake { 20% { transform: translateX(-7px) rotate(-.5deg); } 40% { transform: translateX(7px) rotate(.5deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@media (max-width: 760px) {
  header { height: 76px; padding: 0 20px; }
  .brand-mark { width: 41px; height: 41px; }
  .theme-button { font-size: 0; padding: 10px; }
  .theme-dot { margin: 0; }
  .hero { padding: 55px 20px 55px; min-height: auto; }
  .hero:after { top: 75px; right: -25px; opacity: .55; }
  h1 { font-size: clamp(48px,15vw,76px); margin-top: 30px; }
  .generate-button { min-width: 0; width: calc(100% - 8px); }
  .machine { padding: 28px 20px 55px; }
  .cards { display: block; }
  .card { margin-bottom: 16px; min-height: 220px; }
  .card-value { font-size: 32px; }
  .share-button { font-size: 9px; }
  .history-section { padding: 55px 20px 70px; }
  .history-head { align-items: center; }
  .history-head > div { gap: 9px; }
  .text-button { font-size: 9px; max-width: 70px; }
  .history-item { grid-template-columns: 32px 1fr 30px; gap: 10px; }
  .history-idea { display: none; }
  footer { display: block; line-height: 1.6; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
