:root {
  color-scheme: light;
  --ink: #101014;
  --muted: #5c5968;
  --line: #17151d;
  --paper: #fff34d;
  --panel: #ffffff;
  --teal: #00b894;
  --coral: #ff3366;
  --sun: #ffe900;
  --mint: #a5ffcb;
  --blue: #315cff;
  --violet: #8a2be2;
  --shadow: 8px 8px 0 #101014;
  --screen: #c8ff7a;
  --screen-ink: #172015;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14px 14px, rgba(16, 16, 20, 0.18) 0 2px, transparent 3px) 0 0 / 28px 28px,
    linear-gradient(135deg, rgba(255, 51, 102, 0.22), transparent 34%),
    linear-gradient(315deg, rgba(49, 92, 255, 0.24), transparent 38%),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  text-decoration: none;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.brand img {
  width: 38px;
  height: 38px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 3px solid var(--line);
  background: #fff;
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--ink);
}

.tab {
  min-width: 94px;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 9px 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.tab.active {
  color: var(--ink);
  background: var(--sun);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.tab:hover {
  color: var(--ink);
  background: var(--mint);
  transform: translateY(-1px);
}

.tab:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  align-items: end;
  gap: 22px;
  margin: 10px 0 14px;
  padding: 24px;
  min-height: 168px;
  overflow: hidden;
  border: 5px solid var(--ink);
  border-radius: 18px 18px 34px 34px;
  background:
    linear-gradient(90deg, rgba(16, 16, 20, 0.96), rgba(16, 16, 20, 0.36)),
    url("assets/slang-city.svg") center/cover;
  color: #fff;
  box-shadow: 10px 10px 0 var(--ink), inset 0 -18px 0 rgba(0, 0, 0, 0.2);
  transform: rotate(-0.2deg);
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-band h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.25rem, 6.4vw, 5.7rem);
  line-height: 0.86;
  letter-spacing: 0;
  display: inline-block;
  padding: 12px 16px 16px;
  border: 4px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  background: rgba(200, 255, 122, 0.9);
  color: var(--screen-ink);
  text-shadow: 3px 3px 0 rgba(255, 51, 102, 0.45);
  text-transform: uppercase;
  box-shadow: inset 0 0 18px rgba(16, 32, 12, 0.18), 6px 6px 0 rgba(255, 255, 255, 0.22);
}

.hero-stack {
  display: grid;
  gap: 8px;
  counter-reset: calc-step;
}

.hero-stack span {
  position: relative;
  justify-self: end;
  width: min(100%, 330px);
  min-width: 172px;
  padding: 7px 10px;
  border: 2px solid #fff;
  border-radius: 4px;
  background: rgba(255, 51, 102, 0.92);
  text-align: center;
  font-weight: 800;
  backdrop-filter: blur(10px);
  box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.28);
}

.hero-stack span::before {
  counter-increment: calc-step;
  content: "0" counter(calc-step) " = ";
  color: var(--sun);
}

.tool-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}

.calculator-face {
  position: relative;
  padding: 18px;
  border: 5px solid var(--ink);
  border-radius: 22px;
  background: linear-gradient(145deg, #2a2833, #111116 62%);
  box-shadow: 12px 12px 0 var(--ink);
}

.calculator-face::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.filters,
.translator-panel,
.result-panel,
.browse,
.compare {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.filters {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 16px;
  padding: 18px;
  border-width: 3px;
  transform: rotate(0.25deg);
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 3px solid var(--line);
  border-radius: 6px;
  background: #fffdf1;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 150px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--coral);
  box-shadow: 4px 4px 0 var(--blue);
}

.tone-box {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.tone-title {
  color: #4f4b59;
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.quick-picks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.chip {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 58px;
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: #f7f3ea;
  color: var(--ink);
  font-size: clamp(0.72rem, 1.35vw, 0.92rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  box-shadow:
    inset 0 4px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 0 rgba(0, 0, 0, 0.1),
    0 6px 0 #0f0f14;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.chip:hover {
  background: var(--mint);
  color: var(--ink);
  transform: translateY(-2px);
}

.chip:active {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12),
    0 2px 0 #0f0f14;
  transform: translateY(3px);
}

.chip:nth-child(4n + 1) {
  background: var(--sun);
}

.chip:nth-child(4n + 2) {
  background: var(--mint);
}

.chip:nth-child(4n + 3) {
  background: #fff;
}

.chip:nth-child(4n) {
  background: var(--coral);
  color: #fff;
}

.keypad-box {
  margin-top: 16px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #d7d0c2;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.36),
    inset 0 10px 18px rgba(255, 255, 255, 0.2);
}

.reference-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 3px dashed var(--ink);
  background: #fff;
}

.reference-box a {
  color: var(--ink);
  font-weight: 850;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.translator {
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1.1fr);
}

.translator-panel,
.result-panel,
.browse,
.compare {
  padding: 20px;
}

.translator-panel {
  position: relative;
  border-width: 3px;
  background: #f4f0e8;
  box-shadow: 5px 5px 0 #000;
}

.translator-panel::before {
  content: "INPUT";
  position: absolute;
  top: -13px;
  left: 16px;
  padding: 3px 8px;
  border: 2px solid var(--ink);
  background: var(--mint);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.calculator-face textarea {
  min-height: 178px;
  border-color: #0e130d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 38%),
    var(--screen);
  color: var(--screen-ink);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: inset 0 0 18px rgba(16, 32, 12, 0.22);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 3px solid var(--ink);
  border-radius: 12px;
  min-height: 44px;
  font-weight: 850;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.primary-button {
  flex: 1;
  background: var(--coral);
  color: #fff;
}

.secondary-button {
  padding: 0 16px;
  background: var(--blue);
  color: #fff;
}

.icon-button {
  width: 44px;
  background: var(--sun);
  color: var(--ink);
}

.calculator-face .primary-button::before {
  content: "= ";
}

.calculator-face .secondary-button::before {
  content: "+ ";
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
  box-shadow: 0 3px 0 var(--ink);
  transform: translateY(2px);
}

.result-panel {
  align-content: start;
  min-height: 308px;
  border-width: 3px;
  border-color: #0e130d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 34%),
    var(--screen);
  color: var(--screen-ink);
  font-family: "Courier New", ui-monospace, monospace;
  box-shadow: inset 0 0 22px rgba(16, 32, 12, 0.28), 5px 5px 0 #000;
}

.result-panel > div:first-child {
  color: var(--screen-ink);
}

.result-panel h2,
.section-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 2.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.result-panel h2 {
  font-family: "Courier New", ui-monospace, monospace;
  text-transform: uppercase;
}

.result-panel p {
  margin: 16px 0 0;
  color: rgba(23, 32, 21, 0.78);
  font-size: 1.05rem;
  line-height: 1.55;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 850;
}

.example {
  margin-top: 18px;
  padding: 14px;
  border: 3px solid var(--ink);
  border-left: 10px solid var(--coral);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  line-height: 1.45;
  font-weight: 750;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.source-links a {
  min-width: 64px;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #22222b;
  color: #fff;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
}

.alt-label {
  margin-top: 20px;
  color: var(--muted);
}

.related-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mini-result {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
}

.mini-result span,
.quiet {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.card {
  display: grid;
  gap: 10px;
  min-height: 214px;
  padding: 16px;
  border: 3px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.card:nth-child(3n + 1) {
  background: #fff8fb;
}

.card:nth-child(3n + 2) {
  background: #f3fff8;
}

.card:hover,
.card:focus {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(3px, 3px) rotate(-0.35deg);
  outline: none;
}

.card h3 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.card .example {
  margin-top: auto;
  font-size: 0.92rem;
}

.comparison {
  display: grid;
  gap: 12px;
}

.compare-row {
  display: grid;
  grid-template-columns: 140px repeat(4, 1fr);
  gap: 10px;
  align-items: stretch;
}

.compare-cell {
  min-height: 86px;
  padding: 12px;
  border: 3px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.compare-cell strong {
  display: block;
  margin-bottom: 6px;
}

.compare-cell span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.compare-label {
  background: var(--ink);
  color: #fff;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 920px) {
  .hero-band,
  .tool-grid,
  .translator {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
    order: 2;
  }

  .calculator-face {
    order: 1;
  }

  .hero-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stack span {
    justify-self: stretch;
    min-width: 0;
  }

  .compare-row {
    grid-template-columns: 1fr 1fr;
  }

  .quick-picks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 22px, 1220px);
    padding-top: 10px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    min-width: 0;
    padding-inline: 8px;
  }

  .hero-band {
    padding: 24px;
  }

  .hero-stack {
    grid-template-columns: 1fr;
  }

  .compare-row {
    grid-template-columns: 1fr;
  }

  .quick-picks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chip {
    min-height: 52px;
  }
}
