:root {
  --ink: #17191b;
  --paper: #f4eddc;
  --paper-deep: #e7dcc4;
  --yellow: #f6c944;
  --yellow-deep: #dda924;
  --red: #dc5945;
  --blue: #245b77;
  --green: #315f4c;
  --muted: #6b675d;
  --line: rgba(23, 25, 27, 0.22);
  --soft-line: rgba(23, 25, 27, 0.1);
  --shadow: 0 18px 50px rgba(42, 35, 21, 0.13);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(63, 92, 106, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 92, 106, 0.075) 1px, transparent 1px),
    radial-gradient(circle at 18% 8%, rgba(246, 201, 68, 0.24), transparent 31%),
    var(--paper);
  background-size: 38px 38px, 38px 38px, auto, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
select,
textarea {
  font: inherit;
}

button,
a,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 50% 50% 42% 48%;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: Georgia, serif;
  font-size: 1rem;
}

.status-ribbon,
.trust-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(49, 95, 76, 0.12);
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 54px;
  align-items: center;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 84px 0 74px;
}

.kicker,
.panel-number,
.card-label {
  margin: 0 0 12px;
  color: var(--red);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 700px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.7rem, 8vw, 7.9rem);
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 0.83;
}

.hero-lede {
  max-width: 620px;
  margin: 30px 0 26px;
  color: #424039;
  font-size: clamp(1rem, 2vw, 1.24rem);
  line-height: 1.65;
}

.trust-row {
  flex-wrap: wrap;
  gap: 8px;
}

.trust-row span {
  padding: 7px 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.33);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.hero-scene {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  background:
    repeating-radial-gradient(ellipse at 20% 35%, transparent 0 35px, rgba(36, 91, 119, 0.12) 36px 37px, transparent 38px 59px),
    linear-gradient(135deg, #d6e0dc 0 48%, #c5d0ca 48% 52%, #dde4dc 52% 100%);
  border: 2px solid var(--ink);
  border-radius: 48% 42% 40% 46% / 42% 50% 40% 48%;
  box-shadow: var(--shadow), 12px 12px 0 rgba(23, 25, 27, 0.9);
  transform: rotate(1.3deg);
}

.hero-scene::before,
.hero-scene::after {
  position: absolute;
  content: "";
}

.hero-scene::before {
  inset: 18px;
  border: 1px dashed rgba(23, 25, 27, 0.3);
  border-radius: inherit;
}

.hero-scene::after {
  top: 54px;
  right: 52px;
  width: 128px;
  height: 94px;
  border-top: 2px solid rgba(36, 91, 119, 0.28);
  border-right: 2px solid rgba(36, 91, 119, 0.28);
  transform: rotate(-16deg);
}

.map-route {
  position: absolute;
  top: 52%;
  left: -6%;
  width: 118%;
  height: 82px;
  border-top: 10px solid var(--red);
  border-radius: 48%;
  transform: rotate(-13deg);
}

.map-route::after {
  position: absolute;
  top: -15px;
  right: 18%;
  width: 18px;
  height: 18px;
  content: "";
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(220, 89, 69, 0.18);
}

.map-pin {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--blue);
  border: 3px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--blue);
}

.map-pin-one {
  top: 24%;
  left: 28%;
}

.map-pin-two {
  right: 21%;
  bottom: 19%;
}

.flork {
  position: absolute;
  z-index: 3;
  right: 14%;
  bottom: 9%;
  width: 138px;
  height: 242px;
  background: linear-gradient(92deg, var(--yellow-deep), var(--yellow) 38% 72%, #ffd766);
  border: 4px solid var(--ink);
  border-radius: 54% 46% 24% 22% / 30% 31% 11% 10%;
  box-shadow: inset -10px 0 0 rgba(186, 132, 15, 0.12), 10px 14px 0 rgba(23, 25, 27, 0.12);
}

.flork-eye {
  position: absolute;
  top: 54px;
  width: 10px;
  height: 12px;
  background: var(--ink);
  border-radius: 50%;
}

.eye-left {
  left: 48px;
}

.eye-right {
  left: 80px;
}

.flork-mouth {
  position: absolute;
  top: 92px;
  left: 45px;
  width: 50px;
  height: 3px;
  background: var(--ink);
  border-radius: 99px;
}

.flork-arm {
  position: absolute;
  top: 118px;
  left: -98px;
  width: 112px;
  height: 14px;
  background: var(--yellow);
  border: 4px solid var(--ink);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  transform: rotate(-19deg);
  transform-origin: right center;
}

.flork-hand {
  position: absolute;
  top: 86px;
  left: -104px;
  width: 28px;
  height: 10px;
  background: var(--yellow);
  border: 4px solid var(--ink);
  border-right: 0;
  border-radius: 20px 0 0 20px;
  transform: rotate(-19deg);
}

.desk-sign {
  position: absolute;
  z-index: 4;
  top: 42px;
  left: 38px;
  display: grid;
  min-width: 116px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 7px 7px 0 var(--yellow);
  transform: rotate(-3deg);
}

.desk-sign span,
.desk-sign strong {
  padding: 7px 12px;
}

.desk-sign span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.desk-sign strong {
  border-top: 1px solid rgba(244, 237, 220, 0.3);
  font-family: Georgia, serif;
  font-size: 2rem;
  line-height: 1;
}

.desk-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 92px;
  overflow: hidden;
  background: rgba(250, 247, 237, 0.91);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.intake-panel,
.result-panel {
  padding: clamp(26px, 4vw, 50px);
}

.result-panel {
  background:
    linear-gradient(rgba(23, 25, 27, 0.04) 1px, transparent 1px),
    #e4d9c2;
  background-size: 100% 31px;
  border-left: 2px solid var(--ink);
}

.panel-heading,
.result-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.result-header h2,
.boundary-section h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.paperclip {
  width: 22px;
  height: 44px;
  border: 3px solid var(--ink);
  border-bottom-color: transparent;
  border-radius: 14px 14px 0 0;
  transform: rotate(12deg);
}

label {
  display: block;
  margin: 0 0 9px;
  font-size: 0.84rem;
  font-weight: 850;
  letter-spacing: 0.035em;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 18px;
  content: "↓";
  pointer-events: none;
  transform: translateY(-50%);
}

select,
textarea {
  width: 100%;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.9);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  outline: none;
}

select {
  appearance: none;
  min-height: 52px;
  padding: 0 48px 0 15px;
}

textarea {
  min-height: 170px;
  padding: 15px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
}

select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--yellow-deep);
  outline-offset: 3px;
}

.or-divider {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 22px 0;
  color: var(--muted);
  font-family: Georgia, serif;
  font-style: italic;
}

.or-divider::before,
.or-divider::after {
  height: 1px;
  content: "";
  background: var(--line);
  flex: 1;
}

.input-meta {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.75rem;
}

.input-meta p {
  margin: 8px 0 0;
}

#privacy-note {
  max-width: 430px;
}

#character-count {
  white-space: nowrap;
}

.button-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 28px;
}

.primary-button,
.text-button {
  min-height: 50px;
  cursor: pointer;
  border: 0;
}

.primary-button {
  display: inline-flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 900;
}

.primary-button:hover {
  background: #ffd760;
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--ink);
}

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

.text-button {
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.keyboard-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.confidence-chip {
  padding: 7px 10px;
  color: var(--blue);
  background: rgba(36, 91, 119, 0.1);
  border: 1px solid rgba(36, 91, 119, 0.35);
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.translation-card {
  position: relative;
  padding: 24px;
  background: #fffaf0;
  border: 1px solid var(--line);
  border-radius: 2px 14px 3px 10px;
  box-shadow: 4px 6px 0 rgba(23, 25, 27, 0.08);
  transform: rotate(-0.4deg);
}

.translation-card::after {
  position: absolute;
  top: -7px;
  left: 42%;
  width: 82px;
  height: 17px;
  content: "";
  background: rgba(246, 201, 68, 0.42);
  transform: rotate(1.2deg);
}

.plain-explanation {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.18rem, 2.2vw, 1.55rem);
  line-height: 1.45;
}

.checks-section,
.resources-section {
  margin-top: 30px;
}

.checks-section h3,
.resources-section h3 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.checks-section ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: checks;
}

.checks-section li {
  position: relative;
  min-height: 38px;
  margin-top: 8px;
  padding: 8px 8px 8px 46px;
  background: rgba(255, 250, 240, 0.62);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  counter-increment: checks;
}

.checks-section li::before {
  position: absolute;
  top: 7px;
  left: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  content: counter(checks, decimal-leading-zero);
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.65rem;
}

.resource-list {
  display: grid;
  gap: 8px;
}

.resource-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 13px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.46);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  text-decoration: none;
}

.resource-link:hover {
  background: #fffaf0;
  border-color: var(--ink);
}

.resource-link span {
  display: block;
}

.resource-link .resource-name {
  font-weight: 850;
}

.resource-link .resource-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
}

.resource-arrow {
  font-size: 1.1rem;
}

.deadpan-stamp {
  display: grid;
  gap: 7px;
  margin-top: 32px;
  padding: 17px;
  color: var(--red);
  border: 3px double var(--red);
  transform: rotate(-1deg);
}

.deadpan-stamp span {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.96rem;
}

.deadpan-stamp strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.9rem, 2vw, 1.18rem);
  letter-spacing: 0.075em;
}

.boundary-section {
  display: grid;
  grid-template-columns: auto minmax(220px, 0.65fr) minmax(260px, 1fr);
  gap: clamp(20px, 4vw, 60px);
  align-items: start;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 92px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.boundary-index {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 0.85;
}

.boundary-section > p {
  margin: 0;
  color: #47433b;
  font-size: 1rem;
  line-height: 1.75;
}

footer {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 25px max(20px, calc((100% - 1180px) / 2));
  color: var(--paper);
  background: var(--ink);
  font-size: 0.74rem;
}

footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 58px;
  }

  .hero-copy {
    max-width: 700px;
  }

  .hero-scene {
    width: min(100%, 620px);
    min-height: 390px;
  }

  .desk-shell {
    grid-template-columns: 1fr;
  }

  .result-panel {
    border-top: 2px solid var(--ink);
    border-left: 0;
  }

  .boundary-section {
    grid-template-columns: auto 1fr;
  }

  .boundary-section > p {
    grid-column: 2;
  }
}

@media (max-width: 620px) {
  .site-header {
    width: min(100% - 28px, 1180px);
  }

  .status-ribbon {
    max-width: 150px;
    justify-content: flex-end;
    text-align: right;
  }

  .hero,
  .desk-shell,
  .boundary-section {
    width: min(100% - 28px, 1180px);
  }

  .hero {
    gap: 36px;
    padding: 46px 0 48px;
  }

  h1 {
    font-size: clamp(3.35rem, 17vw, 5.3rem);
  }

  .hero-scene {
    min-height: 330px;
    box-shadow: var(--shadow), 7px 7px 0 rgba(23, 25, 27, 0.9);
  }

  .flork {
    right: 10%;
    width: 104px;
    height: 188px;
  }

  .flork-eye {
    top: 42px;
    width: 8px;
    height: 9px;
  }

  .eye-left {
    left: 36px;
  }

  .eye-right {
    left: 61px;
  }

  .flork-mouth {
    top: 72px;
    left: 33px;
    width: 40px;
  }

  .flork-arm {
    top: 91px;
    left: -74px;
    width: 85px;
  }

  .flork-hand {
    top: 66px;
    left: -81px;
  }

  .desk-sign {
    top: 30px;
    left: 26px;
  }

  .intake-panel,
  .result-panel {
    padding: 25px 19px;
  }

  .panel-heading,
  .result-header,
  .button-row,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .text-button {
    align-self: flex-start;
  }

  .confidence-chip {
    align-self: flex-start;
  }

  .boundary-section {
    grid-template-columns: 1fr;
  }

  .boundary-section > p {
    grid-column: 1;
  }

  footer {
    gap: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
