/* Study edition review page. Reading Room tokens (learn.alameh.com, Design A). */
:root {
  --night: #0e1524; --night-2: #151e31; --night-3: #1d2840;
  --lamp: #e3b65e; --lamp-dim: #b98f3e; --lamp-soft: rgba(227,182,94,.16);
  --paper: #f3ead8; --paper-hi: #fbf5e8; --paper-2: #e9dec6;
  --ink: #1c2433; --ink-2: #2d3444; --ink-soft: #5b6170; --rule: #d8cbb0;
  --moon: #c9cfdc; --dim: #8a93a8;
  --teal: #2f8a85; --rust: #b4573a; --slate: #4b6a9b; --sage: #4f7d5c; --gold: #a97c25;
  --ok-bg: #e6efe5; --warn-bg: #f6e6d2; --no-bg: #f3dcd4;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { background: var(--night); color: var(--moon); font: 19px/1.65 var(--body); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3, h4, h5 { font-family: var(--display); font-weight: 600; line-height: 1.2; }
p + p { margin-top: .8em; }
.kicker { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--lamp); }

.draft { background: var(--lamp); color: var(--night); text-align: center; font-size: 14px; padding: 6px 16px; }

/* Header and section navigation */
.top { padding: 56px 0 0; }
.top h1 { font-size: clamp(38px, 6vw, 58px); color: var(--paper); font-weight: 500; margin-top: 10px; }
.top h1 small { display: block; font-size: 18px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); font-family: var(--body); font-weight: 400; margin-bottom: 4px; }
.secnav { position: sticky; top: 0; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 34px; padding: 12px 0; border-bottom: 1px solid rgba(201,207,220,.14); }
.secnav a { color: var(--moon); text-decoration: none; font-size: 15px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(201,207,220,.2); }
.secnav a:hover { border-color: var(--lamp); color: var(--lamp); }

main > section { margin-top: 72px; }
.sec-h { margin-bottom: 34px; }
.sec-h h2 { font-size: clamp(32px, 4.5vw, 44px); color: var(--paper); font-weight: 500; margin-top: 6px; }
.lede { color: var(--dim); margin-top: 8px; max-width: 40em; }

/* The chapter, as printed */
.read > details > summary { cursor: pointer; list-style: none; color: var(--paper); font-family: var(--display); font-size: 26px; padding: 14px 0; }
.read > details > summary::-webkit-details-marker { display: none; }
.read > details > summary::before { content: "+"; display: inline-block; width: 1.2em; color: var(--lamp); }
.read > details[open] > summary::before { content: "\2212"; }
.read summary small { font-family: var(--body); font-size: 15px; color: var(--dim); margin-left: 8px; }
.paper { background: var(--paper-hi); color: var(--ink-2); border-radius: 6px; padding: clamp(24px, 5vw, 56px); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.chapter h1, .chapter h2, .chapter h3 { color: var(--ink); margin: 1.6em 0 .5em; }
.chapter h1 { font-size: 30px; } .chapter h2 { font-size: 25px; } .chapter h3 { font-size: 21px; }
.chapter > :first-child { margin-top: 0; }
.chapter ul, .chapter ol { margin: .6em 0 .6em 1.4em; }
.chapter li + li { margin-top: .3em; }
.chapter blockquote { border-left: 3px solid var(--lamp); padding: 4px 0 4px 18px; margin: 1em 0; color: var(--ink-soft); font-style: italic; }
.chapter p:has(> img) { margin: 2.2em 0 0; }
.chapter p:has(> img) + p > em:only-child { display: block; text-align: center; font-size: 15px; color: var(--ink-soft); max-width: 34em; margin: 0 auto 2em; }
.chapter img { width: 100%; height: auto; display: block; margin: 1.6em 0; border: 1px solid var(--rule); border-radius: 4px; background: #fff; }
table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 16px; }
th, td { border: 1px solid var(--rule); padding: 10px 12px; text-align: left; vertical-align: top; line-height: 1.5; }
th { background: var(--paper-2); color: var(--ink); font-weight: 600; }
.tbl { overflow-x: auto; margin: 1.2em 0; } .tbl table { margin: 0; }

/* Exercise legend and jump links */
.legend { list-style: none; display: grid; gap: 10px; margin-top: 24px; }
.legend li { display: flex; gap: 12px; align-items: baseline; color: var(--moon); font-size: 16px; }
.legend .type { flex: none; min-width: 112px; text-align: center; }
.jump { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.jump a { color: var(--paper); text-decoration: none; font-family: var(--display); font-size: 20px; width: 52px; text-align: center; padding: 4px 0; border-radius: 6px; background: var(--night-3); }
.jump a:hover { background: var(--lamp); color: var(--night); }

/* Type badges */
.type { display: inline-block; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; color: #fff; font-family: var(--body); font-weight: 500; }
.t-build { background: var(--teal); } .t-apply { background: var(--gold); } .t-spot-the-flaw { background: var(--rust); }
.t-distinguish { background: var(--slate); } .t-compare { background: var(--sage); }
.t-read-the-scene, .t-read-the-case { background: #7a5c8f; }

/* Exercise card */
.ex { background: var(--paper-hi); color: var(--ink-2); border-radius: 8px; padding: clamp(22px, 4.5vw, 44px); margin-bottom: 48px; box-shadow: 0 18px 44px rgba(0,0,0,.3); scroll-margin-top: 70px; }
.ex-h { display: flex; align-items: center; gap: 16px; }
.ex-n { font-family: var(--display); font-size: 44px; line-height: 1; color: var(--ink); font-weight: 600; }
.draws { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-top: 14px; font-size: 14px; color: var(--ink-soft); }
.draws ul, .chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.draws li, .chips li { background: var(--paper-2); border-radius: 4px; padding: 2px 10px; font-size: 14px; color: var(--ink-2); }
.ex section { margin-top: 30px; }
.ex h4 { font-size: 22px; color: var(--ink); display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ex h4 em { font-style: normal; font-family: var(--body); font-size: 13px; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--paper); }
.case { background: var(--paper); border-radius: 6px; padding: 22px 24px; }
.case p { max-width: 36em; }
.task { border-left: 4px solid var(--lamp); padding: 4px 0 4px 22px; }
.task p { font-size: 20px; color: var(--ink); }
.write textarea { width: 100%; font: 17px/28px var(--body); color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; padding: 14px 16px; resize: vertical;
  background: repeating-linear-gradient(transparent 0 27px, rgba(216,203,176,.55) 27px 28px) #fff; background-attachment: local; background-position: 0 14px; }
.write textarea:focus, .notebook input:focus, .notebook textarea:focus { outline: 2px solid var(--lamp); outline-offset: 1px; }

/* Answer guidance, folded */
.guide { margin-top: 30px; border-top: 1px dashed var(--rule); padding-top: 20px; }
.guide summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary span { background: var(--ink); color: var(--paper); padding: 8px 18px; border-radius: 6px; font-size: 16px; }
.guide[open] summary span { background: var(--lamp); color: var(--night); }
.guide summary small { color: var(--ink-soft); font-size: 14px; }
.guide h5 { font-size: 19px; color: var(--ink); margin-bottom: 10px; }
.guide > div { margin-top: 26px; }
.g-model { background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 20px 22px; }
.g-steps ol { list-style: none; counter-reset: s; position: relative; }
.g-steps li { counter-increment: s; position: relative; padding: 0 0 18px 48px; }
.g-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--paper-2); color: var(--ink); display: grid; place-items: center; font-size: 15px; font-weight: 600; }
.g-steps li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 2px; width: 2px; background: var(--paper-2); }
.g-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.g-pair > div { border-radius: 6px; padding: 18px 20px; font-size: 17px; }
.ok { background: var(--ok-bg); } .warn { background: var(--warn-bg); }
.no { margin-top: 14px; background: var(--no-bg); border-radius: 4px; padding: 10px 12px; }
.no b { display: block; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--rust); margin-bottom: 2px; }

/* Visuals */
.visual { margin: 22px 0 4px; background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 18px 20px; }
.visual figcaption { font-family: var(--display); font-size: 19px; color: var(--ink); margin-bottom: 14px; font-weight: 600; }
.v-key { font-size: 13px; color: var(--ink-soft); margin-top: 12px; }
.day { display: grid; grid-template-columns: 96px 1fr 128px; gap: 12px; align-items: center; margin-top: 12px; }
.day-h b { display: block; color: var(--ink); font-size: 16px; } .day-h span { font-size: 13px; color: var(--ink-soft); }
.lane { background: var(--paper); border-radius: 4px; height: 38px; }
.fill { display: flex; gap: 4px; height: 100%; }
.blk { flex: 1; background: var(--slate); border-radius: 3px; position: relative; overflow: hidden; min-width: 6px; }
.day:first-child .blk { background: var(--teal); }
.blk i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 12px; color: #fff; line-height: 1.15; text-align: center; overflow: hidden; padding: 0 4px; }
.day-c { font-size: 14px; color: var(--ink-soft); }
.day-l { grid-column: 2 / -1; list-style: none; counter-reset: t; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); }
.day-l li { counter-increment: t; } .day-l li::before { content: counter(t) " "; font-weight: 600; color: var(--slate); }
.step { display: grid; grid-template-columns: 1.1fr 1fr 1.3fr; gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--paper-2); font-size: 15px; }
.step.head { border-top: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding-top: 0; }
.step-l { color: var(--ink); }
.step-bar { background: var(--paper); height: 14px; border-radius: 7px; overflow: hidden; }
.step-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--lamp), var(--rust)); border-radius: 7px; }
.step-r { color: var(--ink-2); }
.v-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cmp { background: var(--paper); border-radius: 6px; padding: 14px 16px; font-size: 16px; }
.cmp span { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.cmp.out { background: #e8eef7; }
.cmp-goal { grid-column: 1 / -1; text-align: center; font-size: 15px; color: var(--ink); padding-top: 26px; position: relative; }
.cmp-goal::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 16px; border: 2px solid var(--rule); border-top: 0; border-radius: 0 0 8px 8px; }

/* Coin card: two faces of one moment. Tap to turn it over. */
.coin { display: grid; width: 100%; border: 0; padding: 0; background: none; cursor: pointer; perspective: 1200px; font: inherit; text-align: center; }
.coin .face { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 170px; padding: 26px 28px; border-radius: 18px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .6s cubic-bezier(.3,.7,.2,1); }
.coin .front { background: radial-gradient(circle at 30% 20%, #fff8e6, var(--paper)); color: var(--ink); box-shadow: inset 0 0 0 2px var(--lamp-dim), inset 0 0 0 7px var(--paper-hi), inset 0 0 0 8px rgba(185,143,62,.45); }
.coin .back { background: radial-gradient(circle at 70% 20%, var(--night-3), var(--night)); color: var(--paper); transform: rotateY(180deg); box-shadow: inset 0 0 0 2px var(--lamp), inset 0 0 0 7px var(--night), inset 0 0 0 8px rgba(227,182,94,.4); }
.coin.flipped .front { transform: rotateY(-180deg); } .coin.flipped .back { transform: rotateY(0); }
.coin small { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--lamp-dim); }
.coin .back small { color: var(--lamp); }
.coin .face > span { font-family: var(--display); font-size: 25px; line-height: 1.3; }
.coin em { font-style: normal; font-size: 13px; opacity: .65; }
.coin:focus-visible { outline: 2px solid var(--lamp); outline-offset: 4px; border-radius: 18px; }
@media (prefers-reduced-motion: reduce) { .coin .face { transition: none; } }
@media print { .coin .back { transform: none; } .coin .face { position: static; } .coin em { display: none; } }

/* Sentence to carry */
.carry-card { background: var(--paper-hi); color: var(--ink); border-radius: 8px; padding: clamp(28px, 6vw, 56px); text-align: center; box-shadow: 0 18px 44px rgba(0,0,0,.3); border-top: 4px solid var(--lamp); }
.carry-card p { font-family: var(--display); font-size: clamp(26px, 4vw, 36px); line-height: 1.3; font-weight: 500; }
.carry-card p + p { margin-top: .6em; font-size: clamp(20px, 3vw, 26px); color: var(--ink-soft); font-style: italic; }

/* Your Own System: a private notebook */
.notebook { background: var(--paper-hi); color: var(--ink-2); border-radius: 8px; padding: clamp(22px, 4.5vw, 44px); border-left: 10px solid var(--paper-2); box-shadow: 0 18px 44px rgba(0,0,0,.3); }
.notebook > p:first-child { font-style: italic; color: var(--ink-soft); }
.notebook h3 { font-size: 26px; color: var(--ink); margin: 1.6em 0 .6em; }
.notebook h3:first-of-type { margin-top: 1em; }
.notebook td.blank { padding: 0; height: 52px; }
.notebook input { width: 100%; height: 100%; min-height: 52px; border: 0; background: transparent; font: 17px var(--body); padding: 0 12px; color: var(--ink); }
.notebook ol { margin: 1em 0 0 1.3em; }
.notebook ol li { margin-bottom: 26px; padding-left: 6px; }
.notebook ol textarea { display: block; width: 100%; margin-top: 10px; font: 17px/1.6 var(--body); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px; background: #fff; resize: vertical; }

/* Teacher's guide */
.tg .aim { background: var(--night-2); border: 1px solid rgba(227,182,94,.35); border-radius: 8px; padding: 26px 28px; }
.tg h3 { font-size: 24px; color: var(--paper); margin-bottom: 14px; font-weight: 500; }
.tg h3 small { font-family: var(--body); font-size: 14px; color: var(--dim); margin-left: 8px; }
.tg .aim h3 { color: var(--lamp); }
.tg-block { margin-top: 44px; }
.tg-two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.tg-two .tg-block { margin-top: 44px; }
.timeline { display: flex; gap: 3px; height: 34px; border-radius: 6px; overflow: hidden; }
.seg { display: grid; place-items: center; font-size: 13px; color: var(--night); }
.s0 { --c: #e3b65e; } .s1 { --c: #7cc4a2; } .s2 { --c: #8fb0de; } .s3 { --c: #e39a7e; } .s4 { --c: #c9cfdc; }
.seg { background: var(--c); }
.steps { list-style: none; margin-top: 22px; }
.steps li { display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 16px 0; border-top: 1px solid rgba(201,207,220,.12); }
.min { font-family: var(--display); font-size: 30px; color: var(--c); line-height: 1; text-align: right; }
.min small { display: block; font-family: var(--body); font-size: 12px; color: var(--dim); margin-top: 4px; }
.steps b { color: var(--paper); font-weight: 500; font-size: 19px; }
.steps p { color: var(--moon); font-size: 17px; margin-top: 4px; }
.mrs { display: grid; gap: 14px; }
.mr { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: stretch; }
.mr .m, .mr .r { border-radius: 6px; padding: 14px 16px; font-size: 16px; }
.mr span { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.mr .m { background: #2b2230; color: #f0d6cc; } .mr .m span { color: #e39a7e; }
.mr .r { background: #1e2f2b; color: #d4ece1; } .mr .r span { color: var(--ok, #7cc4a2); }
.arrow { position: relative; }
.arrow::before { content: ""; position: absolute; top: 50%; left: 6px; right: 10px; height: 2px; background: var(--dim); }
.arrow::after { content: ""; position: absolute; top: calc(50% - 5px); right: 6px; border: 6px solid transparent; border-left-color: var(--dim); border-right: 0; }
.checks { list-style: none; }
.checks li { position: relative; padding: 0 0 12px 32px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border: 2px solid var(--lamp); border-radius: 4px; }
.disc { list-style: none; counter-reset: d; }
.disc li { counter-increment: d; display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid rgba(201,207,220,.12); font-size: 18px; }
.disc li::before { content: counter(d); font-family: var(--display); font-size: 30px; color: var(--lamp); line-height: 1; }
.tg .chips li { background: var(--night-3); color: var(--moon); }
.care { margin-top: 44px; background: var(--night-2); border-radius: 8px; padding: 22px 26px; font-size: 17px; color: var(--moon); }
.care h3 { font-size: 20px; color: var(--moon); }

/* Review contents page */
.ix { list-style: none; margin-top: 40px; display: grid; gap: 10px; }
.ix a { display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; align-items: baseline; padding: 16px 20px; border-radius: 8px; background: var(--night-2); color: var(--moon); text-decoration: none; border: 1px solid rgba(201,207,220,.1); }
.ix a:hover { border-color: var(--lamp); }
.ix-n { grid-row: span 2; font-family: var(--display); font-size: 30px; color: var(--lamp); line-height: 1; }
.ix b { font-family: var(--display); font-size: 22px; font-weight: 500; color: var(--paper); }
.ix small { color: var(--dim); font-size: 14px; }

.foot { color: var(--dim); font-size: 13px; padding-top: 60px; padding-bottom: 50px; }

@media (max-width: 640px) {
  body { font-size: 18px; }
  .g-pair, .tg-two, .v-compare { grid-template-columns: 1fr; }
  .day { grid-template-columns: 1fr; gap: 6px; }
  .day-l { grid-column: 1; }
  .step { grid-template-columns: 1fr 1fr; }
  .step-r { grid-column: 1 / -1; padding-bottom: 4px; }
  .step.head { display: none; }
  .mr { grid-template-columns: 1fr; }
  .arrow { height: 22px; }
  .arrow::before { top: 2px; bottom: 6px; left: 50%; right: auto; width: 2px; height: auto; }
  .arrow::after { top: auto; bottom: 0; left: calc(50% - 5px); right: auto; border: 6px solid transparent; border-top-color: var(--dim); border-bottom: 0; }
  .legend li { flex-direction: column; gap: 4px; }
  .cmp-goal::before { left: 15%; right: 15%; }
}
@media print {
  body { background: #fff; color: #000; } .draft, .secnav, .write { display: none; }
  .guide { display: block; } .ex, .notebook, .paper { box-shadow: none; }
}
