/* ==========================================================================
   04-design-insights.css  |  PAGE STYLES: design-insights.html
   Only used by design-insights.html. It loads after 00-global.css, so rules here can override global ones.
   ========================================================================== */

:root {
  --font-head: "Merriweather", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --page-bg: #101213; --surface: #16191c; --surface-border: rgba(255,255,255,.08);
  --chip-bg: rgba(255,255,255,.04); --chip-border: rgba(255,255,255,.10);
  --text: #ffffff; --text-soft: #c9ced6; --text-muted: #7f8792;
  --accent: #f45a0a; --accent-hover: #ff6d22; --accent-soft: rgba(244,90,10,.12);
  --toggle-bg: rgba(255,255,255,.08); --toggle-border: rgba(255,255,255,.16);
  --glass-bg: linear-gradient(145deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.05) 100%);
  --glass-border: rgba(255,255,255,.22); --glass-highlight: rgba(255,255,255,.28); --glass-shadow: 0 10px 30px rgba(0,0,0,.35);

  --radius: 18px; --gap: 20px; --page-pad: clamp(16px, 2.5vw, 48px); --content: 1120px;
}
:root[data-theme="light"] {
  --page-bg: #f4f2ee; --surface: #ffffff; --surface-border: rgba(0,0,0,.08);
  --chip-bg: #f7f5f2; --chip-border: rgba(0,0,0,.08);
  --text: #161616; --text-soft: #4a4f57; --text-muted: #6b6b6b;
  --accent: #d94e05; --accent-hover: #bf4404; --accent-soft: rgba(217,78,5,.10);
  --toggle-bg: #ffffff; --toggle-border: rgba(0,0,0,.12);
  --glass-bg: linear-gradient(145deg, rgba(255,255,255,.75) 0%, rgba(255,255,255,.35) 100%);
  --glass-border: rgba(0,0,0,.10); --glass-highlight: rgba(255,255,255,.9); --glass-shadow: 0 10px 30px rgba(0,0,0,.12);

}
* { box-sizing: border-box; }
html, body, .card, .chip { transition: background-color 400ms ease, color 400ms ease, border-color 400ms ease; }
html { background: var(--page-bg); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--page-bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.6; }

.page { width: 100%; max-width: calc(var(--content) + var(--page-pad) * 2); margin: 0 auto; padding: 40px var(--page-pad) 24px; }

/* Intro */
.intro { text-align: center; margin-bottom: 48px; }
.intro h1 { margin: 0; font-size: clamp(40px, 4vw, 64px); line-height: 1.1; letter-spacing: -0.015em; }

.intro p { max-width: 780px; margin: 16px auto 0; font-size: clamp(16px, 1.25vw, 20px); color: var(--text-soft); }

/* Section headings */
.sec { margin-top: 64px; }
.sec-title { margin: 0 0 8px; text-align: center; font-size: clamp(26px, 2.4vw, 36px); line-height: 1.2; }
.sec-sub { max-width: 680px; margin: 0 auto 32px; text-align: center; color: var(--text-soft); }

/* Icon badge */
.ic { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px; color: var(--accent); background: var(--accent-soft); }
.ic svg { width: 26px; height: 26px; }
.ic.sm { width: 40px; height: 40px; border-radius: 12px; }
.ic.sm svg { width: 22px; height: 22px; }

/* Sticky jump bar + reading progress */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.jump { position: sticky; top: var(--jump-top, 0); z-index: 800; margin: 0 calc(var(--page-pad) * -1) 28px; padding: 0 var(--page-pad); background: color-mix(in srgb, var(--page-bg) 82%, transparent); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--surface-border); transition: top 320ms cubic-bezier(.22,1,.36,1), background-color 400ms ease; }
.jump-list { display: flex; gap: 4px; justify-content: safe center; margin: 0; padding: 8px 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.jump-list::-webkit-scrollbar { display: none; }
.jump-list li { flex: none; }
.jump-list a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; color: var(--text-soft); font-size: 14px; font-weight: 700; text-decoration: none; transition: color 250ms ease, background-color 250ms ease, border-color 250ms ease; }
.jump-list a:hover { color: var(--text); border-color: var(--chip-border); }
.jump-list a.is-current { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.jump-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; overflow: hidden; }
.jump-progress span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.sec, .igroup, .takeaways { scroll-margin-top: 84px; }
[hidden] { display: none !important; }

/* Search + topic filter */
.finder { margin-bottom: 8px; padding: 24px 24px; }
.finder-row { display: flex; gap: 8px; align-items: center; }
.finder-box { display: flex; flex: 1; align-items: center; gap: 16px; min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--chip-border); background: var(--chip-bg); color: var(--text-muted); transition: border-color 250ms ease; }
.finder-box:focus-within { border-color: var(--accent); }
.finder-box svg { width: 20px; height: 20px; flex: none; }
.finder-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 600 16px/1.2 var(--font-body); }
.finder-box input::placeholder { color: var(--text-muted); font-weight: 400; }
.finder-clear { min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--chip-border); background: var(--chip-bg); color: var(--text); font: 700 15px/1 var(--font-body); cursor: pointer; }
.finder-clear:hover { border-color: var(--accent); color: var(--accent); }
.finder-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fchip { min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--chip-border); background: var(--chip-bg); color: var(--text); font: 700 14px/1 var(--font-body); cursor: pointer; transition: border-color 250ms ease, color 250ms ease, background-color 250ms ease; }
.fchip:hover { border-color: var(--accent); color: var(--accent); }
.fchip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fchip.is-on:not([data-filter="all"]) { display: inline-flex; align-items: center; gap: 8px; padding-right: 8px; }
.fchip.is-on:not([data-filter="all"])::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.25) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 10px no-repeat; transition: background-color 200ms ease; }
.fchip.is-on:not([data-filter="all"]):hover::after { background-color: rgba(0,0,0,.28); }
.finder-status { min-height: 1.4em; margin: 16px 0 0; color: var(--text-soft); font-size: 15px; font-weight: 600; }
.finder-status:empty { margin: 0; min-height: 0; }
.finder-status.is-empty { color: var(--accent); }

/* Core principles */
.principles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin: 0; padding: 0; list-style: none; }
.principle { display: flex; flex-direction: column; align-items: center; padding: 32px 24px; text-align: center; transition: border-color 250ms ease, transform 250ms ease, background-color 400ms ease; }
.principle:hover { border-color: var(--accent); transform: translateY(-3px); }
.principle h3 { margin: 16px 0 8px; font-size: 18px; line-height: 1.3; }
.principle p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* Insight groups */
.igroup { margin-top: 40px; }
.ghead { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.ghead h3 { margin: 0; font-size: 21px; line-height: 1.25; }
.insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin: 0; padding: 0; list-style: none; }
.insight { padding: 24px; transition: border-color 250ms ease, transform 250ms ease, background-color 400ms ease; }
.insight:hover { border-color: var(--accent); transform: translateY(-3px); }
.insight h4 { margin: 0 0 16px; font-family: var(--font-head); font-size: 17px; line-height: 1.35; }
.insight p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* In-practice note */
.practice { margin: 16px 0 0 !important; padding-top: 16px; border-top: 1px dashed var(--chip-border); color: var(--text-soft); font-size: 14.5px !important; }
.practice strong { display: block; margin-bottom: 4px; color: var(--accent); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.practice a { display: inline-block; margin-top: 8px; color: var(--accent); font-weight: 700; text-decoration: none; }
.practice a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Laws of UX */
.laws { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin: 0; padding: 0; list-style: none; }
.law { padding: 24px 24px; border-left: 3px solid var(--accent); }
.law h3 { margin: 0 0 8px; font-size: 17px; }
.law p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* Lessons */
.lessons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin: 0; padding: 0; list-style: none; counter-reset: l; }
.lesson { padding: 24px; }
.lesson .num { display: block; margin-bottom: 8px; color: var(--accent); font-family: var(--font-head); font-size: 28px; font-weight: 700; line-height: 1; }
.lesson h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.35; }
.lesson p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* Glossary */
.glossary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px var(--gap); margin: 0; }
.term { padding: 16px 24px; }
.term dt { margin: 0 0 4px; color: var(--accent); font-weight: 700; font-size: 16px; }
.term dd { margin: 0; color: var(--text-soft); font-size: 15px; }

/* FAQ */
.faqs { display: grid; gap: 16px; max-width: 860px; margin: 0 auto; padding: 0; list-style: none; }
.faq details { padding: 0; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; color: var(--accent); font-size: 24px; line-height: 1; transition: transform 250ms ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent); }
.faq p { margin: 0; padding: 0 24px 24px; color: var(--text-soft); }

/* Tools */
.tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin: 0; padding: 0; list-style: none; }
.tool { padding: 24px; }
.thead { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.thead h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 16px; border-radius: 999px; border: 1px solid var(--chip-border); background: var(--chip-bg); color: var(--text); font-size: 14px; font-weight: 600; transition: border-color 250ms ease, color 250ms ease, transform 250ms ease, background-color 400ms ease; }
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* Key takeaways */
.takeaways { margin-top: 64px; padding: 40px 32px; text-align: center; background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--surface); border-color: color-mix(in srgb, var(--accent) 30%, var(--surface-border)); }
.takeaways .ic { margin: 0 auto 16px; }
.takeaways h2 { margin: 0 0 8px; font-size: clamp(22px, 2vw, 28px); }
.take-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; max-width: 900px; margin: 16px auto 0; text-align: left; }
.take-cols h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-family: var(--font-body); font-size: 16px; color: var(--accent); }
.take-cols h3 svg { width: 16px; height: 16px; }
.take-cols ul { margin: 0; padding-left: 24px; color: var(--text-soft); }
.take-cols li { margin-bottom: 8px; padding-left: 4px; }
.take-cols li::marker { color: var(--accent); }

/* Call to action */
.cta { margin-top: 48px; padding: 48px 32px; text-align: center; }
.cta h2 { margin: 0 0 16px; font-size: 24px; line-height: 1.25; }
.cta p { max-width: 720px; margin: 0 auto; color: var(--text-soft); }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 12px; border: 1px solid transparent; font: 700 16px/1 var(--font-body); text-decoration: none; transition: background-color 250ms ease, border-color 250ms ease, transform 250ms ease, color 250ms ease; }
.btn svg { width: 18px; height: 18px; transition: transform 250ms ease; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-ghost { background: var(--chip-bg); border-color: var(--chip-border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.page-footer { padding: 32px 16px 0; color: var(--text-muted); font-size: 14px; text-align: center; }

.back-to-top { position: fixed; right: clamp(16px, 2vw, 40px); bottom: clamp(16px, 2vw, 40px); z-index: 20; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text); cursor: pointer; backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); opacity: 0; visibility: hidden; transform: translateY(16px); transition: opacity 300ms ease, transform 300ms ease, visibility 300ms, color 400ms ease, border-color 400ms ease; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

.reveal { animation: rise 700ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.js .reveal-on-scroll.is-in { opacity: 1; transform: none; transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1); }

@media (max-width: 991.98px) {
  .laws, .lessons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles, .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .insights, .take-cols, .glossary, .laws, .lessons { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
  :root { --gap: 14px; --radius: 15px; --page-pad: 12px; }
  .jump-list { justify-content: flex-start; }
  .finder { padding: 16px; }
  .finder-row { flex-wrap: wrap; }
  .finder-clear { width: 100%; }
  .principles, .tools { grid-template-columns: minmax(0, 1fr); }
  .insight, .tool { padding: 24px; }
  .takeaways { padding: 32px 24px; }
  .btn { width: 100%; }
}
@media (min-width: 1920px) { :root { --content: 1280px; } }
@media (min-width: 2560px) {
  :root { --content: 1680px; --gap: 28px; --radius: 24px; }
  body { font-size: 20px; }
  .intro h1 { font-size: 88px; }
  .intro p { font-size: 26px; max-width: 1000px; }
  .sec-title { font-size: 48px; }
  .ic { width: 64px; height: 64px; } .ic svg { width: 34px; height: 34px; }
  .ic.sm { width: 52px; height: 52px; } .ic.sm svg { width: 28px; height: 28px; }
  .principle h3, .thead h3 { font-size: 24px; } .principle p, .insight p { font-size: 19px; }
  .ghead h3 { font-size: 28px; } .insight h4 { font-size: 22px; }
  .chip { font-size: 18px; min-height: 46px; padding: 8px 16px; }
  .btn { font-size: 20px; min-height: 58px; }
  .back-to-top { width: 68px; height: 68px; } .back-to-top svg { width: 28px; height: 28px; }
  .page-footer { font-size: 18px; }
}
@media (min-width: 3840px) {
  :root { --content: 2400px; --gap: 36px; --radius: 30px; }
  body { font-size: 26px; }
  .intro h1 { font-size: 120px; }
  .sec-title { font-size: 64px; }
  .ghead h3 { font-size: 36px; } .insight h4 { font-size: 28px; }
  .chip { font-size: 24px; min-height: 60px; }
  .page-footer { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  .js .reveal-on-scroll { opacity: 1; transform: none; }
  .jump, .jump-list a, .fchip, .finder-box { transition: none; }
  .faq summary::after { transition: none; }
  .chip, .back-to-top, .principle, .insight, .btn, .btn svg { transition: none; }
  .chip:hover, .back-to-top:hover, .principle:hover, .insight:hover, .btn:hover { transform: none; }
}

/* audit fix: search box shrinks inside its row on 320px phones */
.finder-row > * { min-width: 0; }
.finder-box { min-width: 0; }
/* Touch screens: bigger tap area on the case study links without moving the layout */
@media (pointer:coarse){.insight a{display:inline-block;padding-block:11px;margin-block:-11px}}
