/* ============================================================
   NGSS STAMP — the standards passport (loops/ngss-passport.md)
   Hero button → white popup with the unit's official standard,
   stamped in one code at a time. Sibling to khan-watch/khan-sketch
   — those files are never edited.
   ============================================================ */

/* ---------- the hero button ---------- */
.ngss-open {
  display: inline-flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px;
  background: #FFFDF6;
  border: 1.5px dashed rgb(13 13 17 / 0.35);
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-900);
  transform: rotate(-1.1deg);
  box-shadow: 0 2px 0 rgb(13 13 17 / 0.12);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s, box-shadow 0.3s;
}
.ngss-open:hover {
  transform: rotate(0) translateY(-2px);
  border-color: var(--amber-500);
  box-shadow: 0 6px 18px -6px rgb(13 13 17 / 0.25);
}
.ngss-open:focus-visible { outline: 2px solid var(--iris-500); outline-offset: 2px; }
.ngss-open-codes { color: var(--iris-500); }
.ngss-open-cta { color: var(--ink-300); transition: color 0.3s; }
.ngss-open:hover .ngss-open-cta { color: var(--amber-500); }

/* ---------- overlay ---------- */
.ngss-overlay {
  position: fixed; inset: 0; z-index: 2200;
  background: rgb(13 13 17 / 0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.ngss-overlay.show { opacity: 1; pointer-events: auto; }

/* ---------- the white card ---------- */
.ngss-card {
  width: min(860px, 100%);
  max-height: 88vh; overflow-y: auto;
  background: #FFFDF6;
  border-radius: 22px;
  padding: clamp(26px, 4vw, 46px);
  box-shadow: 0 40px 100px -20px rgb(0 0 0 / 0.5);
  transform: translateY(26px) scale(0.965); opacity: 0;
}
.ngss-overlay.show .ngss-card {
  animation: ngss-in 0.5s cubic-bezier(0.22, 1.2, 0.36, 1) forwards;
}
@keyframes ngss-in {
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.ngss-card.impact { animation: ngss-shake 0.3s ease; }
@keyframes ngss-shake {
  0%, 100% { transform: translateY(0) scale(1) rotate(0); }
  30% { transform: translateY(1.5px) scale(1) rotate(-0.35deg); }
  65% { transform: translateY(-1px) scale(1) rotate(0.25deg); }
}

/* head */
.ngss-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-bottom: 26px;
}
.ngss-eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--iris-500);
}
.ngss-close {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid rgb(13 13 17 / 0.18); background: none;
  font-size: 17px; line-height: 1; color: var(--ink-700); cursor: pointer;
  transition: all 0.25s;
}
.ngss-close:hover { border-color: var(--amber-500); color: var(--amber-500); transform: rotate(90deg); }

/* the stamped codes */
.ngss-codes {
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
  padding: 8px 0 26px;
}
.ngss-code {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(1.3rem, 3vw, 1.8rem); letter-spacing: 0.06em;
  color: var(--iris-500);
  border: 2.5px dashed currentColor; border-radius: 10px;
  padding: 12px 20px;
  opacity: 0;
  transform: scale(2.2) rotate(-13deg);
}
.ngss-code.stamped {
  animation: ngss-slam 0.45s cubic-bezier(0.22, 1.4, 0.36, 1) forwards;
}
@keyframes ngss-slam {
  0%   { opacity: 0; transform: scale(2.2) rotate(-13deg); }
  60%  { opacity: 1; transform: scale(0.94) rotate(-3deg); }
  100% { opacity: 1; transform: scale(1) rotate(-4deg); }
}
.ngss-code:nth-child(2).stamped { transform: rotate(3deg); }
@keyframes ngss-slam-2 {
  0%   { opacity: 0; transform: scale(2.2) rotate(11deg); }
  60%  { opacity: 1; transform: scale(0.94) rotate(2.5deg); }
  100% { opacity: 1; transform: scale(1) rotate(3deg); }
}
.ngss-code:nth-child(2).stamped { animation-name: ngss-slam-2; }

/* optional context for a focused practice or grade band */
.ngss-context {
  margin: 0 0 4px;
  padding: 18px 20px 16px;
  border: 1px solid rgb(13 13 17 / 0.12);
  border-radius: 14px;
  background: rgb(91 84 214 / 0.055);
}
.ngss-context-kicker {
  margin: 0 0 8px;
  color: var(--iris-500);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ngss-context-title {
  margin: 0 0 8px;
  color: var(--ink-900);
  font-family: var(--font-display, inherit);
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
  line-height: 1.15;
}
.ngss-context-intro {
  max-width: 720px;
  margin: 0;
  color: var(--ink-500);
  font-size: 14.5px;
  line-height: 1.5;
}

/* standards blocks */
.ngss-std { border-top: 1px solid rgb(13 13 17 / 0.1); padding: 20px 0 4px; }
.ngss-std-code {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber-500);
}
.ngss-official {
  font-size: clamp(1rem, 1.6vw, 1.12rem); line-height: 1.55; color: var(--ink-900);
  border-left: 3px solid var(--amber-500); padding-left: 16px;
  margin: 10px 0 12px;
}
.ngss-official-link {
  display: inline-flex;
  align-items: center;
  margin: -2px 0 14px;
  color: var(--iris-500);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ngss-official-link:hover { color: var(--amber-500); }
.ngss-plain { font-size: 14.5px; color: var(--ink-500); margin-bottom: 12px; }
.ngss-plain strong { color: var(--iris-500); font-weight: 700; }
.ngss-spots {
  display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.ngss-spots-label {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-300);
}
.ngss-spot {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid rgb(13 13 17 / 0.16); border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 700; color: var(--ink-700);
  text-decoration: none;
  transition: all 0.25s;
}
.ngss-spot:hover { border-color: var(--iris-500); color: var(--iris-500); transform: translateY(-2px); }

/* meta footer */
.ngss-meta {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px dashed rgb(13 13 17 / 0.18);
  display: grid; gap: 7px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-500);
}
.ngss-meta strong { color: var(--ink-900); }
.ngss-meta a { color: var(--iris-500); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Passport v2 ---------- */
.ngss-card-v2 { width: min(980px, 100%); }
.ngss-head-copy { display: grid; gap: 7px; }
.ngss-v2-heading {
  margin: 0; color: var(--ink-900);
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(1.8rem, 4vw, 3.2rem); line-height: 0.95;
  letter-spacing: -0.04em;
}
.ngss-status {
  justify-self: start; padding: 5px 9px; border-radius: 999px;
  background: rgb(232 112 58 / 0.12); color: var(--amber-500);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.ngss-view-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: -4px 0 24px; padding: 10px 0;
  border-top: 1px solid rgb(13 13 17 / 0.1);
  border-bottom: 1px solid rgb(13 13 17 / 0.1);
}
.ngss-view-label {
  color: var(--ink-300); font-family: var(--font-mono); font-size: 10px;
  font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.ngss-view-toggle {
  border: 1.5px solid rgb(13 13 17 / 0.18); border-radius: 999px;
  background: transparent; padding: 8px 13px; color: var(--iris-500);
  cursor: pointer; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}
.ngss-view-toggle:hover, .ngss-view-toggle:focus-visible {
  border-color: var(--iris-500); background: var(--iris-500); color: #FFFDF6;
}
.ngss-view-toggle:focus-visible { outline: 2px solid var(--amber-500); outline-offset: 3px; }
.ngss-v2-intro { margin-bottom: 24px; padding: 22px; border-radius: 14px; background: #F3EDDB; }
.ngss-v2-kicker {
  display: block; margin-bottom: 9px; color: var(--amber-500);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
}
.ngss-v2-intro h3, .ngss-v2-section h3 {
  margin: 0 0 10px; color: var(--ink-900);
  font-family: var(--font-display, Georgia, serif); font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.05; letter-spacing: -0.025em;
}
.ngss-v2-intro p { margin: 0; color: var(--ink-700); font-size: 15px; line-height: 1.55; }
.ngss-v2-intro .ngss-v2-together { margin-top: 15px; padding-top: 15px; border-top: 1px solid rgb(13 13 17 / 0.12); }
.ngss-v2-together strong { color: var(--iris-500); }
.ngss-v2-section { padding: 22px 0 7px; border-top: 1px solid rgb(13 13 17 / 0.1); }
.ngss-v2-note { max-width: 64ch; margin: -1px 0 14px; color: var(--ink-500); font-size: 14px; line-height: 1.5; }
.ngss-v2-item {
  margin: 12px 0; padding: 18px 19px; border: 1px solid rgb(13 13 17 / 0.13);
  border-radius: 14px; background: rgb(255 255 255 / 0.38);
}
.ngss-v2-item-head { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.ngss-v2-code {
  color: var(--iris-500); font-family: var(--font-mono); font-size: 11px;
  font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.ngss-role, .ngss-evidence-state {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 4px 8px; background: rgb(232 112 58 / 0.12); color: var(--amber-500);
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.ngss-v2-item h4 { margin: 0 0 9px; color: var(--ink-900); font-size: 1.08rem; line-height: 1.2; }
.ngss-v2-official {
  margin: 0 0 8px; padding: 11px 14px; border-left: 3px solid var(--amber-500);
  background: rgb(255 253 246 / 0.65); color: var(--ink-900); font-size: 15px; line-height: 1.5;
}
.ngss-v2-source { color: var(--ink-300); font-family: var(--font-mono); font-size: 10px; line-height: 1.45; }
.ngss-source-link { color: var(--iris-500); text-decoration: underline; text-underline-offset: 3px; }
.ngss-source-date { color: var(--ink-300); }
.ngss-v2-authored { margin: 13px 0 0; color: var(--ink-700); font-size: 14px; line-height: 1.5; }
.ngss-v2-authored strong, .ngss-v2-detail strong { color: var(--iris-500); }
.ngss-v2-detail { margin: 10px 0 0; color: var(--ink-500); font-size: 13px; line-height: 1.5; }
.ngss-evidence { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.ngss-evidence-label { width: 100%; color: var(--ink-300); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.ngss-evidence .ngss-spot { padding: 6px 11px; font-size: 12px; }
.ngss-empty { margin: 10px 0; padding: 14px 15px; border: 1px dashed rgb(13 13 17 / 0.22); border-radius: 10px; color: var(--ink-500); font-size: 13px; font-style: italic; line-height: 1.45; }
.ngss-v2-connections h4 { margin: 20px 0 9px; color: var(--ink-900); font-size: 1rem; }
.ngss-v2-connections .ngss-v2-item { margin-top: 8px; }
.ngss-source-list { display: grid; gap: 8px; }
.ngss-source-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgb(13 13 17 / 0.08); font-family: var(--font-mono); font-size: 10px; }
.ngss-kid-panel { padding-top: 4px; }
.ngss-kid-lede { max-width: 30ch; margin: 0 0 24px; color: var(--ink-900); font-family: var(--font-display, Georgia, serif); font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.05; letter-spacing: -0.03em; }
.ngss-kid-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ngss-kid-card { min-height: 140px; padding: 17px; border-radius: 14px; background: #F3EDDB; }
.ngss-kid-card h4 { margin: 0 0 10px; color: var(--amber-500); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.ngss-kid-card p, .ngss-kid-card li { color: var(--ink-700); font-size: 14px; line-height: 1.45; }
.ngss-kid-card p { margin: 0; }
.ngss-kid-card ul { margin: 0; padding-left: 17px; }

/* ---------- responsive / motion / print ---------- */
@media (max-width: 640px) {
  .ngss-open { width: 100%; justify-content: space-between; }
  .ngss-card { padding: 24px 20px; }
  .ngss-view-bar { align-items: flex-start; flex-direction: column; }
  .ngss-view-toggle { align-self: flex-start; }
  .ngss-kid-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ngss-overlay, .ngss-card, .ngss-code { transition: none; animation: none !important; }
  .ngss-overlay.show .ngss-card { animation: none !important; transform: none; opacity: 1; }
  .ngss-code, .ngss-code.stamped { opacity: 1; transform: rotate(-4deg); }
  .ngss-code:nth-child(2), .ngss-code:nth-child(2).stamped { transform: rotate(3deg); }
}
@media print {
  .ngss-open, .ngss-overlay { display: none !important; }
}
