:root {
  color-scheme: light;
  --black: #050505;
  --ink: #121820;
  --ink-soft: #4b5563;
  --white: #ffffff;
  --off-white: #f7f7f3;
  --line: #121820;
  --red: #ff3338;
  --shadow: 10px 10px 0 #050505;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

html {
  background: transparent;
  scroll-behavior: smooth;
}

body {
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 58px, rgba(5, 5, 5, 0.035) 58px 59px),
    var(--white);
  font-family: "Courier New", Courier, monospace;
}

button,
textarea {
  font: inherit;
}

h1,
h2,
p {
  margin: 0;
}

.app-shell {
  width: min(1000px, 100%);
  min-height: 1200px;
  margin: 0 auto;
  padding: 28px;
}

.composer {
  min-height: calc(1200px - 56px);
  border: 3px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 40px);
}

.tool-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 24px;
  align-items: end;
  border-bottom: 3px solid var(--black);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.section-kicker {
  color: var(--red);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
}

h1 {
  margin-top: 8px;
  color: var(--black);
  font-size: clamp(1.45rem, 2.8vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.22;
}

.tool-intro,
.idea-bank p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.7;
}

.formula-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.18fr);
  gap: 14px;
  align-items: stretch;
}

.field-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.field-card span {
  color: var(--black);
  font-size: 1.04rem;
  font-weight: 900;
}

textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 3px solid var(--line);
  border-radius: 0;
  padding: 16px;
  color: var(--ink);
  background: var(--off-white);
  line-height: 1.65;
  outline: none;
  transition:
    background 130ms ease,
    box-shadow 130ms ease,
    transform 130ms ease;
}

textarea:focus {
  background: var(--white);
  box-shadow: 6px 6px 0 var(--red);
  transform: translate(-2px, -2px);
}

.theme-card textarea {
  background:
    linear-gradient(90deg, rgba(255, 51, 56, 0.08), transparent 32%),
    var(--off-white);
}

.operator {
  display: grid;
  place-items: center;
  align-self: end;
  width: 36px;
  min-height: 170px;
  color: var(--red);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  border: 3px solid var(--black);
  border-radius: 0;
  padding: 0 18px;
  color: var(--black);
  background: var(--white);
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 5px 5px 0 var(--black);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.action-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.action-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--black);
}

.action-btn.primary {
  color: var(--white);
  background: var(--red);
}

.action-btn.secondary {
  color: var(--white);
  background: var(--black);
}

.result-strip {
  margin-top: 22px;
  border: 3px solid var(--black);
  padding: 16px 18px;
  color: var(--black);
  background:
    linear-gradient(90deg, rgba(255, 51, 56, 0.14) 0 6px, transparent 6px),
    var(--off-white);
  font-weight: 800;
  line-height: 1.7;
}

.idea-bank {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 34px;
  border-top: 3px solid var(--black);
  padding-top: 24px;
}

.idea-bank-copy {
  display: grid;
  gap: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  min-height: 40px;
  border: 2px solid var(--black);
  border-radius: 0;
  padding: 0 14px;
  color: var(--black);
  background: var(--white);
  cursor: pointer;
  font-weight: 900;
}

.chip:hover {
  color: var(--white);
  background: var(--red);
}

@media (max-width: 900px) {
  .app-shell {
    width: 100%;
    min-height: auto;
    padding: 18px;
  }

  .composer {
    min-height: auto;
    box-shadow: 7px 7px 0 var(--black);
  }

  .tool-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .formula-row,
  .idea-bank {
    grid-template-columns: 1fr;
  }

  .operator {
    width: 100%;
    min-height: 28px;
    align-self: center;
  }

  .actions {
    justify-content: stretch;
  }
}

@media (max-width: 560px) {
  body {
    background: var(--white);
  }

  .app-shell {
    padding: 10px;
  }

  .composer {
    border-width: 2px;
    box-shadow: none;
    padding: 16px;
  }

  h1 {
    font-size: clamp(1.35rem, 6.5vw, 1.9rem);
  }

  textarea {
    min-height: 150px;
    border-width: 2px;
    padding: 13px;
  }

  .actions {
    display: grid;
  }

  .action-btn {
    width: 100%;
    min-height: 48px;
    white-space: normal;
  }

  .result-strip,
  .idea-bank {
    border-width: 2px;
  }

  .chip {
    width: 100%;
    min-height: 42px;
    text-align: left;
  }
}
