/* ==========================================================
   MahjPhD.com — shared stylesheet
   Palette & type per MahjPhD Brand Guidelines v1.1
   ========================================================== */

:root {
  --emerald: #176B5B;
  --emerald-dark: #0F5043;
  --navy: #172A46;
  --navy-soft: #4A5870;
  --ivory: #F7F3E8;
  --ivory-deep: #EFE8D6;
  --paper: #FFFDF8;
  --gold: #C7A65A;
  --line: rgba(23, 42, 70, 0.14);

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --max: 1120px;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--emerald); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--emerald-dark); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.005em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-size: clamp(2rem, 4vw, 2.9rem); }
h3 { font-size: 1.6rem; font-weight: 600; }

p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--emerald);
  margin: 0 0 1rem;
}
.eyebrow.gold { color: var(--gold); }

.lede { font-size: 1.2rem; color: var(--navy-soft); max-width: 40em; }

.rule {
  width: 56px; height: 2px; background: var(--gold);
  border: 0; margin: 0 0 1.5rem;
}
.center { text-align: center; }
.center .rule, .center .lede { margin-left: auto; margin-right: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 232, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.wordmark {
  text-decoration: none; display: inline-flex; align-items: baseline;
  font-size: 1.9rem; line-height: 1;
}
.wordmark .mahj { font-family: var(--serif); font-weight: 700; color: var(--emerald); }
.wordmark .phd  { font-family: var(--sans); font-weight: 800; color: var(--navy); font-size: 0.86em; margin-left: 1px; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  color: var(--navy); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--emerald); }
.nav a[aria-current="page"] { border-bottom-color: var(--gold); }
.nav .btn { padding: 9px 18px; border-bottom: 0; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: 8px;
  width: 44px; height: 40px; cursor: pointer; color: var(--navy);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 18px; height: 2px; background: currentColor; margin: 0 auto;
  position: relative; content: "";
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after  { position: absolute; top: 6px; }

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ivory); border-bottom: 1px solid var(--line); padding: 8px 24px 20px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { border-bottom-color: var(--line); color: var(--emerald); font-weight: 700; }
  .nav .btn { margin-top: 14px; text-align: center; padding: 13px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 0.98rem;
  padding: 14px 26px; border-radius: 999px; text-decoration: none;
  background: var(--emerald); color: #fff !important; border: 1.5px solid var(--emerald);
  transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--emerald-dark); border-color: var(--emerald-dark); }
.btn.ghost { background: transparent; color: var(--navy) !important; border-color: var(--navy); }
.btn.ghost:hover { background: var(--navy); color: var(--ivory) !important; }
.btn.light { background: var(--ivory); color: var(--navy) !important; border-color: var(--ivory); }
.btn.light:hover { background: #fff; border-color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2rem; }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.bg-paper { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bg-navy { background: var(--navy); color: var(--ivory); }
.bg-navy h2, .bg-navy h3 { color: var(--ivory); }
.bg-navy .lede { color: rgba(247, 243, 232, 0.78); }
.bg-emerald { background: var(--emerald); color: var(--ivory); }
.bg-emerald h2 { color: #fff; }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 96px; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center;
}
.hero h1 { color: var(--navy); }
.hero h1 em { font-style: italic; color: var(--emerald); font-weight: 600; }
.hero .sub {
  font-family: var(--serif); font-style: italic; font-size: 1.7rem; color: var(--emerald);
  margin: -0.2em 0 1.2rem;
}
.hero-logo { max-width: 420px; margin: 0 auto; }
.page-hero { padding: 80px 0 64px; border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 15em; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-logo { max-width: 280px; order: -1; }
  section { padding: 72px 0; }
}

/* ---------- Location strip ---------- */
.strip { padding: 26px 0; background: var(--navy); color: var(--ivory); }
.strip p {
  margin: 0; text-align: center; font-family: var(--serif); font-size: 1.45rem; font-style: italic;
}
.strip .dot { color: var(--gold); padding: 0 .5em; font-style: normal; }

/* ---------- Cards & grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 30px;
}
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .num {
  font-family: var(--sans); font-size: .75rem; font-weight: 700; letter-spacing: .16em;
  color: var(--gold); text-transform: uppercase; display: block; margin-bottom: 14px;
}
.bg-paper .card { background: var(--ivory); }

.section-head { margin-bottom: 48px; }
.section-head h2 { max-width: 18em; }

/* ---------- RECoRD ---------- */
.record-steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border-top: 1px solid rgba(199, 166, 90, 0.4); margin-top: 48px;
}
.record-step { padding: 32px 26px 8px 0; position: relative; }
.record-step + .record-step { padding-left: 26px; border-left: 1px solid rgba(247, 243, 232, 0.14); }
.record-step .letter {
  font-family: var(--serif); font-size: 3.6rem; font-weight: 700; line-height: 1; color: var(--gold);
  display: block; margin-bottom: 10px;
}
.record-step .letter small { font-size: .5em; }
.record-step h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; margin-bottom: .5em; }
.record-step p { color: rgba(247, 243, 232, 0.78); font-size: .96rem; }
@media (max-width: 860px) {
  .record-steps { grid-template-columns: 1fr 1fr; }
  .record-step:nth-child(3) { padding-left: 0; border-left: 0; }
  .record-step { border-top: 1px solid rgba(247, 243, 232, 0.1); }
}
@media (max-width: 520px) {
  .record-steps { grid-template-columns: 1fr; }
  .record-step, .record-step + .record-step { padding-left: 0; border-left: 0; }
}
.mono-cycle {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85rem;
  letter-spacing: .06em; color: var(--gold); margin-top: 28px;
}

/* ---------- Course ladder ---------- */
.course {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px; display: flex; flex-direction: column;
}
.course .code {
  font-family: var(--sans); font-weight: 800; font-size: .82rem; letter-spacing: .12em;
  color: var(--emerald); text-transform: uppercase;
}
.course h3 { font-size: 1.45rem; margin: 10px 0 8px; }
.course p { font-size: .95rem; color: var(--navy-soft); flex: 1; }
.tag {
  align-self: flex-start; font-size: .74rem; font-weight: 700; letter-spacing: .06em;
  padding: 5px 11px; border-radius: 999px; background: var(--ivory-deep); color: var(--navy);
}
.tag.live { background: var(--emerald); color: #fff; }

/* ---------- Split / feature ---------- */
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: center; }
.split.flip { grid-template-columns: 1.1fr 0.9fr; }
@media (max-width: 860px) { .split, .split.flip { grid-template-columns: 1fr; gap: 36px; } }

.photo-placeholder {
  aspect-ratio: 4 / 5; border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(23,107,91,.10), rgba(23,42,70,.10)),
    var(--ivory-deep);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--navy-soft); font-size: .88rem; padding: 24px;
}
.photo-placeholder.wide { aspect-ratio: 4 / 3; }
.photo-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }

blockquote.pull {
  margin: 0; padding: 0 0 0 24px; border-left: 2px solid var(--gold);
  font-family: var(--serif); font-size: 1.7rem; font-style: italic; line-height: 1.3; color: var(--navy);
}
blockquote.pull cite {
  display: block; font-family: var(--sans); font-style: normal; font-size: .85rem;
  font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--emerald); margin-top: 14px;
}

/* ---------- Lists ---------- */
.checklist { list-style: none; padding: 0; margin: 0 0 1em; }
.checklist li { padding: 10px 0 10px 30px; position: relative; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 4px; top: 19px; width: 8px; height: 8px;
  background: var(--gold); transform: rotate(45deg);
}

.creds { list-style: none; margin: 0; padding: 0; }
.creds li { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.creds li:first-child { border-top: 1px solid var(--line); }
.creds .k { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--emerald); padding-top: 3px; }
@media (max-width: 560px) { .creds li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Class listing ---------- */
.class-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.class-card .head { padding: 32px 32px 24px; border-bottom: 1px solid var(--line); }
.class-card .head .code { font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--emerald); }
.class-card .head h3 { font-size: 2rem; margin: 8px 0 6px; }
.class-card .head p { color: var(--navy-soft); margin: 0; }
.class-card .body { display: grid; grid-template-columns: 1.2fr 1fr; }
.class-card .body > div { padding: 28px 32px; }
.class-card .body > div + div { border-left: 1px solid var(--line); background: var(--ivory); }
@media (max-width: 760px) {
  .class-card .body { grid-template-columns: 1fr; }
  .class-card .body > div + div { border-left: 0; border-top: 1px solid var(--line); }
}
.label {
  font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy-soft); margin: 0 0 12px;
}
.session {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.session:last-of-type { border-bottom: 0; }
.session .when { font-weight: 700; }
.session .time { font-size: .92rem; color: var(--navy-soft); }
.status { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status.open { background: rgba(23,107,91,.12); color: var(--emerald); }
.status.full { background: rgba(23,42,70,.08); color: var(--navy-soft); }
.note { font-size: .88rem; color: var(--navy-soft); }

.hours { width: 100%; border-collapse: collapse; font-size: .96rem; }
.hours td { padding: 12px 0; border-bottom: 1px solid var(--line); }
.hours td:last-child { text-align: right; color: var(--navy-soft); }

/* ---------- Steps ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 26px 58px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--navy);
}
.steps strong { display: block; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; font-weight: 600; font-size: 1.05rem;
  display: flex; justify-content: space-between; gap: 20px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--emerald); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 12px 0 0; color: var(--navy-soft); max-width: 44em; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 16em; margin-left: auto; margin-right: auto; }
.cta-band p { max-width: 36em; margin: 0 auto; }
.cta-band .btn-row { justify-content: center; }
.cta-band .email {
  display: inline-block; margin-top: 18px; font-family: var(--serif); font-size: 1.5rem;
  color: var(--ivory); text-decoration: none; border-bottom: 1px solid var(--gold);
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(247, 243, 232, 0.75); padding: 64px 0 36px; font-size: .94rem; }
.site-footer .wordmark .mahj { color: #8FD1BF; }
.site-footer .wordmark .phd { color: var(--ivory); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.site-footer h4 {
  font-family: var(--sans); font-size: .76rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 14px;
}
.site-footer a { color: var(--ivory); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer .tagline { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--ivory); margin: 14px 0 6px; }
.footer-base {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(247, 243, 232, 0.14);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .84rem;
}

/* Accessibility */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--navy); color: #fff; padding: 10px 14px; z-index: 100; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- RECoRD page ---------- */
.cycle {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px;
  margin: 40px 0 0; font-family: var(--sans); font-weight: 700; font-size: 1rem;
}
.cycle .node {
  padding: 12px 20px; border-radius: 999px; border: 1.5px solid var(--gold); color: var(--ivory);
}
.cycle .arrow { color: var(--gold); font-size: 1.2rem; }
.cycle .again { flex-basis: 100%; text-align: center; font-weight: 500; font-size: .9rem; color: rgba(247,243,232,.7); margin-top: 6px; }

.step-detail {
  display: grid; grid-template-columns: 180px 1fr 1fr; gap: 40px;
  padding: 56px 0; border-top: 1px solid var(--line);
}
.step-detail:first-of-type { border-top: 0; padding-top: 0; }
.step-detail .big {
  font-family: var(--serif); font-weight: 700; font-size: 6rem; line-height: .9; color: var(--emerald);
}
.step-detail .big small { font-size: .5em; }
.step-detail h3 { font-size: 2rem; }
.step-detail .ask {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px;
}
.step-detail .ask ul { margin: 0; padding-left: 1.1em; }
.step-detail .ask li { margin-bottom: 6px; }
@media (max-width: 860px) {
  .step-detail { grid-template-columns: 1fr; gap: 16px; padding: 44px 0; }
  .step-detail .big { font-size: 4.5rem; }
}

.isnt { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.isnt .card h3 { font-size: 1.4rem; }
.isnt .card.no { background: transparent; }
@media (max-width: 640px) { .isnt { grid-template-columns: 1fr; } }
.nocase { text-transform: none; letter-spacing: .06em; }

/* JCC links */
a.jcc-link { color: inherit; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 1.5px; }
a.jcc-link:hover { color: var(--emerald); }
.bg-navy a.jcc-link:hover, .bg-emerald a.jcc-link:hover, .strip a.jcc-link:hover { color: #fff; }
a.tag { text-decoration: none; }
a.tag.live:hover { background: var(--emerald-dark); }

/* ---------- MahjPhD Lab ---------- */
.lab-hero { padding: 88px 0 96px; }
.lab-hero .lede { color: rgba(247, 243, 232, 0.82); }
.lab-word { color: #8FD1BF; font-style: italic; font-weight: 600; }
.btn.ghost-light { background: transparent; color: var(--ivory) !important; border-color: rgba(247, 243, 232, 0.6); }
.btn.ghost-light:hover { background: var(--ivory); color: var(--navy) !important; }
.lab-figure { margin: 0; background: rgba(247, 243, 232, 0.04); border: 1px solid rgba(247, 243, 232, 0.14); border-radius: var(--radius); padding: 18px 14px 14px; }
.lab-figure svg { width: 100%; height: auto; display: block; }
.lab-figure figcaption { font-size: .8rem; color: rgba(247, 243, 232, 0.6); padding: 8px 6px 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chips span {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .78rem;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--emerald); background: var(--paper);
}

.method-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 2px solid var(--navy); }
.mstep { padding: 26px 24px 8px 0; }
.mstep + .mstep { padding-left: 24px; border-left: 1px solid var(--line); }
.mstep .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85rem; color: var(--gold); font-weight: 700; }
.mstep h3 { font-size: 1.45rem; margin: 10px 0 8px; }
.mstep p { font-size: .95rem; color: var(--navy-soft); }
@media (max-width: 900px) {
  .method-steps { grid-template-columns: 1fr 1fr; }
  .mstep:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  .method-steps { grid-template-columns: 1fr; }
  .mstep, .mstep + .mstep { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}
.honest {
  margin-top: 40px; padding: 24px 28px; border-left: 3px solid var(--gold);
  background: var(--paper); border-radius: 0 var(--radius) var(--radius) 0; max-width: 820px;
}
.honest p:last-child { margin: 0; color: var(--navy-soft); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 30px 8px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -37px; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--ivory); border: 2px solid var(--gold);
}
.timeline li.now::before { background: var(--emerald); border-color: var(--emerald); box-shadow: 0 0 0 5px rgba(23,107,91,.15); }
.timeline .when { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--emerald); margin-bottom: 4px; }
.timeline .when em { font-style: normal; background: var(--emerald); color: #fff; padding: 2px 8px; border-radius: 999px; margin-left: 8px; letter-spacing: .08em; }
.timeline strong { display: block; font-size: 1.08rem; }
.timeline li > span:last-child { color: var(--navy-soft); font-size: .95rem; }
.disclaimer { max-width: 760px; font-size: .82rem; margin: 0; }
