:root {
  --walnut: #3f2a1c;
  --walnut-deep: #24160f;
  --walnut-mid: #5a3d28;
  --walnut-edge: #6e4a32;
  --mustard: #c9a14a;
  --mustard-faded: #d4b56a;
  --mustard-deep: #9a7830;
  --ink: #14110e;
  --ink-soft: #2c241c;
  --ticket: #f3eee2;
  --ticket-2: #ebe4d4;
  --ticket-edge: #cbbfa6;
  --stamp: #8f3b2c;
  --stamp-blue: #3d4d66;
  --paper: #e8dcc6;
  --line: rgba(20, 17, 14, 0.14);
  --shadow: 0 18px 40px rgba(20, 12, 6, 0.28);
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --stamp-font: "Special Elite", "Courier New", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  max-width: 100%;
  overflow-x: hidden;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.045) 0 1px,
      transparent 1px 11px
    ),
    repeating-linear-gradient(
      180deg,
      rgba(255, 220, 160, 0.04) 0 2px,
      transparent 2px 17px
    ),
    linear-gradient(180deg, #4a3122 0%, #3a2418 42%, #2d1b12 100%);
  min-height: 100vh;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 20;
  padding: 0.6rem 0.9rem;
  background: var(--ticket);
  color: var(--ink);
}

.skip:focus {
  top: 0.8rem;
}

.counter-bar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.7rem 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 40%),
    linear-gradient(90deg, #2c1b12, #4a3122 40%, #3a2418);
  border-bottom: 4px solid #1a100b;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  width: 100%;
  max-width: 100%;
}

.brand-stub {
  display: flex;
  align-items: stretch;
  min-width: 0;
  text-decoration: none;
  background: var(--ticket);
  color: var(--ink);
  min-height: 3.4rem;
  box-shadow: 3px 3px 0 #1a100b;
}

.brand-lot {
  display: grid;
  place-items: center;
  padding: 0 0.7rem;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0 6px,
      rgba(20, 17, 14, 0.08) 6px 7px
    ),
    var(--mustard);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-right: 2px dashed var(--walnut);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.35rem 0.85rem 0.35rem 0.7rem;
}

.brand-copy b {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

.brand-copy small {
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
}

.nav a {
  text-decoration: none;
  color: #f3eee2;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a.active {
  border-bottom-color: var(--mustard);
  color: var(--mustard-faded);
}

.bar-end {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.langs {
  display: flex;
  border: 1px solid rgba(243, 238, 226, 0.35);
}

.lang-btn {
  background: transparent;
  color: #f3eee2;
  border: 0;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--mustard);
  color: var(--ink);
}

.menu {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgba(243, 238, 226, 0.4);
  background: transparent;
  cursor: pointer;
}

.menu span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 5px auto;
  background: #f3eee2;
}

.tag-rail {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  min-height: 4.6rem;
  padding: 0 1rem;
  overflow: hidden;
  max-width: 100%;
}

.hang {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--ink);
}

.hang i {
  width: 2px;
  height: 1.4rem;
  background: linear-gradient(#1a100b, #6e4a32);
}

.hang b {
  min-width: 6.4rem;
  padding: 0.35rem 0.55rem;
  background: var(--mustard-faded);
  border: 1px solid #1a100b;
  box-shadow: 2px 2px 0 #1a100b;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-align: center;
}

.hang-1 { transform: rotate(-6deg); }
.hang-2 { transform: rotate(4deg); margin-top: 0.4rem; }
.hang-3 { transform: rotate(-2deg); }
.hang-4 { transform: rotate(7deg); margin-top: 0.2rem; background: transparent; }
.hang-2 b,
.hang-4 b {
  background: var(--ticket);
}

main {
  width: min(1120px, calc(100% - 1.6rem));
  max-width: 100%;
  min-width: 0;
  margin: 0 auto 3rem;
  background:
    radial-gradient(circle at 0 12px, transparent 7px, var(--ticket) 8px) 0 0 / 16px 24px,
    var(--ticket);
  border: 1px solid #1a100b;
  box-shadow: var(--shadow);
  overflow-x: clip;
}

section {
  padding: 3.2rem 1.4rem 0;
}

section:last-of-type {
  padding-bottom: 3.2rem;
}

.section-head {
  max-width: 42rem;
  margin-bottom: 1.5rem;
}

.kicker {
  margin: 0.35rem 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: var(--walnut-mid);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.12;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.18;
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

p,
li,
dd {
  line-height: 1.55;
}

.lede,
.wide-lead {
  max-width: min(42rem, 100%);
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.hero-copy,
.section-head {
  max-width: 100%;
}

.lot-chip {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  background: var(--walnut);
  color: var(--ticket);
  font-family: var(--mono);
  font-size: 0.72rem;
  transform: rotate(-8deg);
  box-shadow: 2px 2px 0 var(--mustard);
}

.stamp {
  display: inline-grid;
  place-items: center;
  position: relative;
  font-family: var(--stamp-font);
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(143, 59, 44, 0.78);
  border: 3px solid rgba(143, 59, 44, 0.72);
  border-radius: 5px;
  padding: 0.28rem 0.55rem;
  background: repeating-linear-gradient(
    -22deg,
    transparent,
    transparent 3px,
    rgba(143, 59, 44, 0.05) 3px,
    rgba(143, 59, 44, 0.05) 4px
  );
  box-shadow: inset 0 0 0 2px rgba(143, 59, 44, 0.18);
  mix-blend-mode: multiply;
}

.stamp::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(143, 59, 44, 0.4);
  pointer-events: none;
}

.stamp-sm { font-size: 0.68rem; }
.stamp-lg { font-size: 1.05rem; padding: 0.7rem 0.9rem; transform: rotate(-14deg); }
.stamp-tilt { position: absolute; right: 0.8rem; bottom: 0.8rem; transform: rotate(-18deg); }
.stamp-tilt2 { position: absolute; right: 0.7rem; bottom: 0.7rem; transform: rotate(12deg); }
.stamp-blue {
  color: rgba(61, 77, 102, 0.78);
  border-color: rgba(61, 77, 102, 0.72);
  background: repeating-linear-gradient(
    -22deg,
    transparent,
    transparent 3px,
    rgba(61, 77, 102, 0.05) 3px,
    rgba(61, 77, 102, 0.05) 4px
  );
  box-shadow: inset 0 0 0 2px rgba(61, 77, 102, 0.18);
}

.stamp-blue::after { border-color: rgba(61, 77, 102, 0.4); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.45rem 1rem;
  text-decoration: none;
  border: 1px solid #1a100b;
  cursor: pointer;
  font-weight: 600;
}

.btn.mustard {
  background: var(--mustard);
  color: var(--ink);
  box-shadow: 3px 3px 0 #1a100b;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
}

h1,
h2,
h3,
p,
li,
dd {
  overflow-wrap: break-word;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-top: 2.4rem;
}

.hero-copy,
.ticket-stack,
.profile-grid,
.builder-grid,
.contact-grid,
.code-row,
section {
  min-width: 0;
}

.ticket-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
  margin: 0 0 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--walnut-mid);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.2rem 0 1.4rem;
}

.hero-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin: 0;
}

.hero-meta div {
  padding: 0.55rem 0.65rem;
  background: var(--ticket-2);
  border: 1px dashed var(--ticket-edge);
}

.hero-meta dt {
  font-size: 0.72rem;
  color: var(--walnut-mid);
}

.hero-meta dd {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-weight: 600;
}

.ticket-stack {
  position: relative;
  min-height: 21rem;
  overflow: hidden;
}

.ticket {
  position: absolute;
  width: min(100%, 20rem);
  max-width: calc(100% - 0.4rem);
  min-height: 10.5rem;
  padding: 1rem 1rem 1rem 1.6rem;
  background: var(--ticket-2);
  border: 1px solid #1a100b;
  box-shadow: 4px 6px 0 rgba(26, 16, 11, 0.18);
}

.ticket .perf {
  position: absolute;
  left: 0.45rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 8px;
  background: radial-gradient(circle, var(--walnut-deep) 1.7px, transparent 2px) center / 8px 11px;
}

.ticket header {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.ticket p {
  max-width: 14rem;
  margin: 1rem 0 0;
}

.t1 { top: 0; left: 0; transform: rotate(-2.4deg); z-index: 1; }
.t2 { top: 3.1rem; left: 4.4rem; transform: rotate(3.2deg); background: #f7f1e3; z-index: 2; }
.t3 { top: 6.4rem; left: 1.5rem; transform: rotate(-1.2deg); background: #efe3c8; z-index: 3; }

.profile-grid,
.builder-grid,
.contact-grid,
.used-layout,
.place-card {
  display: grid;
  gap: 1.4rem;
}

.copy-block p { margin-top: 0; }

.notice {
  padding: 0.8rem 0.9rem;
  background: rgba(201, 161, 74, 0.18);
  border-left: 4px solid var(--mustard-deep);
}

.file-card,
.reg-table {
  margin: 0;
  background: var(--ticket-2);
  border: 1px solid var(--ticket-edge);
}

.file-card > div,
.reg-table > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px dashed var(--ticket-edge);
}

.file-card > div:last-child,
.reg-table > div:last-child { border-bottom: 0; }

.file-card dt,
.reg-table dt {
  font-size: 0.75rem;
  color: var(--walnut-mid);
}

.file-card dd,
.reg-table dd { margin: 0; }

.code-row,
.fact-grid,
.cond-grid,
.ex-grid,
.people-grid,
.intake-row {
  display: grid;
  gap: 1rem;
}

.code-card,
.fact-grid li,
.cond-grid article,
.ex-grid article,
.people-grid article,
.intake-row article,
.type-stack article,
.faq-list details,
.contact-aside,
.stamp-card {
  background: var(--ticket-2);
  border: 1px solid var(--ticket-edge);
  padding: 1rem 1.05rem;
}

.code-card {
  position: relative;
  transform: rotate(-1deg);
}

.used-code { transform: rotate(1.4deg); }

.code-num {
  margin: 0.6rem 0 0.3rem;
  font-family: var(--mono);
  font-size: 2rem;
  color: var(--walnut);
}

.lot-tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  background: var(--walnut);
  color: var(--ticket);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.mustard-tag { background: var(--mustard); color: var(--ink); }

.code-card a {
  display: inline-block;
  margin-top: 0.7rem;
  color: var(--walnut);
  font-weight: 600;
}

.fact-grid { list-style: none; padding: 0; margin: 0; }
.fact-grid li:nth-child(2),
.cond-grid article:nth-child(2),
.ex-grid article:nth-child(2) { transform: rotate(0.8deg); }
.fact-grid li:nth-child(3),
.cond-grid article:nth-child(3) { transform: rotate(-0.9deg); }
.fact-grid li:nth-child(4),
.ex-grid article:nth-child(4) { transform: rotate(1.2deg); }

.type-stack {
  display: grid;
  gap: 0.75rem;
}

.type-stack article {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.8rem;
  align-items: start;
  transform: rotate(var(--tilt));
}

.type-stack span {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--walnut);
}

.stamp-card {
  position: relative;
  min-height: 16rem;
}

.stamp-card .stamp-lg {
  position: absolute;
  right: 1rem;
  top: 1.1rem;
}

.stamp-card ul {
  margin: 4.5rem 0 0;
  padding-left: 1.1rem;
}

.mix-steps,
.time-list,
.route-line {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.8rem;
}

.mix-steps li,
.time-list li,
.route-line li {
  padding: 0.9rem 1rem;
  background: var(--ticket-2);
  border: 1px solid var(--ticket-edge);
}

.mix-steps { counter-reset: mix; }
.mix-steps li { counter-increment: mix; }
.mix-steps li::before {
  content: counter(mix, decimal-leading-zero);
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--mono);
  color: var(--walnut);
}

.intake-row article span,
.route-line li::before {
  font-family: var(--mono);
  color: var(--walnut-mid);
}

.route-line {
  counter-reset: route;
}

.route-line li { counter-increment: route; }
.route-line li::before {
  content: "T-" counter(route, decimal-leading-zero);
  display: block;
  margin-bottom: 0.35rem;
}

.limit-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.limit-list li {
  padding: 0.8rem 0.95rem 0.8rem 2.6rem;
  background: #efe6d2;
  border: 1px solid var(--ticket-edge);
  position: relative;
}

.limit-list li::before {
  content: "×";
  position: absolute;
  left: 0.8rem;
  top: 0.7rem;
  font-family: var(--stamp-font);
  color: var(--stamp);
  font-size: 1.2rem;
}

.carbon-form,
.contact-form {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem;
  background:
    linear-gradient(90deg, #f6cfc4 0 10px, transparent 10px),
    repeating-linear-gradient(
      180deg,
      transparent 0 27px,
      rgba(20, 17, 14, 0.05) 27px 28px
    ),
    #f7f1e3;
  border: 1px solid #1a100b;
}

.carbon-form label,
.contact-form label {
  display: grid;
  gap: 0.3rem;
}

.carbon-form span,
.contact-form span {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--ticket-edge);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.55rem 0.6rem;
  color: var(--ink);
}

.qty-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.summary-pad {
  background: #1a100b;
  color: #f3eee2;
  padding: 1rem;
  border: 1px solid #1a100b;
}

.pad-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.summary-pad .stamp {
  color: #e8b3a8;
  border-color: #e8b3a8;
  mix-blend-mode: normal;
}

#ticketOutput {
  min-height: 16rem;
  margin: 0.8rem 0;
  padding: 0.8rem;
  background: #2a1c14;
  color: #efe3c8;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.45;
  overflow: auto;
}

.pad-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.summary-pad .btn.ghost {
  color: #f3eee2;
  border-color: #f3eee2;
}

.pad-note,
.form-note,
.aside-note {
  font-size: 0.88rem;
  color: inherit;
  opacity: 0.82;
}

.people-grid article:nth-child(2) { transform: rotate(1deg); }
.people-grid article:nth-child(3) { transform: rotate(-1.1deg); }

.role {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--walnut-mid);
}

.time-list time {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--mono);
  color: var(--walnut);
}

.place-card {
  padding: 1.2rem;
  background:
    linear-gradient(180deg, rgba(201, 161, 74, 0.16), transparent 30%),
    var(--ticket-2);
  border: 1px solid #1a100b;
}

address {
  font-style: normal;
  padding: 1rem;
  background: var(--ticket);
  border: 1px dashed var(--ticket-edge);
  display: grid;
  gap: 0.7rem;
}

.addr-lines {
  white-space: pre-line;
}

.faq-list {
  display: grid;
  gap: 0.65rem;
}

.faq-list details {
  transform: rotate(-0.4deg);
}

.faq-list details:nth-child(even) { transform: rotate(0.6deg); }

summary {
  cursor: pointer;
  font-weight: 600;
  font-family: var(--serif);
}

.form-status {
  min-height: 1.2rem;
  color: var(--walnut);
  font-weight: 600;
}

.contact-aside ul {
  padding-left: 1.1rem;
}

.site-foot {
  width: min(1120px, calc(100% - 1.6rem));
  margin: 0 auto 2.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: #f3eee2;
  font-size: 0.9rem;
}

.site-foot a { color: var(--mustard-faded); }

.profile .people-grid,
.books .fact-grid,
.order-cta {
  margin-top: 1.4rem;
}

.books .fact-grid {
  margin-top: 1rem;
}

@media (min-width: 860px) {
  section { padding-left: 2.4rem; padding-right: 2.4rem; }
  .hero,
  .profile-grid,
  .builder-grid,
  .contact-grid,
  .used-layout,
  .place-card,
  .code-row {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
  .place-card,
  .used-layout { align-items: stretch; }
  .fact-grid,
  .cond-grid,
  .ex-grid,
  .people-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .profile .people-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .intake-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .route-line,
  .mix-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .type-stack { grid-template-columns: 1fr 1fr; }
  .reg-table > div {
    grid-template-columns: 12rem 1fr;
    gap: 1rem;
  }
}

@media (min-width: 1281px) {
  .nav {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.15rem 0.7rem;
  }
  .nav a {
    font-size: 0.76rem;
    white-space: nowrap;
  }
}

@media (max-width: 1280px) {
  .counter-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.6rem 1rem 1rem;
    background: #2c1b12;
    border-bottom: 3px solid #1a100b;
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.7rem 0; border-bottom: 1px dashed rgba(243, 238, 226, 0.2); }
  .menu { display: inline-block; }
}

@media (max-width: 720px) {
  .hero-meta,
  .qty-row,
  .intake-row,
  .route-line,
  .mix-steps {
    grid-template-columns: 1fr 1fr;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn { width: 100%; }
  .brand-copy small { display: none; }
  .counter-bar { padding: 0.55rem 0.65rem; gap: 0.5rem; }
  .ticket-stack { min-height: 16rem; }
  .ticket { width: 88%; }
  .t2 { left: 1.6rem; }
  .t3 { left: 0.6rem; }
  .hang-4 { display: none; }
  .tag-rail { gap: 0.7rem; }
}

@media (max-width: 520px) {
  .hero-meta,
  .intake-row,
  .route-line,
  .mix-steps { grid-template-columns: 1fr; }
  .hang-3 { display: none; }
  .ticket-kicker { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticket,
  .code-card,
  .type-stack article,
  .fact-grid li,
  .faq-list details {
    transform: none;
  }
}
