/* Math — components of the Integration + AIME app. Shared tokens, header, layout, buttons and chips live in bauhaus.css. */

.side a.item { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; padding: 7px 8px; border-left: 4px solid transparent; }
.side a.item:hover { background: var(--white); }
.side a.item[aria-current="page"] { border-left-color: var(--red); background: var(--white); font-weight: 500; }
.side .num { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; font-weight: 700; font-size: 0.78rem; border: 2px solid var(--ink); background: var(--white); }
.side .t { flex: 1; line-height: 1.25; }
.dot { width: 12px; height: 12px; border: 2px solid var(--ink); display: inline-block; }
.dot.solved { background: var(--blue); } .dot.tried { background: var(--yellow); } .dot.seen { background: var(--paper-2); }

.title { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 900; letter-spacing: -0.02em; margin: 6px 0 4px; }
.subtitle { font-size: 1.15rem; color: var(--ink-2); margin-bottom: 14px; }
.lede { font-size: 1.1rem; }
.head { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; padding-bottom: 20px; border-bottom: 4px solid var(--ink); margin-bottom: 28px; }
.glyph { width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 2rem; color: var(--white); }
.glyph.sq { background: var(--red); }
.glyph.ci { background: var(--blue); border-radius: 50%; }
.glyph.tri { background: var(--yellow); color: var(--ink); clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: 26px; }
.diff { display: inline-flex; gap: 3px; vertical-align: middle; }
.diff i { width: 10px; height: 10px; border: 2px solid var(--ink); display: block; }
.diff i.on { background: var(--red); border-color: var(--red); }
h2.sec { font-size: 1.45rem; font-weight: 900; margin: 40px 0 14px; padding-top: 12px; border-top: 4px solid var(--ink); display: flex; align-items: center; gap: 12px; }
h2.sec::before { content: ""; width: 16px; height: 16px; background: var(--red); flex: none; }
h2.sec.b::before { background: var(--blue); border-radius: 50%; }
h2.sec.y::before { background: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
h3 { font-size: 1.15rem; margin: 26px 0 8px; font-weight: 700; }
ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li { margin-bottom: 0.4em; }
ol.steps { counter-reset: s; list-style: none; padding-left: 0; }
ol.steps li { counter-increment: s; position: relative; padding-left: 44px; margin-bottom: 10px; }
ol.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--ink); color: var(--white); font-weight: 700; font-size: 0.85rem; }
.goals { border-left: 10px solid var(--yellow); background: var(--white); padding: 14px 18px; margin: 0 0 24px; }
.goals .label { display: block; margin-bottom: 4px; }
.goals ul { margin: 0; }

/* callouts */
.callout { background: var(--white); border-left: 10px solid var(--blue); padding: 14px 18px; margin: 18px 0; }
.callout .label { display: block; margin-bottom: 4px; color: var(--ink-2); }
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--red); }
.callout.key { border-left-color: var(--blue); }
.callout.strategy { border-left-color: var(--yellow); }
.callout.why { border-left-color: var(--ink); }
.formula { border: 3px solid var(--ink); background: var(--white); box-shadow: var(--shadow); padding: 14px 18px 12px; margin: 22px 4px 26px 0; }
.formula .label { color: var(--blue); }
.formula .note { font-size: 0.95rem; color: var(--ink-2); border-top: 2px solid var(--rule); padding-top: 8px; margin-top: 6px; }
.formula .note p:last-child { margin: 0; }

/* example widget */
.example { border: 3px solid var(--ink); background: var(--white); margin: 24px 0; }
.ex-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 3px solid var(--ink); background: var(--blue-soft); font-weight: 700; }
.ex-head .label { background: var(--blue); color: var(--white); padding: 2px 8px; }
.ex-body { padding: 14px 18px 4px; }
.ex-steps { list-style: none; padding: 0; margin: 0; counter-reset: es; }
.ex-steps li { counter-increment: es; display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 12px 0; border-top: 2px solid var(--rule); }
.ex-steps li::before { content: counter(es); width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: var(--ink); color: var(--white); font-weight: 700; font-size: 0.8rem; margin-top: 3px; }
.ex-steps .why { color: var(--ink-2); font-size: 0.95rem; margin-top: 4px; border-left: 4px solid var(--yellow); padding-left: 10px; }
.ex-steps li > div, .ex-steps .do, .ex-steps .why { min-width: 0; }
.callout, .ex-steps .do, .ex-steps .why, .variant .sol, .walk .body, .plain, .know-card, .prac .sol, .prac .hint { overflow-x: auto; }
.ex-steps .why p:last-child, .ex-steps .do p:last-child { margin-bottom: 0; }
.ex-answer { border-top: 3px solid var(--ink); padding: 12px 18px; background: var(--yellow-soft); font-weight: 500; }
.ex-actions { padding: 10px 18px 14px; display: flex; gap: 10px; flex-wrap: wrap; }

/* checks */
.check { border: 3px solid var(--ink); border-left-width: 12px; border-left-color: var(--red); background: var(--white); padding: 14px 18px; margin: 22px 0; }
.check .q p:last-child { margin-bottom: 8px; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; text-align: left; border: 2px solid var(--ink); background: var(--white); padding: 8px 12px; }
.choice:hover { background: var(--paper-2); }
.choice .letter { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--ink); font-weight: 700; font-size: 0.8rem; flex: none; }
.choice.right { background: var(--blue-soft); border-color: var(--blue); }
.choice.right .letter { background: var(--blue); color: var(--white); border-color: var(--blue); }
.choice.wrong { background: var(--red-soft); border-color: var(--red); }
.choice.wrong .letter { background: var(--red); color: var(--white); border-color: var(--red); }
.check .why { margin-top: 12px; padding-top: 10px; border-top: 2px solid var(--rule); }
.check .why p:last-child { margin: 0; }
.verdict { font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; }
.verdict.ok { color: var(--blue); } .verdict.no { color: var(--red); }

/* practice */
.prac { border: 3px solid var(--ink); background: var(--white); margin: 18px 0; }
.prac-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 14px; border-bottom: 2px solid var(--rule); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.prac-head a.note { text-transform: none; letter-spacing: 0; font-weight: 400; }
.prac-head .pnum { background: var(--ink); color: var(--white); padding: 2px 8px; }
.prac-head .status { margin-left: auto; }
.prac-head .status.got { color: var(--blue); } .prac-head .status.missed { color: var(--red); }
.prac .q { padding: 12px 18px 0; }
.prac .hint, .prac .sol { padding: 12px 18px; border-top: 2px solid var(--rule); }
.prac .hint { background: var(--yellow-soft); }
.prac .hint p:last-child { margin: 0; }
.prac .ans { border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 10px; font-weight: 500; }
.prac .actions { padding: 0 18px; }
.lvl { display: inline-flex; gap: 3px; }
.lvl i { width: 9px; height: 9px; border: 2px solid var(--ink); display: block; }
.lvl i.on { background: var(--yellow); }

/* AIME */
.statement { font-size: 1.08rem; border: 3px solid var(--ink); background: var(--white); padding: 18px 22px; box-shadow: var(--shadow); margin: 0 6px 28px 0; }
.statement p:last-child { margin: 0; }
.figure { text-align: center; margin: 18px 0; }
.figure svg { max-width: 100%; max-height: 460px; }
.plain { border-left: 10px solid var(--yellow); background: var(--white); padding: 14px 18px; margin: 18px 0; }
.answer-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border: 3px solid var(--ink); background: var(--white); padding: 14px 18px; margin: 18px 0; }
.answer-box input { font: 900 1.6rem var(--sans); letter-spacing: 0.3em; width: 6.2ch; text-align: center; border: 3px solid var(--ink); padding: 4px 0 4px 0.3em; background: var(--paper); }
.answer-box .fb { flex-basis: 100%; }
.know { display: grid; gap: 12px; }
.know-card { border: 2px solid var(--ink); background: var(--white); padding: 12px 16px; }
.know-card .term { font-weight: 700; }
.know-card p:last-child { margin: 0; }
.hints { display: grid; gap: 10px; }
.hint-card { border: 2px solid var(--ink); background: var(--white); }
.hint-card > button { width: 100%; text-align: left; border: 0; background: var(--white); padding: 10px 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; display: flex; justify-content: space-between; }
.hint-card > button:hover { background: var(--yellow-soft); }
.hint-card .body { padding: 0 14px 12px; border-top: 2px solid var(--rule); padding-top: 10px; }
.hint-card > button:disabled { opacity: 0.45; cursor: default; }
.hint-card > button:disabled:hover { background: var(--white); }
.hint-card .body p:last-child { margin: 0; }
.walk { list-style: none; padding: 0; margin: 0; counter-reset: w; }
.walk li { counter-increment: w; border: 3px solid var(--ink); background: var(--white); margin: 0 0 14px; padding: 14px 18px 14px 18px; }
.walk li h3 { margin: 0 0 8px; display: flex; gap: 12px; align-items: baseline; }
.walk li h3::before { content: counter(w); background: var(--red); color: var(--white); font-size: 0.85rem; padding: 2px 9px; font-weight: 700; }
.walk li .body p:last-child { margin: 0; }
.walk li .figure { margin: 12px 0 4px; }
.pitfalls li { margin-bottom: 8px; }
.recap { border: 3px solid var(--ink); background: var(--yellow); padding: 16px 20px; margin: 18px 0; font-weight: 500; }
.recap p:last-child { margin: 0; }
.variant { border: 3px solid var(--ink); background: var(--white); padding: 16px 20px; margin: 18px 0; }
.variant .sol { border-top: 2px solid var(--rule); margin-top: 12px; padding-top: 12px; }
.pn { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 18px; border-top: 4px solid var(--ink); }
.pn a { text-decoration: none; }

/* cards / lists */
.cards { display: grid; gap: 16px; }
.card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; border: 3px solid var(--ink); background: var(--white); padding: 14px 18px; color: var(--ink); text-decoration: none; }
.card:hover { box-shadow: var(--shadow); transform: translate(-2px, -2px); }
.card .n { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.3rem; color: var(--white); background: var(--ink); }
.card:nth-child(3n+1) .n { background: var(--red); } .card:nth-child(3n+2) .n { background: var(--blue); border-radius: 50%; } .card:nth-child(3n) .n { background: var(--yellow); color: var(--ink); }
.card .t { font-weight: 700; font-size: 1.05rem; }
.card .s { color: var(--ink-2); font-size: 0.92rem; }
.card .right { text-align: right; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.posters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 10px 0 30px; }
.poster { position: relative; overflow: hidden; display: block; color: var(--white); text-decoration: none; padding: 24px 22px 20px; min-height: 250px; border: 3px solid var(--ink); box-shadow: var(--shadow); }
.poster.blue { background: var(--blue); } .poster.red { background: var(--red); } .poster.yellow { background: var(--yellow); color: var(--ink); }
.poster.yellow:hover { color: var(--ink); } .poster.yellow .eyebrow { color: var(--ink-2); }
.poster:hover { color: var(--white); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.poster .eyebrow { color: rgba(255,255,255,.8); }
.poster h2 { font-size: 1.7rem; font-weight: 900; margin: 6px 0 8px; }
.poster .big { position: absolute; right: -46px; bottom: -46px; width: 110px; height: 110px; background: var(--yellow); border-radius: 50%; z-index: 0; }
.poster.red .big { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: var(--paper); width: 120px; height: 110px; right: -34px; bottom: -14px; }
.poster.yellow .big { border-radius: 0; background: var(--blue); width: 96px; height: 96px; right: -38px; bottom: -38px; transform: rotate(15deg); }
.poster .eyebrow, .poster h2, .poster p, .poster .stat { position: relative; z-index: 1; }
.poster p { padding-right: 8px; }
.poster .stat { max-width: 70%; padding-bottom: 26px; }
.poster p { font-size: 0.95rem; }
.poster .stat { font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.stripe { display: flex; height: 14px; margin: 26px 0; }
.stripe i { flex: 1; } .stripe .r { background: var(--red); } .stripe .y { background: var(--yellow); } .stripe .b { background: var(--blue); } .stripe .k { background: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 14px 0 24px; }
.stat-tile { border: 3px solid var(--ink); background: var(--white); padding: 12px 14px; }
.stat-tile b { display: block; font-size: 2rem; font-weight: 900; line-height: 1; }
.stat-tile span { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem; font-weight: 700; color: var(--ink-2); }
.grid15 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 420px; }
.grid15 a { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 3px solid var(--ink); background: var(--white); color: var(--ink); text-decoration: none; font-weight: 900; font-size: 1.2rem; }
.grid15 a.solved { background: var(--blue); color: var(--white); } .grid15 a.tried { background: var(--yellow); } .grid15 a.seen { background: var(--paper-2); }
.fsheet .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: center; border: 2px solid var(--ink); background: var(--white); padding: 10px 16px; margin-bottom: 10px; }
.fsheet .row > * { min-width: 0; }
.fsheet .row .name { font-weight: 700; }
.fsheet .row .note { color: var(--ink-2); font-size: 0.9rem; }
.fsheet .row.hidden-f .f { visibility: hidden; }
.fsheet .row.hidden-f { cursor: pointer; }
.fsheet .row.hidden-f::after { content: "click to reveal"; grid-column: 2; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.7rem; color: var(--ink-2); margin-top: -34px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0 20px; }
select { font: inherit; border: 2px solid var(--ink); background: var(--white); padding: 6px 10px; }
.done-box { border: 3px solid var(--ink); background: var(--white); padding: 18px 20px; margin: 30px 0; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.done-box.on { background: var(--blue-soft); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .pn { flex-direction: column; }
  .pn a { justify-content: flex-start; text-align: left; }
  .pn > span:empty { display: none; }
  .posters { grid-template-columns: 1fr; }
  .head { grid-template-columns: 1fr; }
  .glyph { width: 64px; height: 64px; font-size: 1.5rem; }
  .fsheet .row { grid-template-columns: minmax(0, 1fr); }
  .fsheet .row.hidden-f::after { grid-column: 1; margin-top: 0; }
  .card { grid-template-columns: auto 1fr; }
  .card .right { grid-column: 2; text-align: left; }
}
