/* The discovery page shares the hub's palette and follows the OS color scheme. */
:root {
  color-scheme: light;
  --page-bg: #f5f5f7;
  --surface-bg: #fff;
  --muted-bg: #f3f4f6;
  --text: #222;
  --heading: #111827;
  --text-secondary: #4b5563;
  --border: #e5e7eb;
  --field-border: #8a8a8a;
  --focus: #2563eb;
  --link: #1d4ed8;
  --primary-bg: #2563eb;
  --primary-hover-bg: #1d4ed8;
  --primary-text: #fff;
  --selected-bg: #222;
  --selected-text: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page-bg: #111827;
    --surface-bg: #1f2937;
    --muted-bg: #273244;
    --text: #e5e7eb;
    --heading: #f3f4f6;
    --text-secondary: #cbd5e1;
    --border: #4b5563;
    --field-border: #9ca3af;
    --focus: #bfdbfe;
    --link: #93c5fd;
    --selected-bg: #e5e7eb;
    --selected-text: #111827;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--page-bg); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; }
html { scroll-padding-top: 1rem; }
html:not([lang="en"]) .label-en, html[lang="en"] .label-ja { display: none; }
[hidden] { display: none; }
button, textarea { font: inherit; }
a { color: var(--link); text-underline-offset: 0.18em; }
:focus-visible, summary:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, p, figure { margin: 0; }
h1, h2 { color: var(--heading); line-height: 1.35; }
h1 { font-size: clamp(1.8rem, 4vw + 0.6rem, 3rem); }
h2 { font-size: clamp(1.35rem, 2vw + 0.7rem, 1.8rem); }
button { color: var(--text); background: var(--surface-bg); border: 1px solid var(--field-border); border-radius: 0.45rem; cursor: pointer; min-width: 44px; min-height: 44px; padding: 0.5rem 0.75rem; }
button[aria-pressed="true"] { color: var(--selected-text); background: var(--selected-bg); border-color: var(--selected-bg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: 0.5rem; left: 0.5rem; transform: translateY(-200%); padding: 0.6rem; background: var(--surface-bg); z-index: 5; }
.skip-link:focus { transform: none; }
.discover-header { max-width: 72rem; margin: 0 auto; padding: 1rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.discover-brand { display: inline-flex; align-items: center; min-height: 44px; gap: 0.7rem; min-width: 0; color: var(--heading); text-decoration: none; font-weight: 700; overflow-wrap: anywhere; }
.discover-brand img { flex: 0 0 32px; }
.language-controls { display: flex; gap: 0.35rem; }
.language-controls[hidden] { display: none; }
.discover-main { max-width: 62rem; padding: 1rem; margin: 0 auto; display: grid; gap: 2rem; }
.discover-main > *, .experiment > *, .experiment-body > *, .share-content > * { min-width: 0; }
.discover-intro { display: grid; justify-items: start; gap: 1.1rem; padding: 1rem 0 0.75rem; }
.eyebrow, .experiment-number { color: var(--text-secondary); font-size: 0.875rem; font-weight: 650; }
.intro-copy { max-width: 42rem; }
.intro-note, figcaption, .materials-credit { color: var(--text-secondary); font-size: 0.875rem; }
.primary-link { display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; min-height: 44px; padding: 0.65rem 1rem; color: var(--primary-text); background: var(--primary-bg); border: 1px solid var(--primary-bg); border-radius: 0.5rem; text-decoration: none; font-weight: 650; overflow-wrap: anywhere; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0.5rem 0.25rem; }
.experiment { display: grid; gap: 1.3rem; padding: 1.25rem; background: var(--surface-bg); border: 1px solid var(--border); border-radius: 0.85rem; }
.experiment-heading { display: grid; gap: 0.5rem; }
.experiment-number span { font-weight: 400; }
.tool-name { color: var(--text-secondary); overflow-wrap: anywhere; }
.experiment-media { display: grid; align-content: start; gap: 0.5rem; }
.experiment-media img, .experiment-media video { display: block; width: 100%; height: auto; background: var(--muted-bg); border: 1px solid var(--border); border-radius: 0.5rem; }
.experiment-media video { aspect-ratio: 6 / 5; object-fit: contain; }
.experiment-body { display: grid; align-content: start; gap: 1rem; }
.experiment-steps { margin: 0; padding-left: 1.5em; display: grid; gap: 0.65rem; }
.experiment-steps li { padding-left: 0.25em; overflow-wrap: anywhere; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.95em; background: var(--muted-bg); border-radius: 0.2rem; padding: 0.1rem 0.25rem; }
.experiment-explanation { color: var(--text-secondary); }
.experiment-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; }
.experiment-check { border-top: 1px solid var(--border); padding-top: 0.5rem; }
.experiment-check summary { min-height: 44px; padding: 0.6rem 0.25rem; cursor: pointer; color: var(--heading); border-radius: 0.2rem; overflow-wrap: anywhere; }
.experiment-check p { padding: 0.5rem 0.25rem; }
.experiment-followup { display: grid; justify-items: start; gap: 0.25rem; }
.experiment-followup p { color: var(--text-secondary); }
.discover-next { display: grid; gap: 1rem; padding: 0.5rem 0; }
.share-materials { border-top: 1px solid var(--border); padding-top: 0.75rem; }
.share-materials summary { min-height: 44px; padding: 0.65rem 0.25rem; cursor: pointer; color: var(--heading); font-weight: 650; border-radius: 0.2rem; }
.share-content { display: grid; gap: 0.9rem; padding-top: 0.75rem; }
.share-content label { font-weight: 650; }
.share-content textarea { display: block; resize: vertical; width: 100%; max-width: 100%; min-height: 9rem; padding: 0.75rem; color: var(--text); background: var(--surface-bg); border: 1px solid var(--field-border); border-radius: 0.45rem; line-height: 1.6; }
.copy-button { justify-self: start; }
.copy-status:empty { display: none; }
.download-links { display: grid; gap: 0.2rem; list-style: none; margin: 0; padding: 0; }
.download-links a { display: inline-flex; min-height: 44px; align-items: center; padding: 0.5rem 0; overflow-wrap: anywhere; }
.discover-footer { max-width: 62rem; margin: 0 auto; padding: 1rem 1rem 2rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 1.5rem; color: var(--text-secondary); font-size: 0.875rem; }
.discover-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.noscript-note { padding: 1rem; border: 1px solid var(--field-border); border-radius: 0.5rem; }
@media (min-width: 48rem) {
  .discover-main { gap: 2.5rem; padding: 1.5rem; }
  .discover-intro { padding: 1.5rem 0 1rem; }
  .experiment { padding: 1.75rem; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .experiment-heading { grid-column: 1 / -1; }
  .experiment-links { align-items: flex-start; }
}
@media (hover: hover) {
  .primary-link:hover { background: var(--primary-hover-bg); border-color: var(--primary-hover-bg); }
  button:not([aria-pressed="true"]):hover { background: var(--muted-bg); }
  .text-link:hover, .download-links a:hover, .discover-footer a:hover { text-decoration-thickness: 2px; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media (forced-colors: active) {
  .primary-link, button[aria-pressed="true"] { color: HighlightText; background: Highlight; border-color: Highlight; }
  :focus-visible, summary:focus { outline-color: Highlight; }
}
