/* =========================================================
   style.css — Main styles for WebDev ISU teaching site
   A calmer, paper-and-ink feel: warm off-white, muted navy,
   amber accent. Fewer gradients, softer shadows.
   ========================================================= */

/* ---------- CSS Variables ---------- */
:root {
  --primary-color: #2b4a7a;      /* muted navy */
  --primary-hover: #1f3a62;
  --secondary-color: #b45309;    /* warm amber */
  --secondary-hover: #92400e;
  --accent-color:   #0f766e;     /* deep teal accent (used sparingly) */
  --background-color: #f6f3eb;   /* warm paper */
  --background-alt:   #fbf9f3;
  --text-color: #1f2328;
  --text-muted: #5b6470;
  --card-bg: #ffffff;
  --border-color: #e3ddcd;       /* warm beige border */
  --border-strong: #c9c0a8;
  --code-bg: #1f2530;
  --code-text: #e6e3d8;
  --success: #2f7d4f;
  --error:   #b3261e;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 2px 6px rgba(31, 35, 40, 0.04);
  --shadow-lg: 0 4px 14px rgba(31, 35, 40, 0.10);
  --transition: 0.15s ease;
  --container-max: 1180px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  color: var(--text-color);
  background: var(--background-color);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Sans-serif for UI chrome / headings */
h1, h2, h3, h4,
.nav-link, .btn, .eyebrow, .editor-tag, .code-lang, .mini-label, .quiz-progress {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4 { color: var(--text-color); line-height: 1.3; margin: 0 0 12px; font-weight: 700; }
p { margin: 0 0 12px; }
a { color: var(--primary-color); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background: #efeadd;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  color: #2a2f3a;
  border: 1px solid #e3ddcd;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--primary-color);
  z-index: 999;
  transition: width 0.05s linear;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(251, 249, 243, 0.95);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}
.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.nav-logo:hover { color: var(--primary-color); }
.logo-mark {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 6px;
  background: var(--primary-color);
  color: #fbf9f3;
  font-size: 12px;
  font-weight: 700;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-left: auto;
}
.nav-link {
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}
.nav-link:hover { color: var(--primary-color); background: #ece6d4; }
.nav-link.active { color: var(--primary-color); background: #ece6d4; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary-color);
  color: #fbf9f3;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
  background: var(--secondary-color);
  color: #fbf9f3;
}
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-ghost {
  background: var(--background-alt);
  color: var(--text-color);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: #f1ecdc; border-color: #a89a78; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-tiny {
  padding: 3px 9px;
  font-size: 0.75rem;
  border-radius: 4px;
  background: #2a2f3a;
  color: #f5f3ec;
  border: none;
}
.btn-tiny:hover { background: #1a1d24; }

/* ---------- Sections ---------- */
.section {
  padding: 60px 0;
  border-bottom: 1px solid var(--border-color);
}
.section:last-of-type { border-bottom: none; }
.section-alt {
  background: var(--background-alt);
}
.section-title {
  font-size: clamp(1.5rem, 2vw, 1.95rem);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1.02rem;
  font-style: italic;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: 56px;
  padding-bottom: 56px;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.012) 0 1px, transparent 1px 28px),
    var(--background-color);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: var(--secondary-color);
  font-weight: 700;
}
.hero-title {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 700;
  margin: 10px 0 12px;
  color: var(--text-color);
  letter-spacing: -0.015em;
}
.hero-subtitle {
  font-size: 1.08rem;
  color: var(--text-muted);
  margin-bottom: 22px;
  max-width: 52ch;
}
.hero-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-visual img { width: 100%; height: auto; }

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover { border-color: var(--border-strong); }

/* ---------- Roadmap ---------- */
.roadmap-grid,
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.roadmap-card .duration {
  color: var(--secondary-color);
  font-weight: 700;
  margin-bottom: 4px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.92rem;
}
.roadmap-step {
  display: inline-flex;
  width: 30px; height: 30px;
  align-items: center; justify-content: center;
  background: var(--background-alt);
  color: var(--primary-color);
  border: 1.5px solid var(--primary-color);
  border-radius: 50%;
  font-weight: 700;
  margin-bottom: 10px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
}

/* ---------- Lesson layout ---------- */
.lesson-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.tag-list { list-style: none; padding: 0; margin: 0 0 16px; }
.tag-list li { padding: 6px 0; border-bottom: 1px dashed var(--border-color); }
.tag-list li:last-child { border-bottom: none; }

/* code blocks */
.code-block {
  background: var(--code-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid #2a2f3a;
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #161a22;
  border-bottom: 1px solid #2a2f3a;
}
.code-lang {
  color: #9aa3b2;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--code-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
}
.code-block pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border: none;
}

/* mini-preview */
.mini-preview {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.mini-label {
  color: var(--text-muted);
  font-size: 0.74rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.mini-preview-inner {
  background: var(--background-alt);
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  padding: 14px;
}
.mini-preview-inner.plain * { all: revert; }

.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.styled-demo h1 { font-size: 1.3rem; color: var(--primary-color); margin: 0 0 6px; }
.styled-demo p { margin: 0 0 10px; color: var(--text-color); }
.styled-demo button {
  background: var(--primary-color); color: #fbf9f3;
  padding: 8px 14px; border-radius: 6px; border: none; cursor: pointer;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.styled-demo button:hover { background: var(--primary-hover); }

/* ---------- JS demo cards ---------- */
.demo-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--secondary-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}
.demo-card.dark {
  background: #1f2530;
  color: #f0ece1;
  border-color: #2a2f3a;
  border-left-color: var(--secondary-color);
}
.demo-card h4 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

/* Demo "Show code" toggle */
.demo-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.demo-toggle {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.demo-toggle:hover { color: var(--text-color); border-color: var(--text-muted); }
.demo-toggle[aria-expanded="true"] { color: var(--primary-color); border-color: var(--primary-color); }

.demo-code {
  display: none;
  margin-top: 10px;
}
.demo-code.open { display: block; }

/* ---------- Templates ---------- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.template-card { display: flex; flex-direction: column; }
.template-preview {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  height: 140px;
  background: var(--background-alt);
  margin: 8px 0 12px;
}
.template-preview iframe {
  border: none;
  pointer-events: none;
  transform: scale(0.7);
  transform-origin: top left;
  width: 142.86%;
  height: 142.86%;
}
.template-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cheat sheet ---------- */
.cheat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.cheat-card ul { padding-left: 18px; margin: 0; }
.cheat-card li { padding: 4px 0; }
.cheat-card h3 {
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

/* ---------- Final project starters ---------- */
.final-style-note {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.final-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.final-style-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.final-style-card h3 {
  margin-bottom: 4px;
}

.final-style-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.final-style-sample {
  min-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sample-line {
  height: 10px;
  border-radius: 999px;
  width: 100%;
}

.sample-line-short {
  width: 58%;
}

.sample-card,
.sample-chip,
.sample-panel,
.sample-band {
  border-radius: 6px;
}

.sample-card {
  height: 44px;
  width: 100%;
}

.sample-chip {
  width: 82px;
  height: 24px;
}

.sample-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sample-panel {
  height: 44px;
}

.sample-band {
  height: 24px;
  width: 100%;
}

.final-style-editorial .final-style-sample {
  background: #f7f2e8;
}

.final-style-editorial .sample-line,
.final-style-editorial .sample-card {
  background: #d9cbb1;
}

.final-style-editorial .sample-chip {
  background: #2b4a7a;
}

.final-style-tech .final-style-sample {
  background: #171d27;
  border-color: #2f3642;
}

.final-style-tech .sample-line {
  background: #394252;
}

.final-style-tech .sample-panel {
  background: #222b38;
  border: 1px solid #3f4c62;
}

.final-style-tech .sample-chip {
  background: #38bdf8;
}

.final-style-poster .final-style-sample {
  background: #fbf1d8;
}

.final-style-poster .sample-band {
  background: #c2410c;
}

.final-style-poster .sample-line,
.final-style-poster .sample-chip {
  background: #f59e0b;
}

/* ---------- Checklist ---------- */
.checklist {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.checklist li {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  transition: var(--transition);
}
.checklist li:has(input:checked) {
  background: #eef3ec;
  border-color: #b8d2bb;
}
.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.checklist input { width: 16px; height: 16px; accent-color: var(--primary-color); }
.checklist-progress { color: var(--text-muted); font-weight: 600; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }

/* ---------- Wrap-up ---------- */
.wrap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.wrap-card { text-align: center; }
.wrap-card h3 { color: var(--primary-color); }
.big-takeaway {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 20px 22px;
  border-radius: var(--radius);
  font-size: 1.05rem;
  text-align: center;
  font-style: italic;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--secondary-color);
}

/* ---------- Footer ---------- */
.footer {
  padding: 22px 0;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--background-alt);
  font-size: 0.92rem;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #2a2f3a;
  color: #f5f3ec;
  padding: 9px 16px;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 1000;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Presentation mode ---------- */
body.presentation-mode { font-size: 18px; }
body.presentation-mode .section-title { font-size: 2.2rem; }
body.presentation-mode .section-subtitle { font-size: 1.15rem; }
body.presentation-mode p,
body.presentation-mode li { font-size: 1.05rem; }
body.presentation-mode .hint,
body.presentation-mode .eyebrow { display: none; }
body.presentation-mode .code-block pre { font-size: 1.05rem; line-height: 1.7; }
body.presentation-mode .navbar { background: var(--background-alt); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .lesson-grid { grid-template-columns: 1fr; }
  .before-after { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .section { padding: 44px 0; }
  .hero-title { font-size: 1.9rem; }
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .hero-buttons .btn { width: 100%; }
}

.hint { color: var(--text-muted); font-size: 0.9rem; font-style: italic; }
