/* DavidHuangLab — UI v0.1 working defaults.
 * Drop-in replacement for assets/css/style.css; existing HTML hooks retained.
 * Font files/HTML links are supplied by the site, not by this stylesheet.
 */
:root {
  --brand: #1B2BFF;
  --ink: #0E1821;
  --white: #FFFFFF;
  --gray: #8293A1;
  --gray-1: #F2F2F2;
  --gray-2: #F5F5F5;
  --action: #3F5FC4;
  --action-hover: #3653B0;
  --action-active: #2E4799;
  --action-ui: #5B7EE0;
  --accent: #4A6BD0;
  --action-dark: var(--action);
  --muted: #5C6D7B;
  --error: #C62828;
  --success: #1E7A46;
  --warn: #8B5A00;
  --font: "Poppins", "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-en: "Poppins", "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 48px;
  --s7: 64px;
  --s8: 96px;
  --s9: 128px;
  --content: 1120px;
  --read: 720px;
  --r-input: 8px;
  --r-card: 12px;
  --r-btn: 999px; /* Clamps to half the button height for a capsule. */

  /* Compatibility aliases: --brand now means CI blue, not the CTA fill. */
  --bg: var(--white);
  --header: var(--brand);
  --brand-d: var(--action-dark);
  --teal: var(--action-dark);
  --sun: var(--action);
  --navy: var(--ink);
  --navy2: #1C3142;
  --on-dark: #C5D0D9;
  --blog: var(--gray-2);
  --tint: #EEF2FC;
  --card: var(--white);
  --line: var(--gray-1);
  --radius: var(--r-card);
  --shadow: none;
  --line-green: #06c755;
  --line-hover: #05a648;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 28px;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
svg { max-width: 100%; }
a {
  color: var(--action-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .15s, border-color .15s;
}
a:hover { color: var(--accent); text-decoration-thickness: 2px; }
a:active { color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Widths include no internal padding: existing .wrap/.narrow can be combined. */
.wrap { width: calc(100% - 64px); max-width: var(--content); margin-inline: auto; }
.narrow { width: calc(100% - 64px); max-width: var(--read); margin-inline: auto; }
.read { max-width: var(--read); }
.center { text-align: center; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }
h1, h2, h3, h4 { margin: 0 0 var(--s3); letter-spacing: 0; overflow-wrap: anywhere; }
h1, .h1 { font-size: 48px; line-height: 60px; font-weight: 700; }
h2, .h2 { font-size: 32px; line-height: 44px; font-weight: 700; }
h3, .h3 { font-size: 22px; line-height: 32px; font-weight: 600; }
h4, .h4 { font-size: 18px; line-height: 28px; font-weight: 600; }
.lead { font-size: 18px; line-height: 32px; }
.caption { font-size: 14px; line-height: 22px; color: var(--muted); }
.en { font-family: var(--font-en); }
.eyebrow {
  margin: 0 0 var(--s2);
  font-family: var(--font-en);
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow.light { color: var(--on-dark); }
.sec-title { text-align: center; font-size: 32px; line-height: 44px; font-weight: 700; margin: var(--s7) 0 var(--s5); }
.sec-title:after, .prose h2:after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  background: var(--brand);
  margin: var(--s3) auto 0;
}
.prose h2:after { margin-left: 0; }

/* Buttons: shared capsule radius; primary 48px, small 40px minimum height. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 48px;
  max-width: 100%;
  padding: 10px var(--s4);
  border: 2px solid var(--action);
  border-radius: var(--r-btn);
  background: var(--action);
  color: var(--white);
  font-family: inherit;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:hover { background: var(--action-hover); border-color: var(--action-hover); color: var(--white); }
.btn:active { background: var(--action-active); border-color: var(--action-active); color: var(--white); transform: translateY(1px); }
.btn-ghost, .btn-pill {
  background: var(--white);
  color: var(--action-dark);
  border-color: var(--action);
  border-radius: var(--r-btn);
  box-shadow: none;
}
.btn-ghost { border-color: var(--action); }
.btn-ghost:hover, .btn-pill:hover { background: var(--tint); border-color: var(--action-hover); color: var(--action-dark); box-shadow: none; }
.btn-light { background: var(--white); color: var(--action-dark); border-color: var(--white); border-radius: var(--r-btn); box-shadow: none; }
.btn-light:hover { background: var(--gray-2); border-color: var(--gray-2); color: var(--action-dark); box-shadow: none; }
.btn-ghost:active, .btn-pill:active, .btn-light:active { background: var(--gray-1); color: var(--action-dark); }
.btn-sm { min-height: 40px; padding: 6px var(--s3); font-size: 16px; }
.btn-big { min-height: 56px; padding: 14px var(--s5); font-size: 18px; }
.btn-line { background: var(--line-green); border-color: var(--line-green); border-radius: var(--r-btn); }
.btn-line:hover, .btn-line:active { background: var(--line-hover); border-color: var(--line-hover); color: var(--white); }
.btn svg { flex: none; width: 20px; height: 20px; }
.btn:disabled, .btn[aria-disabled="true"], .mailform button[disabled] {
  background: var(--gray-1);
  border-color: var(--gray-1);
  color: var(--gray);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
  opacity: 1;
}

/* Header: .hdr-bar may wrap the entire header row; use a top border as strip. */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: none; }
.hdr-bar { background: var(--white); border-top: 8px solid var(--brand); }
.hdr { display: flex; align-items: center; gap: var(--s3); min-height: 72px; padding-block: var(--s2); }
.brand { display: flex; align-items: center; min-width: 0; text-decoration: none; margin-right: auto; }
.brand-logo { height: 48px; width: auto; max-width: 100%; object-fit: contain; }
.hdr-cta { flex-shrink: 0; min-height: 40px; padding: 6px var(--s3); font-size: 16px; border-radius: var(--r-btn); }
.site-nav { background: var(--white); }
.nav-in { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 var(--s2); padding: var(--s2) 0; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: var(--s2) var(--s3);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--gray); }
.site-nav a.on, .site-nav a[aria-current="page"], .site-nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.nav-toggle {
  position: relative;
  display: none;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  background: none;
  border: 0;
  border-radius: var(--r-btn);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }

/* Image overlays are functional contrast layers, the only gradients retained. */
.hero { position: relative; min-height: min(78vh, 680px); display: grid; align-items: center; color: var(--white); overflow: hidden; background: var(--ink); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero:after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(14,24,33,.85) 20%, rgba(14,24,33,.25)); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; padding: var(--s8) 0; }
.hero h1 { max-width: var(--read); }
.hero h1 em { font-style: normal; color: #DCE3FA; }
.hero-ctas { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.page-hero {
  position: relative;
  color: var(--white);
  padding: var(--s8) 0;
  background: linear-gradient(110deg, rgba(14,24,33,.88), rgba(14,24,33,.35)), var(--bg-img, var(--bg)) center/cover;
  background-color: var(--ink);
}
/* Retain the old --bg image hook on pages that supply an inline style. */
.page-hero[style] { background: linear-gradient(110deg, rgba(14,24,33,.88), rgba(14,24,33,.3)), var(--bg-img, var(--bg)) center/cover; background-color: var(--ink); }
.page-hero h1 { font-size: 48px; line-height: 60px; }
.page-hero p { max-width: var(--read); color: var(--on-dark); }
.page-hero.small { padding: var(--s7) 0; background: var(--ink); color: var(--white); }
.page-hero.small .eyebrow { color: #DCE3FA; }
.page-hero.small .btn-light { background: var(--white); color: var(--action-dark); border-color: var(--white); }
.hero .eyebrow, .page-hero .eyebrow { color: var(--on-dark); }

/* Home and shared panels. */
.highlight { margin-top: -48px; position: relative; z-index: 2; }
.hl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: none; padding: var(--s5) clamp(24px, 4vw, 48px); }
.hl-tag { display: inline-block; background: var(--gray-1); color: var(--ink); border-radius: var(--r-card); padding: 0 var(--s2); font-size: 13px; line-height: 24px; font-weight: 600; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.feat { background: var(--card); border-radius: var(--r-card); padding: var(--s4); text-decoration: none; color: var(--ink); box-shadow: none; transition: border-color .15s, transform .15s; border: 1px solid var(--line); min-width: 0; }
.feat:hover { transform: translateY(-2px); border-color: var(--gray); color: var(--ink); }
.feat .ico { font-size: 32px; line-height: 48px; }
.feat p { color: var(--muted); margin: 0; }
.about { margin-top: var(--s7); }
.about-head { display: flex; gap: var(--s5); align-items: center; flex-wrap: wrap; background: var(--gray-1); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5); }
.about-head .round { width: 152px; height: 152px; border-radius: 50%; object-fit: cover; border: 4px solid var(--white); }
.about-head h2 small { font-size: 14px; line-height: 22px; color: var(--muted); letter-spacing: .08em; margin-left: var(--s2); }
.accordion { margin-top: var(--s4); columns: 2; column-gap: var(--s4); }
.accordion details, .faq details { break-inside: avoid; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: var(--s3); padding: 0 var(--s4); }
.accordion summary, .faq summary { cursor: pointer; font-weight: 600; padding: var(--s3) var(--s5) var(--s3) 0; list-style: none; position: relative; }
.accordion summary::-webkit-details-marker, .faq summary::-webkit-details-marker { display: none; }
.accordion summary:after, .faq summary:after { content: "+"; position: absolute; right: 0; top: var(--s3); font-size: 22px; color: var(--action-dark); }
details[open]>summary:after { content: "\2013"; }
.accordion ul { padding-left: var(--s4); margin: 0 0 var(--s3); font-size: 16px; }
.accordion a { text-decoration: none; }

/* Social links retain circular icon hit areas, not pill CTA styling. */
.social { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: var(--white); transition: background-color .15s, color .15s; }
.social a:hover { background: var(--action-dark); color: var(--white); }
.social svg { width: 20px; height: 20px; }
.social.dark a { background: var(--white); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.social.dark a:hover { background: var(--action-dark); color: var(--white); border-color: var(--action-dark); }

/* Sessions / signup. */
.sessions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-top: -48px; position: relative; z-index: 2; }
.session { min-width: 0; background: var(--white); border-radius: var(--r-card); padding: var(--s4); box-shadow: none; border: 1px solid var(--line); }
.session ul { list-style: none; padding: 0; margin: var(--s3) 0; font-size: 16px; }
.session p { color: var(--muted); font-size: 16px; }
.session a { font-weight: 700; text-decoration: none; }
.pill { display: inline-block; border-radius: var(--r-card); padding: 0 var(--s2); font-size: 13px; line-height: 24px; font-weight: 600; color: var(--ink); }
.pill.a { background: var(--gray-1); }
.pill.b { background: var(--tint); color: var(--action-dark); }
.detail { margin-top: var(--s7); }
.cal { border-radius: var(--r-card); margin: var(--s3) 0 var(--s4); background: var(--white); }
.facts { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s2) var(--s3); background: var(--white); padding: var(--s4); border-radius: var(--r-card); border: 1px solid var(--line); }
.facts dt { font-weight: 600; color: var(--action-dark); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.teacher { display: grid; grid-template-columns: minmax(224px, 336px) minmax(0, 1fr); gap: var(--s5); align-items: center; margin-top: var(--s8); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5); box-shadow: none; }
.teacher img { border-radius: var(--r-card); aspect-ratio: 3/4; object-fit: cover; width: 100%; }
.awards { columns: 2; padding-left: var(--s4); font-size: 16px; color: var(--muted); }
.signup { margin-top: var(--s7); margin-inline: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: clamp(24px, 4vw, 48px); box-shadow: none; width: calc(100% - 64px); max-width: var(--content); }
.placeholder { background: var(--tint); border: 1px dashed var(--gray); border-radius: var(--r-card); padding: var(--s4); margin: var(--s3) 0; }
.form-spec { margin-top: var(--s4); }
.form-spec ol>li { margin-bottom: var(--s2); }
.form-spec ul { color: var(--muted); font-size: 16px; }
.note { font-size: 14px; line-height: 22px; color: var(--muted); background: var(--bg); padding: var(--s3); border-radius: var(--r-input); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s5); }
.box { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); font-size: 16px; }
.box h3 { font-size: 22px; line-height: 32px; color: var(--ink); }
.box ul { padding-left: var(--s4); }
.box.accent { background: var(--tint); }

/* Course layouts: retain existing order, ratios and HTML semantics. */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); align-items: center; margin-top: var(--s7); }
.split>img { border-radius: var(--r-card); box-shadow: none; }
.split.rev>img { order: 2; }
.nums .num { display: flex; gap: var(--s3); align-items: center; margin: var(--s3) 0; }
.nums b { flex: 0 0 40px; height: 40px; border-radius: var(--r-input); background: var(--gray-1); color: var(--action-dark); display: grid; place-items: center; }
.nums p { margin: 0; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.duo img { border-radius: var(--r-card); aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.ticks { padding-left: 0; list-style: none; }
.ticks li { padding-left: var(--s5); position: relative; margin: var(--s2) 0; }
.ticks li:before { content: "\2714"; position: absolute; left: 0; color: var(--success); }
.units { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.unit { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); box-shadow: none; }
.unit small { color: var(--action-dark); font-size: 14px; line-height: 22px; font-weight: 600; }
.unit p { color: var(--muted); font-size: 16px; }
.choose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.opt { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; box-shadow: none; padding-bottom: var(--s4); }
.opt img { width: 100%; aspect-ratio: 2.2/1; object-fit: cover; }
.opt h3, .opt p, .opt .btn { margin-left: var(--s4); margin-right: var(--s4); }
.opt h3 { margin-top: var(--s4); }
.opt .btn { max-width: calc(100% - 48px); }
.opt p { color: var(--muted); }
.video { position: relative; aspect-ratio: 16/9; border-radius: var(--r-card); overflow: hidden; margin: var(--s5) 0; box-shadow: none; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Gallery. No image scaling: movement is capped at 2px. */
.masonry { columns: 4; column-gap: var(--s3); }
.masonry a { display: block; margin-bottom: var(--s3); break-inside: avoid; border-radius: var(--r-card); }
.masonry img { border-radius: var(--r-card); width: 100%; transition: transform .15s; }
.masonry img:hover { transform: translateY(-2px); }
.notice { background: var(--tint); border-left: 2px solid var(--brand); padding: var(--s3) var(--s4); border-radius: 0 var(--r-input) var(--r-input) 0; margin: var(--s5) 0; }

/* Contact: platform colors are deliberate exceptions to the CI palette. */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: var(--s4); margin-top: var(--s6); }
.cc { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); text-decoration: none; color: var(--ink); box-shadow: none; transition: border-color .15s, transform .15s; }
.cc:hover { transform: translateY(-2px); border-color: var(--c, var(--gray)); color: var(--ink); }
.cc svg { width: 36px; height: 36px; color: var(--c, var(--action-dark)); }
.cc p { color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.cc.fb { --c: #1877f2; }
.cc.line { --c: var(--line-green); }
.cc.mail { --c: var(--action-dark); }
.cc.ig { --c: #d62976; }
.cc.yt { --c: #ff0000; }
.cc .qr { width: 120px; margin-top: var(--s3); }
.mailform { display: grid; gap: var(--s3); background: var(--white); padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: none; min-width: 0; }
.mailform label { display: grid; gap: var(--s2); font-size: 15px; line-height: 22px; font-weight: 600; }
.mailform input, .mailform textarea, .mailform select {
  min-width: 0;
  width: 100%;
  height: 48px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--ink);
  padding: 0 var(--s3);
  border-radius: var(--r-input);
  border: 1px solid var(--gray);
  background: var(--white);
  transition: border-color .15s;
}
.mailform textarea { height: auto; min-height: 120px; padding-block: 12px; resize: vertical; }
.mailform input::placeholder, .mailform textarea::placeholder { color: var(--gray); opacity: 1; }
.mailform input:hover, .mailform textarea:hover, .mailform select:hover { border-color: var(--ink); }
.mailform input:focus, .mailform textarea:focus, .mailform select:focus { outline: 2px solid var(--brand); outline-offset: 2px; border-color: var(--action-ui); }
.mailform input[aria-invalid="true"], .mailform textarea[aria-invalid="true"], .mailform select[aria-invalid="true"] { border-color: var(--error); }
.mailform fieldset { min-width: 0; border: 1px solid var(--gray); border-radius: var(--r-input); padding: var(--s3) var(--s4); margin: 0; display: grid; gap: var(--s2); }
.mailform legend { font-weight: 600; padding: 0 var(--s2); }
.check-list label, .radio-list label { display: flex; align-items: flex-start; gap: var(--s2); min-height: 40px; font-size: 16px; font-weight: 400; cursor: pointer; line-height: 28px; }
.check-list input, .radio-list input, .mailform input[type="checkbox"], .mailform input[type="radio"] { width: 20px; height: 20px; min-height: 0; margin: 4px 0 0; flex: none; accent-color: var(--action-ui); padding: 0; }
.mailform .note, .mailform .help { color: var(--muted); font-size: 14px; line-height: 22px; font-weight: 400; margin: 0; }
.form-err { color: var(--error); font-size: 14px; line-height: 22px; font-weight: 600; margin: 0; }
.form-thanks { background: var(--white); border: 1px solid var(--line); border-left: 2px solid var(--success); padding: var(--s4); border-radius: var(--r-input); margin: var(--s4) 0; }
.form-thanks h3 { margin: 0 0 var(--s2); }
.form-thanks p { margin: 0; }
.banner-link { display: block; margin: var(--s6) auto 0; max-width: var(--read); text-align: center; text-decoration: none; font-weight: 600; }
.banner-link img { border-radius: var(--r-card); box-shadow: none; margin-bottom: var(--s2); }

/* Blog / reading. Keep .foot's existing footer meaning; no demo .card .foot. */
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: center; margin: var(--s5) 0 var(--s4); }
.chip { min-height: 40px; border: 1px solid var(--gray); background: var(--white); color: var(--ink); border-radius: var(--r-btn); padding: 4px var(--s3); font: inherit; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.chip.on, .chip:hover { background: var(--tint); color: var(--action-dark); border-color: var(--action-dark); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.card { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: none; transition: border-color .15s, transform .15s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-2px); border-color: var(--gray); color: var(--ink); }
.card-img { aspect-ratio: 4/3; overflow: hidden; background: var(--gray-1); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: var(--s4); }
.card-body small { color: var(--action-dark); font-size: 14px; line-height: 22px; font-weight: 600; }
.card-body h3 { font-size: 22px; line-height: 32px; margin: var(--s2) 0; }
.card-body p { color: var(--muted); font-size: 16px; line-height: 28px; margin: 0; }
.post { padding-top: var(--s5); }
.post h1 { font-size: 48px; line-height: 60px; }
.back { text-decoration: none; font-weight: 600; }
.meta { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; color: var(--muted); font-size: 14px; line-height: 22px; margin-bottom: var(--s5); }
.avatar { width: 32px; height: 32px; border-radius: 50%; }
.tag { display: inline-block; background: var(--tint); color: var(--action-dark); padding: 0 var(--s2); border-radius: var(--r-card); font-size: 13px; line-height: 24px; font-weight: 600; }
.prose { max-width: var(--read); margin-inline: auto; overflow-wrap: anywhere; }
.prose img { border-radius: var(--r-card); margin: var(--s4) auto; }
.prose h2 { margin-top: var(--s6); font-size: 32px; line-height: 44px; }
.prose h3 { margin-top: var(--s5); }
.prose h5, .prose h6 { font-size: 16px; line-height: 28px; font-weight: 600; margin: var(--s3) 0; }
.prose a { word-break: break-word; }
.prose pre { background: var(--ink); color: var(--white); padding: var(--s3); border-radius: var(--r-card); overflow: auto; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--gray); padding: var(--s2) var(--s3); }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; background: var(--ink); color: var(--white); border-radius: var(--r-card); padding: var(--s5); margin: var(--s7) 0; }
.cta-band h3 { margin: 0; color: var(--white); }
.cta-band p { margin: var(--s2) 0 0; color: var(--on-dark); }

/* Tools and products. */
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s6); }
.tool { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); text-decoration: none; color: var(--ink); box-shadow: none; transition: border-color .15s, transform .15s; }
.tool:hover { transform: translateY(-2px); border-color: var(--gray); color: var(--ink); }
.tool p { color: var(--muted); font-size: 16px; }
.tool span { color: var(--action-dark); font-weight: 600; }
.tool-frame { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: none; overflow: hidden; margin-top: var(--s5); }
.tool-frame iframe { width: 100%; border: 0; display: block; max-height: 85vh; }
.prods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.prod { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s3); box-shadow: none; text-align: center; }
.prod img { border-radius: var(--r-input); aspect-ratio: 1; object-fit: cover; width: 100%; }
.prod h3 { font-size: 18px; line-height: 28px; margin: var(--s3) 0 var(--s2); }
.prod b { color: var(--action-dark); }

/* Footer / persistent LINE contact. */
.site-footer { background: var(--ink); color: var(--on-dark); margin-top: var(--s8); padding: var(--s7) 0 var(--s4); }
.foot { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: var(--s5); }
.foot>div { min-width: 0; }
.foot h4 { color: var(--white); margin: 0 0 var(--s2); }
.foot a { display: block; color: var(--on-dark); text-decoration: none; margin: var(--s2) 0; font-size: 14px; line-height: 22px; overflow-wrap: anywhere; }
.foot a:hover { color: var(--white); text-decoration: underline; }
.foot .social a { display: grid; margin: 0; }
.foot a.foot-brand { display: inline-block; background: var(--white); border-radius: var(--r-card); padding: var(--s2) var(--s3); margin: 0 0 var(--s3); }
.foot-brand img { height: 64px; width: auto; }
.foot p { font-size: 14px; line-height: 22px; }
.copy { border-top: 1px solid #2A4256; margin-top: var(--s5); padding-top: var(--s3); font-size: 14px; line-height: 22px; color: var(--on-dark); }
.float-line { position: fixed; right: var(--s3); bottom: var(--s3); z-index: 60; min-height: 48px; background: var(--line-green); color: var(--white); border-radius: var(--r-btn); display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); text-decoration: none; font-size: 18px; line-height: 24px; font-weight: 700; box-shadow: none; }
.float-line svg { width: 24px; height: 24px; }
.float-line:hover { color: var(--white); background: var(--line-hover); }

/* Existing page modes. Light cards keep dark text inside the dark page. */
.mode-light { background: var(--white); }
.mode-blog { background: var(--blog); }
.mode-blog .card { border: 1px solid var(--line); box-shadow: none; }
.mode-blog .card:hover { border-color: var(--gray); box-shadow: none; }
.mode-blog .post { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5) clamp(24px, 4vw, 48px); margin-top: var(--s5); }
.mode-dark { background: var(--navy2); color: var(--on-dark); }
.mode-dark main h1, .mode-dark main h2, .mode-dark main h3 { color: var(--white); }
.mode-dark .page-hero.small { background: var(--navy); }
.mode-dark .notice { background: var(--navy); border-left-color: var(--brand); color: var(--on-dark); }
.mode-dark .masonry img { box-shadow: none; }
.mode-dark .site-footer { margin-top: var(--s7); border-top: 1px solid #2A4256; }
.mode-dark main :is(.hl-card, .feat, .about-head, .accordion details, .faq details, .session, .facts, .teacher, .signup, .box, .unit, .opt, .cc, .mailform, .form-thanks, .card, .tool, .prod) { color: var(--ink); }
.mode-dark main :is(.hl-card, .feat, .about-head, .accordion details, .faq details, .session, .facts, .teacher, .signup, .box, .unit, .opt, .cc, .mailform, .form-thanks, .card, .tool, .prod) :is(h1, h2, h3),
.mode-dark.mode-blog main .post :is(h1, h2, h3) { color: var(--ink); }
.mode-dark main .prose { color: var(--on-dark); }
.mode-dark main .mode-blog .prose { color: var(--ink); }
.mode-dark main a:not(.btn):not(.feat):not(.cc):not(.card):not(.tool):not(.float-line) { color: #DCE3FA; }
.mode-dark main :is(.hl-card, .feat, .about-head, .accordion details, .faq details, .session, .facts, .teacher, .signup, .box, .unit, .opt, .cc, .mailform, .form-thanks, .card, .tool, .prod) a:not(.btn) { color: var(--action-dark); }

/* GIF/MP4 and vertical videos retain their existing sizing behavior. */
video.gif-video { display: block; max-width: 100%; height: auto; border-radius: var(--r-card); margin: var(--s4) auto; background: #000; }
picture { display: contents; }
.video-pair { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: center; }
.video.vertical { aspect-ratio: 9/16; width: min(100%, 340px); margin: var(--s3) 0; }
.split>.video { margin: 0; }

/* Tablet <=1024, mobile <=768: no legacy 820/720/560/400 breakpoints. */
@media (max-width: 1024px) {
  .features, .sessions, .units, .cards, .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prods { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .masonry { columns: 3; }
  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot>div:first-child { grid-column: 1/-1; }
}
@media (max-width: 768px) {
  .wrap, .narrow, .signup { width: calc(100% - 32px); }
  h1, .h1, .hero h1, .page-hero h1, .post h1 { font-size: 32px; line-height: 44px; }
  h2, .h2, .sec-title, .prose h2 { font-size: 24px; line-height: 34px; }
  .hdr { min-height: 64px; gap: var(--s2); flex-wrap: wrap; }
  .brand { flex: 1 1 96px; }
  .brand-logo { height: 40px; }
  .hdr-cta { padding-inline: var(--s2); }
  .nav-toggle { display: flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; border-bottom: 1px solid var(--gray); box-shadow: none; max-height: 70vh; overflow-y: auto; }
  .nav-open .site-nav { display: block; }
  .nav-in { flex-direction: column; align-items: stretch; padding: var(--s2) var(--s3) var(--s3); }
  .site-nav a { padding: var(--s3); font-size: 16px; border-bottom: 2px solid transparent; }
  .site-nav a.on, .site-nav a[aria-current="page"], .site-nav a[aria-current="true"] { border-bottom-color: var(--brand); background: var(--gray-2); }
  /* Reposition strokes for the structural X; no translation exceeds 2px. */
  .nav-open .nav-toggle span:nth-child(1) { position: absolute; top: 23px; left: 12px; transform: rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { position: absolute; top: 23px; left: 12px; transform: rotate(-45deg); }
  .hero-inner, .page-hero, .page-hero.small { padding-block: var(--s7); }
  .features, .sessions, .units, .cards, .tools, .grid2, .choose, .split, .teacher { grid-template-columns: minmax(0, 1fr); }
  .teacher, .signup, .mailform, .about-head, .mode-blog .post { padding: var(--s4); }
  .teacher img { max-width: 280px; }
  .split.rev>img { order: 0; }
  .accordion, .awards { columns: 1; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { margin-top: var(--s2); }
  .prods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .masonry { columns: 2; }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .cta-band { align-items: flex-start; padding: var(--s4); }
  .float-line span { display: none; }
  .float-line { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; transform: none !important; scroll-behavior: auto !important; }
  /* Preserve a usable open/close state with text strokes when motion is off. */
  .nav-open .nav-toggle span:nth-child(1), .nav-open .nav-toggle span:nth-child(3) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 1; position: relative; height: 24px; background: none; }
  .nav-open .nav-toggle span:nth-child(2)::after { content: "\00D7"; position: absolute; inset: 0; color: var(--ink); font-size: 28px; line-height: 24px; text-align: center; }
}
