:root {
  --teal: #20C0C0;
  --teal-deep: #0090A0;
  --cream: #F8F0D8;
  --cream-warm: #F0E8D0;
  --ink: #000000;
  --gold: #F6C010;
  --red: #E92F02;
  --noodle: #F4C25A;
  --brown: #745024;
  --navy: #053D48;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

body.menu-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

h1,
h2,
h3,
.logo-lockup span,
.servings-output,
.appointed-line,
.manifesto {
  margin: 0;
  font-family: "Anton", Impact, sans-serif;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(48px, 8vw, 112px);
}

h2 {
  font-size: clamp(32px, 5vw, 56px);
}

h3 {
  font-size: 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  height: 72px;
  padding: 0 18px;
  background: var(--cream);
  border-bottom: 3px solid var(--ink);
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-lockup img {
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.logo-lockup span {
  font-size: 22px;
}

.desktop-nav {
  display: none;
  justify-content: center;
  gap: 4px;
}

.desktop-nav a,
.mobile-nav a {
  padding: 10px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
  color: var(--ink);
  background: var(--teal);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.menu-toggle svg,
.icon-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.mobile-nav {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  background: var(--cream);
  border-bottom: 3px solid var(--ink);
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  border-top: 3px solid var(--ink);
}

.section {
  scroll-margin-top: 88px;
  padding: 70px 18px;
}

.section-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.section-inner.narrow {
  width: min(820px, 100%);
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(100vh - 72px);
  gap: 34px;
  align-items: center;
  background: var(--teal);
}

.stamp,
.character-line,
.input-label,
.control-label,
.slider-head output,
.download-card span,
.download-card em,
.line-library h3,
.disclaimer,
.record-list dt,
.asset-links a {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stamp {
  position: absolute;
  top: 18px;
  left: 18px;
  margin: 0;
}

.hero-copy {
  padding-top: 48px;
}

.hero-copy > p {
  max-width: 520px;
  margin: 18px 0 20px;
  font-size: 19px;
}

.hero-art,
.character-panel {
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}

.hero-art {
  justify-self: center;
  width: min(420px, 92vw);
  padding: 18px;
  transform: rotate(-2deg);
}

.address-pill,
.address-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 8px;
  background: var(--cream);
  border: 3px solid var(--ink);
}

.contract-text {
  overflow: hidden;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-address,
.copy-line,
.share-link {
  min-height: 38px;
  padding: 6px 10px;
  color: var(--ink);
  background: var(--cream-warm);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 22px;
}

.cta-row.single {
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.header-actions .btn {
  min-height: 40px;
  padding: 7px 9px;
  box-shadow: 4px 4px 0 var(--ink);
  white-space: nowrap;
}

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

.header-actions .btn:hover {
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-primary {
  background: var(--gold);
}

.btn-secondary {
  background: var(--cream);
}

.character-line {
  margin: 12px 0 0;
  opacity: 0.7;
}

.plan-section,
.crisis-section,
.types-section {
  background: var(--cream);
}

.index-section,
.create-section {
  background: var(--teal);
}

.character-section {
  color: var(--cream);
  background: var(--teal-deep);
}

.chain,
.types-grid {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.chain-card,
.type-card,
.calculator,
.crisis-card,
.line-library,
.canvas-panel,
.controls-panel {
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.chain-card {
  position: relative;
  padding: 18px;
}

.chain-card:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -21px;
  width: 3px;
  height: 21px;
  background: var(--ink);
}

.chain-card span {
  display: block;
  margin-bottom: 12px;
  font-family: "Anton", Impact, sans-serif;
  font-size: 40px;
  line-height: 1;
}

.chain-card p {
  margin: 10px 0 0;
}

blockquote {
  margin: 34px 0 0;
  padding: 28px;
  color: var(--cream);
  background: var(--teal-deep);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.section-subhead {
  margin: 12px 0 0;
  font-size: 19px;
}

.calculator {
  margin-top: 26px;
  padding: 18px;
}

.chip-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.chip {
  min-height: 44px;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip.selected {
  background: var(--gold);
}

.input-label {
  display: block;
  margin-top: 20px;
}

.money-row {
  display: grid;
  grid-template-columns: auto 1fr 112px;
  align-items: stretch;
  margin-top: 8px;
}

.currency-prefix,
#amount,
#currency {
  min-width: 0;
  min-height: 58px;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  font-weight: 600;
}

.currency-prefix {
  display: grid;
  place-items: center;
  width: 52px;
  border-right: 0;
}

#amount {
  width: 100%;
  padding: 8px 12px;
  border-right: 0;
}

#currency {
  padding: 8px;
}

.servings-output {
  display: block;
  margin-top: 24px;
  font-size: clamp(42px, 10vw, 88px);
  overflow-wrap: anywhere;
}

.verdict {
  margin: 6px 0 18px;
  font-weight: 600;
}

.cup-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-height: 40px;
}

.cup-icon {
  width: 20px;
  height: 22px;
}

.more-cups {
  margin-left: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.share-link {
  display: inline-block;
  margin-top: 18px;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.crisis-card {
  margin-top: 26px;
  padding: clamp(24px, 6vw, 56px);
  text-align: center;
}

.crisis-card h3 {
  font-size: clamp(42px, 8vw, 82px);
}

.crisis-card p {
  margin: 14px 0 0;
  font-family: "Anton", Impact, sans-serif;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
}

.crisis-card.fade {
  opacity: 0.2;
}

.character-grid {
  display: grid;
  gap: 30px;
  align-items: center;
}

.character-panel {
  width: min(390px, 100%);
  padding: 18px;
}

.record-list {
  margin: 24px 0 0;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.record-list div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-bottom: 3px solid var(--ink);
}

.record-list div:last-child {
  border-bottom: 0;
}

.record-list dt,
.record-list dd {
  margin: 0;
}

.record-list dd {
  font-weight: 600;
}

.appointed-line {
  max-width: 1120px;
  margin: 32px auto 0;
  text-align: center;
  font-size: clamp(36px, 6vw, 72px);
}

.character-section > .cta-row {
  justify-content: center;
}

.types-grid {
  gap: 24px;
}

.type-card {
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.type-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--ink);
}

.type-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
  border-bottom: 3px solid var(--ink);
}

.type-card div {
  padding: 20px;
}

.type-card p {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.5;
}

.generator-layout {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.canvas-panel,
.controls-panel {
  padding: 18px;
}

.canvas-panel {
  display: grid;
  justify-items: center;
}

#meme-canvas {
  width: 100%;
  max-width: 540px;
  height: auto;
  border: 3px solid var(--ink);
  background: var(--teal);
}

.controls-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

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

.template-thumb {
  width: 72px;
  height: 72px;
  padding: 0;
  background: var(--cream);
  border: 3px solid var(--ink);
}

.template-thumb.selected {
  border-color: var(--gold);
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.template-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.control-label {
  margin: 6px 0 -8px;
}

.text-control,
.range-control,
.color-control,
.control-button,
.segment {
  min-width: 0;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.text-control {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
}

.slider-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.slider-head .control-label {
  margin: 0;
}

.slider-head output {
  min-width: 44px;
  text-align: right;
}

.range-control {
  width: 100%;
  min-height: 44px;
  padding: 0 8px;
  accent-color: var(--gold);
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.swatch,
.color-control {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.swatch {
  background: var(--swatch);
}

.swatch.selected {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.control-button,
.segment {
  min-height: 46px;
  padding: 8px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-button.selected,
.segment.selected {
  background: var(--gold);
}

.download-meme {
  width: 100%;
  margin-top: 2px;
}

.copy-image {
  justify-self: start;
}

.line-library {
  margin-top: 26px;
  padding: 18px;
}

.line-library ul {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.line-library li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 3px solid var(--ink);
}

.copy-line {
  width: 42px;
  height: 42px;
  padding: 0;
}

.copy-line svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
}

.line-text {
  padding: 0;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 0;
  font: inherit;
  box-shadow: none;
}

.line-text:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.asset-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.asset-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.site-footer {
  padding: 36px 18px 18px;
  color: var(--cream);
  background: var(--navy);
  border-top: 3px solid var(--ink);
}

.footer-inner {
  display: grid;
  gap: 24px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.manifesto {
  font-size: clamp(28px, 5vw, 52px);
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: start;
  justify-content: flex-start;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--ink);
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.footer-eat {
  background: var(--cream);
}

.disclaimer {
  width: min(1120px, 100%);
  margin: 30px auto 0;
  color: rgba(248, 240, 216, 0.7);
  text-align: center;
}

@media (min-width: 640px) {
  .section {
    padding: 86px 28px;
  }

  .chip-row,
  .types-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .types-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .record-list div {
    grid-template-columns: 190px 1fr;
  }
}

@media (min-width: 900px) {
  .site-header {
    padding: 0 26px;
  }

  .desktop-nav {
    display: flex;
  }

  .menu-toggle,
  .mobile-nav {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    padding-inline: max(40px, calc((100vw - 1120px) / 2));
  }

  .hero-copy {
    padding-top: 0;
  }

  .chain {
    grid-template-columns: repeat(5, 1fr);
  }

  .chain-card:not(:last-child)::after {
    top: 50%;
    right: -21px;
    bottom: auto;
    left: auto;
    width: 21px;
    height: 3px;
  }

  .character-grid,
  .generator-layout,
  .footer-inner {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .generator-layout {
    grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr);
  }

  .footer-socials {
    justify-content: flex-end;
  }
}

@media (min-width: 900px) and (max-width: 1100px) {
  .site-header {
    padding: 0 14px;
  }

  .logo-lockup span {
    font-size: 20px;
  }

  .desktop-nav {
    gap: 0;
  }

  .desktop-nav a {
    padding: 9px 8px;
    font-size: 11px;
  }

  .header-actions .btn {
    padding: 7px 8px;
    font-size: 11px;
    letter-spacing: 0.06em;
  }
}

@media (max-width: 430px) {
  .logo-lockup span {
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
  }

  .header-actions .btn {
    min-height: 36px;
    padding: 6px 7px;
    font-size: 10px;
    letter-spacing: 0.04em;
  }

  .site-header {
    padding: 0 12px;
  }

  .header-actions {
    gap: 6px;
  }

  .menu-toggle {
    width: 38px;
    height: 38px;
  }

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

  #currency {
    grid-column: 1 / -1;
    border-top: 0;
  }

  #amount {
    border-right: 3px solid var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .type-card:hover {
    box-shadow: 6px 6px 0 var(--ink);
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    transform: none !important;
  }
}
