/* =============================================================================
   Surrounded By… — shared workshop engine styles
   A clean, modern, professional light theme driven by a single --accent that
   each book sets from its data file. Matches the DISC workshop aesthetic.
   ========================================================================== */

:root {
  --accent: #2e6fd6;                 /* overridden per book from JS */
  --accent-ink: color-mix(in srgb, var(--accent) 72%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 40%, var(--line));

  --ink: #14181f;
  --ink-2: #3b4453;
  --muted: #6b7688;
  --line: #e6e9f0;
  --bg: #f6f8fc;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --card-2: #fbfcfe;

  --pos: #2a9d5c;
  --neg: #e0413c;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 31, 0.05), 0 4px 14px rgba(20, 24, 31, 0.05);
  --shadow-md: 0 10px 30px rgba(20, 24, 31, 0.09);
  --shadow-lg: 0 24px 60px rgba(20, 24, 31, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.wrap-narrow { width: min(760px, 100% - 2.5rem); margin-inline: auto; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 200; }
.skip-link:focus { left: 0; }
a { color: var(--accent-ink); }

/* ---- Nav ---- */
.topbar { position: sticky; top: 0; z-index: 100; background: rgba(246, 248, 252, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 900; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand-badge { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 1.05rem; background: var(--accent-soft); }
.nav-links { list-style: none; display: flex; gap: 4px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 0.92rem; padding: 8px 13px; border-radius: 10px; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--accent-ink); background: var(--accent-soft); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.2s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-body); font-weight: 600; font-size: 0.98rem; padding: 13px 24px; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease); white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 36%, transparent); }
.btn-primary:hover { background: var(--accent-ink); transform: translateY(-2px); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--accent-line); transform: translateY(-2px); }

/* ---- Hero ---- */
.hero { position: relative; padding: clamp(56px, 10vw, 108px) 0 clamp(46px, 7vw, 84px); text-align: center; overflow: hidden; background: radial-gradient(60% 60% at 15% 0%, var(--accent-soft), transparent 60%), radial-gradient(55% 55% at 85% 8%, var(--accent-soft), transparent 60%); }
.hero-inner { position: relative; z-index: 1; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.76rem; font-weight: 700; color: var(--accent-ink); margin-bottom: 18px; }
.kicker { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.74rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.hero-title { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.3rem, 6.5vw, 4.4rem); line-height: 1.03; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 20px; }
.hero-lead { max-width: 640px; margin: 0 auto 32px; font-size: clamp(1.05rem, 2.2vw, 1.22rem); color: var(--ink-2); }
.hero-lead em { color: var(--ink); font-style: italic; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 46px; }
.hero-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 760px; margin: 0 auto; }
.hero-card { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 16px 10px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.hero-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.hero-card span { font-size: 1.5rem; }
.hero-card b { font-size: 0.95rem; color: var(--ink); text-align: center; line-height: 1.2; }

/* ---- Sections ---- */
.section { padding: clamp(54px, 8vw, 94px) 0; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { text-align: center; max-width: 700px; margin: 0 auto clamp(30px, 5vw, 52px); }
.section-head h2 { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.9rem, 4.5vw, 2.8rem); letter-spacing: -0.02em; line-height: 1.08; color: var(--ink); margin-bottom: 14px; }
.section-sub { color: var(--ink-2); font-size: 1.05rem; }
.section-sub em { font-style: italic; color: var(--ink); }

/* ---- Concept cards ---- */
.concept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.concept-card { position: relative; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; cursor: pointer; overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease); }
.concept-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--accent); }
.concept-card:hover, .concept-card.selected { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--accent-line); }
.concept-card.selected { box-shadow: 0 0 0 2px var(--accent), var(--shadow-md); }
.cc-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: var(--accent-soft); margin-bottom: 14px; }
.cc-name { font-family: var(--font-display); font-weight: 800; font-size: 1.28rem; color: var(--ink); line-height: 1.12; margin-bottom: 6px; }
.cc-tag { color: var(--ink-2); font-size: 0.95rem; }
.cc-more { margin-top: 14px; font-weight: 600; font-size: 0.85rem; color: var(--accent-ink); }

.detail { margin-top: 24px; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow-md); animation: slideDown 0.4s var(--ease); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.detail-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-badge { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; background: var(--accent-soft); }
.detail-title { font-family: var(--font-display); font-weight: 900; font-size: 1.6rem; color: var(--ink); }
.detail-close { margin-left: auto; border: 1px solid var(--line); background: var(--card-2); border-radius: 999px; width: 38px; height: 38px; cursor: pointer; font-size: 1.1rem; color: var(--muted); }
.detail-close:hover { color: var(--ink); border-color: var(--muted); }
.detail-summary { color: var(--ink-2); font-size: 1.06rem; margin: 14px 0 20px; }
.detail-points { list-style: none; display: grid; gap: 10px; }
.detail-points li { position: relative; padding-left: 26px; color: var(--ink-2); }
.detail-points li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---- Quiz shell ---- */
.quiz-shell { max-width: 780px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(26px, 5vw, 48px); box-shadow: var(--shadow-md); }
.quiz-intro { text-align: center; }
.quiz-intro-icon { font-size: 2.6rem; display: block; margin-bottom: 12px; }
.quiz-intro h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin-bottom: 8px; }
.quiz-intro p { color: var(--ink-2); max-width: 480px; margin: 0 auto 22px; }
.name-input { display: block; width: min(360px, 100%); margin: 0 auto 20px; padding: 13px 18px; border: 1.5px solid var(--line); border-radius: 999px; font-family: var(--font-body); font-size: 1rem; text-align: center; color: var(--ink); transition: border-color 0.2s var(--ease); }
.name-input:focus { outline: none; border-color: var(--accent); }

.quiz-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.quiz-progress-bar { flex: 1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.quiz-progress-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width 0.4s var(--ease); }
.quiz-progress-text { font-weight: 600; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.quiz-question { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.28rem, 3vw, 1.62rem); line-height: 1.28; color: var(--ink); margin-bottom: 24px; min-height: 2.2em; }

.options { display: flex; flex-direction: column; gap: 12px; }
.opt { display: flex; align-items: center; gap: 14px; text-align: left; border: 1.5px solid var(--line); background: var(--card-2); border-radius: var(--radius-sm); padding: 16px 18px; font-family: var(--font-body); font-size: 1rem; font-weight: 500; color: var(--ink); cursor: pointer; transition: all 0.16s var(--ease); }
.opt::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); transition: all 0.16s var(--ease); }
.opt:hover { border-color: var(--accent); transform: translateX(4px); box-shadow: var(--shadow-sm); }
.opt:hover::before { border-color: var(--accent); background: var(--accent-soft); }
.opt.chosen { border-color: var(--accent); background: var(--accent-soft); }
.opt.chosen::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #fff; }
.quiz-back { margin-top: 22px; background: none; border: 0; color: var(--muted); font-family: var(--font-body); font-weight: 600; font-size: 0.9rem; cursor: pointer; padding: 6px 0; }
.quiz-back:hover { color: var(--ink); }

/* ---- Results ---- */
.result-head { text-align: center; margin-bottom: 28px; }
.result-eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.76rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.result-title { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.05; margin-bottom: 12px; color: var(--ink); }
.result-blurb { color: var(--ink-2); max-width: 580px; margin: 0 auto; font-size: 1.04rem; }

/* score meter */
.meter { max-width: 560px; margin: 0 auto 26px; }
.meter-track { height: 16px; border-radius: 999px; background: linear-gradient(90deg, var(--pos), #f0a500 55%, var(--neg)); position: relative; box-shadow: inset 0 1px 3px rgba(0,0,0,0.15); }
.meter-marker { position: absolute; top: 50%; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); transform: translate(-50%, -50%); transition: left 0.6s var(--ease); }
.meter-scale { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.score-badge { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 auto 6px; }
.score-num { font-family: var(--font-display); font-weight: 900; font-size: 3rem; line-height: 1; color: var(--accent); }
.score-den { font-size: 0.9rem; color: var(--muted); font-weight: 600; }

/* classify bars */
.result-bars { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin: 0 auto 26px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-key { width: 120px; flex: none; text-align: left; font-weight: 600; font-size: 0.9rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.bar-track { flex: 1; height: 14px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--c, var(--accent)); transition: width 0.6s var(--ease); }
.bar-val { width: 42px; flex: none; text-align: right; font-weight: 700; font-size: 0.84rem; color: var(--ink); }

.result-detail { background: var(--card-2); border: 1px solid var(--line); border-left: 6px solid var(--c, var(--accent)); border-radius: var(--radius-sm); padding: 24px 26px; margin-bottom: 24px; }
.result-detail h4 { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; margin-bottom: 10px; color: var(--ink); }
.result-detail p { color: var(--ink-2); margin-bottom: 12px; }
.result-detail p:last-child { margin-bottom: 0; }
.rd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 16px; }
.rd-grid h5 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.rd-grid ul { list-style: none; }
.rd-grid li { padding-left: 18px; position: relative; font-size: 0.94rem; color: var(--ink-2); margin-bottom: 4px; }
.rd-grid li::before { content: "›"; position: absolute; left: 2px; color: var(--c, var(--accent)); font-weight: 800; }

/* quiz review */
.review { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.review-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--card-2); }
.review-item.right { border-left: 5px solid var(--pos); }
.review-item.wrong { border-left: 5px solid var(--neg); }
.review-q { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.review-a { font-size: 0.92rem; color: var(--ink-2); }
.review-a b.right { color: var(--pos); }
.review-a b.wrong { color: var(--neg); }
.review-x { font-size: 0.9rem; color: var(--ink-2); margin-top: 6px; font-style: italic; }

.result-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---- Tips ---- */
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.tip-card { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: var(--radius); padding: 24px 22px; box-shadow: var(--shadow-sm); }
.tip-card.do { border-top-color: var(--pos); }
.tip-card.dont { border-top-color: var(--neg); }
.tip-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tip-badge { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem; background: var(--accent-soft); }
.tip-card.do .tip-badge { background: color-mix(in srgb, var(--pos) 15%, transparent); }
.tip-card.dont .tip-badge { background: color-mix(in srgb, var(--neg) 15%, transparent); }
.tip-head b { font-family: var(--font-display); font-weight: 800; font-size: 1.18rem; }
.tip-list { list-style: none; }
.tip-list li { padding-left: 24px; position: relative; font-size: 0.94rem; color: var(--ink-2); margin-bottom: 7px; }
.tip-list li::before { content: "›"; position: absolute; left: 4px; color: var(--accent); font-weight: 800; }
.tip-card.do .tip-list li::before { content: "✓"; color: var(--pos); }
.tip-card.dont .tip-list li::before { content: "✕"; color: var(--neg); }

/* ---- FAQ ---- */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.faq-item[open] { border-color: var(--accent-line); box-shadow: var(--shadow-sm); }
.faq-item summary { list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 600; font-size: 1.05rem; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.5rem; font-weight: 400; color: var(--accent); transition: transform 0.3s var(--ease); flex: none; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-a { padding: 0 22px 20px; color: var(--ink-2); font-size: 0.98rem; }
.faq-item .faq-a em { font-style: italic; color: var(--ink); }

/* ---- DISC colour cross-link ---- */
.disc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.disc-card { --c: var(--accent); background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow-sm); }
.disc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.disc-badge { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 1.3rem; background: color-mix(in srgb, var(--c) 15%, transparent); }
.disc-head b { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; display: block; color: var(--ink); }
.disc-head small { color: var(--c); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.disc-block { margin-bottom: 14px; }
.disc-block:last-child { margin-bottom: 0; }
.disc-block h5 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 4px; }
.disc-block p { color: var(--ink-2); font-size: 0.92rem; line-height: 1.55; }
.disc-cta { text-align: center; margin-top: 30px; }
@media (max-width: 900px) { .disc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .disc-grid { grid-template-columns: 1fr; } }

/* ---- Footer ---- */
.footer { background: var(--ink); color: #c7cfdd; padding: 44px 0; }
.footer-inner { text-align: center; }
.footer-note { max-width: 640px; margin: 0 auto 14px; font-size: 0.92rem; line-height: 1.6; }
.footer-note em { font-style: italic; color: #fff; }
.footer-support { max-width: 640px; margin: 0 auto 16px; font-size: 0.95rem; color: #e7ecf5; }
.footer-support strong { color: #fff; }
.footer-support em { font-style: italic; }
.footer-meta { font-size: 0.85rem; color: #8b95a8; }
.footer-meta a { color: #fff; text-decoration: none; }
.footer-meta a:hover { text-decoration: underline; }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: 10px 14px 16px; box-shadow: var(--shadow-md); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 14px; border-radius: 10px; }
  .hero-cards { grid-template-columns: repeat(2, 1fr); }
  .bar-key { width: 96px; }
}
@media (max-width: 440px) { .hero-cards { grid-template-columns: 1fr; } }

/* ---- Print ---- */
@media print {
  .topbar, .hero, .nav-toggle, .quiz-back, .result-actions, .footer, .quiz-progress, .skip-link { display: none !important; }
  body { background: #fff; }
  .section, .section.alt { padding: 12px 0; border: 0; background: #fff; }
  .quiz-shell { box-shadow: none; border: 1px solid #ccc; }
  .quiz-stage[hidden] { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
