:root {
  --bg: #0c0c0c;
  --fg: #f5f5f0;
  --card: #141414;
  --muted: #8a8a85;
  --primary: #c85a3c;
  --border: #262626;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.45;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 560px) minmax(0, 1fr);
  align-items: stretch;
}

.bust-rail {
  min-height: 100vh;
  height: 100%;
  background-color: var(--bg);
  background-image: url("./bust.png");
  background-repeat: repeat;
  background-position: center 0;
  background-size: 200px 300px;
  opacity: 0.35;
  animation: bust-drift-up 36s linear infinite;
  pointer-events: none;
}
.bust-rail.left { grid-column: 1; }
.bust-rail.right {
  grid-column: 3;
  animation-name: bust-drift-down;
}

@keyframes bust-drift-up {
  from { background-position: center 0; }
  to { background-position: center -300px; }
}
@keyframes bust-drift-down {
  from { background-position: center 0; }
  to { background-position: center 300px; }
}

@media (prefers-reduced-motion: reduce) {
  .bust-rail { animation: none; }
}

.wrap {
  grid-column: 2;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 20px 80px;
  position: relative;
  z-index: 1;
}

@media (max-width: 840px) {
  body { display: block; }
  .bust-rail { display: none; }
}

.brand {
  font-family: "Sofia Sans Extra Condensed", Inter, sans-serif;
  font-weight: 700;
  font-size: clamp(56px, 9vw, 88px);
  letter-spacing: 0.18em;
  text-align: center;
  margin: 0;
  line-height: 0.9;
}
.headline {
  font-family: "Sofia Sans Extra Condensed", Inter, sans-serif;
  font-weight: 700;
  margin: 8px 0 0;
  text-align: center;
  font-size: clamp(22px, 4vw, 32px);
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: var(--fg);
}
.tag {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--muted);
  margin: 8px 0 36px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  gap: 14px;
}

label, .label {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.label-row .label {
  margin-bottom: 0;
  flex: 1;
  width: auto;
}

.info {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  margin: -8px -8px -8px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
}
.info:hover, .info:focus-visible { color: var(--fg); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input, select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  font-family: inherit;
  padding: 0 12px;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.seg button, .choices button {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.seg button[aria-pressed="true"], .choices button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.choices { display: grid; gap: 8px; }

.primary, .cta {
  height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.primary:disabled { opacity: 0.45; cursor: not-allowed; }

.error { color: #f5a59a; font-size: 13px; min-height: 1.2em; }
.note, .disclaimer { color: var(--muted); font-size: 13px; }
.youth { color: var(--fg); font-size: 13px; }

.macros {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.macro {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.macro span { display: block; font-size: 10px; letter-spacing: 0.14em; color: var(--muted); }
.macro strong { font-size: 28px; font-weight: 700; }

#results[hidden], #app-note[hidden] { display: none; }
#results { margin-top: 20px; }

.cta.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
}

.info-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.65);
}
.info-sheet[hidden] { display: none; }
.info-panel {
  width: min(520px, 100%);
  max-height: min(80vh, 640px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 12px 16px 20px;
  border-bottom: 1px solid var(--border);
}
.info-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.16em;
  font-weight: 700;
}
#info-close {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
#info-body { padding: 4px 20px 8px; overflow: auto; }
.info-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.info-item:last-child { border-bottom: 0; }
.info-item h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}
.info-item p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.info-item .example { margin-top: 8px; font-size: 13px; }
