/* TOPIC: CSS custom variables and typography */
:root {
  --ink: #153e32;
  --accent: #ccee95;
  --paper: #fbfcf8;
  --line: #b6c8bc;
  color: var(--ink);
  background: var(--paper);
  font: 100%/1.6 "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
header, main, footer { max-width: 76rem; margin: auto; padding-inline: clamp(1rem, 5vw, 4.5rem); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.13; }
h1 { font: 500 clamp(4rem, 9vw, 8.4rem)/.94 Georgia, serif; letter-spacing: -.065em; margin: .2em 0; }
h2 { font: 500 clamp(1.9rem, 4vw, 3.15rem)/1.08 Georgia, serif; margin-bottom: .55em; }
h3 { font-size: 1.35rem; margin: 2.1rem 0 .6rem; }
a { color: inherit; text-underline-offset: .17em; }
/* TOPIC: WWW navigation and keyboard accessibility */
.mast, nav ul { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.4rem; }
.mast { justify-content: space-between; border-bottom: 1px solid var(--line); padding-block: .9rem; }
.mast b { font: bold 1.4rem Georgia, serif; }
nav ul { list-style: none; margin: 0; padding: .55rem 0; }
nav a { display: inline-block; padding: .3rem 0; font-weight: 600; }
.skip { position: absolute; left: 1rem; top: -6rem; background: white; padding: .6rem; }
.skip:focus { top: .5rem; }
:focus-visible { outline: 3px solid #ba4a11; outline-offset: 3px; }
/* TOPIC: Responsive CSS Grid and user task hierarchy */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(1.5rem, 5vw, 5rem); align-items: center; padding: 2.5rem 0; }
.kicker, .authors, .mast span { font-size: .9rem; font-weight: 600; }
.kicker { letter-spacing: .07em; text-transform: uppercase; }
.intro { max-width: 32rem; font-size: 1.15rem; }
.authors { line-height: 1.55; }
.calc { padding: clamp(1.15rem, 3vw, 2rem); background: #eaf4da; border-top: .35rem solid var(--ink); }
.calc h2 { font-size: 2rem; }
/* TOPIC: Accessible form input, validation and status feedback */
label, input, small, output { display: block; }
label { font-weight: bold; margin-top: .8rem; }
input { width: 100%; font: inherit; border: 1px solid #617e69; background: white; padding: .45rem .7rem; }
small { font-size: .87rem; }
button { font: 600 1rem/1.4 inherit; font-family: inherit; font-size: 1rem; font-weight: 650; color: white; background: var(--ink); padding: .8rem 1.15rem; border: 0; margin: 1rem 0 .65rem; cursor: pointer; transition: background-color .15s; }
button:hover { background: #2d6042; }
output { font-weight: bold; }
/* TOPIC: Semantic disclosure controls and accessible reading layout */
.guides, .study { padding: 2.4rem 0; border-top: 1px solid var(--line); }
.guides details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: .85rem 0; font-size: 1.12rem; font-weight: 600; }
summary:hover { text-decoration: underline; }
.guides p, .study article { max-width: 54rem; }
.study h2 { max-width: 25ch; }
/* TOPIC: Database schema tables, diagrams and algorithm displays */
table { border-collapse: collapse; width: 100%; margin-bottom: 1.25rem; overflow-wrap: anywhere; }
caption { text-align: left; font-weight: bold; padding: .55rem 0; }
th, td { text-align: left; vertical-align: top; padding: .65rem; border-bottom: 1px solid var(--line); }
th { background: var(--ink); color: white; }
tbody tr:nth-child(odd) { background: #f0f4eb; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--ink); color: white; padding: 1rem; }
figure { margin: 1.2rem 0; }
figure img { width: 100%; height: auto; display: block; }
figcaption { font-size: .92rem; }
footer { padding-block: 2rem; border-top: 1px solid var(--line); }
/* TOPIC: Mobile reflow and reduced motion */
@media (max-width: 46rem) {
  .hero { grid-template-columns: 1fr; }
  th, td { padding: .35rem; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

/* TOPIC: Responsive editorial layout and semantic navigation */
:root { --paper: #fbfaf4; --ink: #123e32; --line: #b8c7b7; --accent: #d9ed9c; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font: bold 1.45rem Georgia, serif; text-decoration: none; }
.leaf { width: 1.4rem; height: 1.4rem; border-radius: 85% 15% 85% 15%; background: var(--ink); }
.mast span { font-weight: 500; }
nav ul a { text-decoration: none; }
nav a:hover { text-decoration: underline; }
.hero { grid-template-columns: 1fr 1fr; background: var(--ink); color: white; gap: 0; padding: 0; margin-block: .7rem 2rem; overflow: hidden; }
.hero-copy { padding: clamp(1.6rem, 4vw, 3.5rem); }
.hero h1 { font-size: clamp(4rem, 7.8vw, 7.1rem); margin: .24em 0; }
.hero i { color: var(--accent); }
.hero .kicker { color: var(--accent); }
.canopy { width: 100%; height: 100%; min-height: 21rem; object-fit: cover; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .9rem 1.3rem; }
.cta, button { border-radius: .35rem; }
.cta { background: var(--accent); color: var(--ink); padding: .7rem 1rem; font-weight: 700; text-decoration: none; }
.cta:hover { background: white; }
.guide-layout, .lab { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr); gap: clamp(1rem, 4vw, 3.5rem); }
.guides h2, .portfolio h2 { margin-bottom: .4em; }
.guides .kicker, .lab .kicker, .portfolio .kicker { margin-bottom: .5rem; }
.guide { border-top: 1px solid var(--line); }
.guides details { border-bottom: 0; }
.guide:last-child { border-bottom: 1px solid var(--line); }
.guide summary { padding: 1rem .3rem; }
.guide summary small { display: inline; margin-left: .6rem; font-weight: normal; color: #486151; }
.guide[open] { background: #eef2e6; }
.guide-body { padding: .3rem 1.2rem 1rem; }
.guide-body h3 { margin-top: 0; }
.guide-body select { max-width: 24rem; margin-bottom: .8rem; }
select, input { width: 100%; border: 1px solid #627568; border-radius: .32rem; padding: .55rem .65rem; background: white; color: var(--ink); font: inherit; }
#category { max-width: 17rem; }
#count { margin-top: .6rem; }
.lab { grid-template-columns: 1.05fr .95fr; background: #ecf1df; padding: clamp(1.2rem, 4vw, 3rem); align-items: center; }
.reading { color: white; background: var(--ink); padding: clamp(1.25rem, 3vw, 2.5rem); border-radius: .45rem; }
.reading output { font: 500 clamp(1.6rem, 3vw, 2.65rem)/1.16 Georgia, serif; margin: 1rem 0; }
.reading button { color: var(--ink); background: var(--accent); }
.reading button:disabled { background: #c2ccbf; color: #364438; cursor: default; }
.reading #clear { background: transparent; color: white; text-decoration: underline; padding: .3rem 0; margin: 0; }
.portfolio { padding: 3.25rem 0 1rem; }
.chapter-links { display: flex; flex-wrap: wrap; gap: .5rem 1rem; border-left: 3px solid #678d55; padding: .6rem 1rem; margin-bottom: 1.6rem; max-width: 54rem; }
.chapter-links a { font-size: .94rem; }
.study { scroll-margin-top: .5rem; }
[hidden] { display: none !important; }
@media (max-width: 46rem) {
  .hero, .guide-layout, .lab { grid-template-columns: minmax(0,1fr); }
  .canopy { min-height: 0; height: clamp(10rem,45vw,17rem); }
  .guide-layout { gap: .65rem; }
  nav ul { gap: .15rem 1rem; }
}

/* TOPIC: Responsive visual hierarchy and interactive field-guide states */
.hero { border-radius: 1.4rem; box-shadow: 0 12px 34px #143c281a; }
.hero-copy { position: relative; z-index: 1; }
.hero .cta { border-radius: 2rem; }
.mast { padding-block: 1.1rem; }
nav ul a { border-radius: 2rem; padding: .35rem .65rem; }
nav ul a:hover, nav ul a:focus-visible { background: #e0ebd4; }
.guide { background: #f2f4eb; border: 1px solid #cbd5c6; border-radius: .8rem; margin-bottom: .55rem; }
.guides details { border-bottom: 1px solid #cbd5c6; }
.guide summary { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .6rem; padding: 1rem; list-style: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: "+"; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #dae6c6; font: 1.35rem/1 Arial, sans-serif; }
.guide[open] summary::after { transform: rotate(45deg); }
.guide summary:hover { text-decoration: none; }
.guide[open] { background: #f9fbf2; border-color: #77966d; }
.lab, .challenge { border-radius: 1.2rem; margin: 1.5rem 0; }
.reading { border-radius: 1rem; }
.bar-row { display: grid; grid-template-columns: 4rem minmax(1rem,1fr) auto; gap: .5rem; align-items: center; }
.track { height: .55rem; border-radius: .5rem; background: #ffffff2b; overflow: hidden; }
.track i { display: block; height: 100%; background: #d5f597; width: 0; border-radius: inherit; }
#saved-bar { background: #ffd28a; }
#energy-chart { margin: .75rem 0; }
/* TOPIC: Accessible question progression and feedback states */
.challenge { background: #f4e6c9; padding: clamp(1.25rem,4vw,3rem); display: grid; grid-template-columns: .75fr 1.25fr; gap: clamp(1rem,4vw,4rem); align-items: start; }
.quiz-panel { background: #fffcf6; border: 1px solid #d8cbb5; border-radius: .95rem; padding: clamp(1rem,2.6vw,2rem); }
.quiz-panel h3 { margin: .25rem 0 1.2rem; line-height: 1.32; }
#quiz-position { font-size: .9rem; font-weight: 650; color: #66512b; }
#quiz-choices { display: grid; gap: .5rem; }
#quiz-choices button { margin: 0; text-align: left; color: var(--ink); background: white; border: 1px solid #abbba6; }
#quiz-choices button:hover { background: #f0f5e8; }
#quiz-choices .correct { background: #deefcb; border-color: #487441; }
#quiz-choices .missed { background: #fbe5d2; border-color: #a96137; }
#quiz-choices [aria-disabled="true"] { cursor: default; }
.feedback { margin: 1rem 0 0; }
.feedback:empty { margin: 0; }
.steps { display: flex; gap: .4rem; max-width: 13rem; }
.steps i { height: .42rem; flex: 1; border-radius: 1rem; background: #cabc9f; }
.steps .complete { background: #326542; }
@media (max-width: 46rem) { .challenge { grid-template-columns: minmax(0,1fr); } }
/* TOPIC: Motion preferences, progressive enhancement and interaction feedback */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero-copy, .guide[open] .guide-body, .feedback:not(:empty) { animation: arrive .32s ease-out both; }
  .canopy { animation: settle .8s ease-out both; }
  .track i { transition: width .45s ease-out; }
  .steps i, nav a, .guide, .guide summary::after, button, .cta { transition: transform .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
  @media (hover: hover) {
    .guide:hover { transform: translateX(3px); border-color: #77966d; }
    button:enabled:not([aria-disabled="true"]):hover, .cta:hover { transform: translateY(-2px); box-shadow: 0 4px 10px #123e321a; }
  }
  @keyframes arrive { from { opacity: .15; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes settle { from { transform: scale(1.045); } to { transform: scale(1); } }
}

/* TOPIC: Responsive field-notebook design and accessible checkboxes */
:root { --paper:#faf5e9; --ink:#173e32; --accent:#f2bc64; }
.cover {display:grid;grid-template-columns:1fr 1fr;align-items:stretch;background:#f0e8d3;margin:1rem 0 2rem;border-block:2px solid var(--ink)}
.cover>div {padding:clamp(1.4rem,4vw,4rem)}
.cover h1 {font:500 clamp(3rem,6.2vw,6rem)/.99 Georgia,serif;letter-spacing:-.06em;margin:.25em 0}
.cover p:not(.kicker){max-width:31rem;font-size:1.1rem}
.cover img {width:100%;height:100%;max-height:35rem;object-fit:cover}
.cover .cta {display:inline-block;background:#214635;color:white;border-radius:.25rem;margin-top:.5rem}
#day {padding-block:2rem}.schedule {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr));gap:1rem}
.task {display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#fffdf7;border:1px solid #afbdab;border-top:4px solid #aa6238;cursor:pointer}
.task input {width:1.2rem;height:1.2rem;accent-color:#215b40;flex:none}.task small,.task strong,.task span span {display:block}.task small {color:#744226}.task span span {font-weight:400;margin-top:.4rem}.task:has(:checked){background:#e1edd8;border-top-color:#285733}
#plan {padding:1rem;border-left:4px solid #285733;margin-top:1.2rem;background:#edf1e3}
@media(max-width:46rem){.cover{grid-template-columns:1fr}.cover img{height:13rem}}
