/* ============================================================
   Orbace Sudoku — re-imagined homepage (R2, site re-imagined v2 §5/§9).
   Ported from docs/os-web-re-imagined721/orbace-site-html-templates/home3.html
   onto css/tokens.css. All classes are `oh-` prefixed and scoped under
   #page-home so nothing leaks into other SPA pages. The functional islands
   (hero replay, Tea Moment widget, ad slots) keep their existing v1-*/og-*
   classes styled by styles.css and the component sheets.
   ============================================================ */

/* ============================================================
   SPA global chrome, re-imagined (unscoped on purpose — this file loads
   after styles.css on index.html, so these override the old tea-green
   chrome on EVERY SPA page: paper-blur header, serif lockup, Inter body,
   forest accents. Matches the static pages' osh-* shell (css/shell.css).
   ============================================================ */
body {
  background:
    radial-gradient(circle at 6% 2%, rgba(220, 232, 220, .72), transparent 31rem),
    linear-gradient(180deg, var(--surface-paper) 0%, var(--surface-tea) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
}
nav.top {
  background: rgba(251, 248, 241, .93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-forest);
}
nav.top .brand h1 { font-family: var(--font-display); letter-spacing: -.02em; color: var(--text-primary); }
nav.top .brand .tag { color: var(--text-secondary); }
nav.top a.navlink { color: var(--text-primary); font-family: var(--font-body); }
nav.top a.navlink:hover { background: transparent; color: var(--brand-seal); }
nav.top a.navlink.active { color: var(--brand-forest); font-weight: 700; }
/* Sign-in as the emphasized account action (template .join / .osh-account). */
nav.top a.navlink[data-nav="account"] {
  color: #fff;
  background: var(--brand-forest);
  border-radius: .35rem;
  font-weight: 700;
}
nav.top a.navlink[data-nav="account"]:hover { background: var(--brand-forest-dark); color: #fff; }
nav.top a.navlink[data-nav="account"].active { color: #fff; background: var(--brand-forest-dark); }
.tabbar { background: rgba(251, 248, 241, .97); border-top: 1px solid var(--line-forest); }
.tabbar a { color: var(--text-secondary); }
.tabbar a.active { color: var(--brand-forest); }
.tabbar a .ts { color: var(--brand-forest); }
body > footer { background: transparent; border-top: 1px solid var(--line-forest); color: var(--text-secondary); }
body > footer a { color: var(--brand-forest); }
body > footer a:hover { color: var(--brand-seal); }
/* The SPA footer now uses the shared osh-footer (css/shell.css) — undo the
   old bare-`footer` element rules from styles.css that would leak in
   (display:flex/gap on the footer itself would fight the inner grid). */
footer.osh-footer { display: block; gap: 0; margin-top: 56px; }
.osh-footer-stores { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.osh-footer-linkbtn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand-forest);
  cursor: pointer;
  font: inherit;
}
.osh-footer-linkbtn:hover { color: var(--brand-seal); }

#page-home { padding: 0; }

#page-home .oh-eye {
  margin: 0 0 1rem;
  color: var(--brand-seal);
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

#page-home .oh-hero-wrap h1,
#page-home .oh-section h2,
#page-home .oh-section h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.16;
  color: var(--brand-forest-dark);
}
#page-home .oh-section h2 { margin: 0 0 1rem; font-size: clamp(1.9rem, 4.5vw, 3.1rem); letter-spacing: -.028em; }
#page-home .oh-section h3 { margin: 0 0 .5rem; font-size: clamp(1.25rem, 2vw, 1.6rem); }

/* ---- Hero (dark forest) ---- */
#page-home .oh-hero-wrap {
  background: linear-gradient(135deg, var(--brand-forest-dark), var(--brand-forest) 66%, #315d48);
  color: #fff;
}
#page-home .oh-hero {
  max-width: var(--measure-max);
  margin: auto;
  padding: clamp(3rem, 7vw, 5.5rem) 1.5rem clamp(3rem, 7vw, 5rem);
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}
#page-home .oh-hero .oh-eye { color: #e7b2a6; }
#page-home .oh-hero h1 {
  max-width: 15ch;
  margin: 0;
  color: #fff;
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  letter-spacing: -.045em;
}
#page-home .oh-lead {
  max-width: 45rem;
  color: rgba(255, 255, 255, .79);
  font-size: clamp(1.02rem, 2vw, 1.18rem);
}
#page-home .oh-bridge {
  margin-top: 1.15rem;
  color: #fff;
  font: italic clamp(1.02rem, 2vw, 1.2rem) var(--font-display);
}
#page-home .oh-trustline { margin-top: 1.2rem; color: rgba(255, 255, 255, .64); font-size: .82rem; }

#page-home .oh-btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.45rem; }
#page-home .oh-btn {
  display: inline-block;
  padding: .77rem 1.02rem;
  border: 1px solid var(--brand-forest);
  border-radius: .36rem;
  font-weight: 750;
  font-size: .95rem;
  font-family: var(--font-body);
  text-decoration: none;
  cursor: pointer;
  color: var(--brand-forest);
  background: transparent;
}
#page-home .oh-btn:hover { color: var(--brand-seal); border-color: var(--brand-seal); }
#page-home .oh-hero .oh-btn { color: #fff; border-color: rgba(255, 255, 255, .68); background: transparent; }
#page-home .oh-hero .oh-btn:hover { border-color: #fff; }
#page-home .oh-btn.primary { color: var(--brand-forest-dark); background: #fff; border-color: #fff; }
#page-home .oh-btn.primary:hover { color: var(--brand-seal); }

/* Hero replay island — the canonical replay/game-card components provide
   their own chrome; this wrapper just gives them a lifted paper card. */
#page-home .oh-hero-replay {
  padding: 1.05rem;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: .75rem;
  background: rgba(247, 241, 229, .98);
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, .18);
}
#page-home .oh-replay-kicker {
  margin: 0 0 .6rem;
  color: var(--brand-seal);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Parent-scoped equivalents of styles.css's .v1-home-hero island rules
   (the island moved from .v1-home-hero into .oh-hero-replay; the class-based
   .v1-home-hero-board/-controls sizing rules still apply unchanged). */
#page-home .oh-hero-replay .osgc-card { min-width: 0; }
#page-home .oh-hero-replay .osgc-body { align-items: stretch; }
@media (max-width: 640px) {
  #page-home .oh-hero-replay .osgc-card { width: 100%; }
  #page-home .oh-hero-replay .v1-home-hero-board.og-board { width: 100%; max-width: 420px; }
  #page-home .oh-hero-replay .v1-home-hero-controls { width: 100%; max-width: 420px; }
}

/* ---- Store strip ---- */
#page-home .oh-store-strip {
  padding: 1.05rem 1.5rem;
  border-bottom: 1px solid var(--line-forest);
  background: rgba(255, 255, 255, .45);
}
#page-home .oh-store-inner {
  max-width: var(--measure-max);
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem 1.4rem;
  flex-wrap: wrap;
}
#page-home .oh-store-inner > span { color: var(--text-secondary); font-size: .87rem; }
#page-home .oh-store-inner > a:last-child { color: var(--brand-forest); font-size: .87rem; }

/* ---- Generic section scaffolding ---- */
#page-home .oh-section { padding: clamp(3.5rem, 7vw, 5.5rem) 1.5rem; }
#page-home .oh-inner { max-width: var(--measure-max); margin: auto; }
#page-home .oh-section-head { max-width: 52rem; margin-bottom: 2.5rem; }
#page-home .oh-section-head p { color: var(--text-secondary); }

/* ---- Two records (Scorecard vs Su-Pu) ---- */
#page-home .oh-record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: stretch; }
#page-home .oh-record-panel {
  padding: clamp(1.6rem, 4vw, 2.6rem);
  border: 1px solid var(--line-forest);
  border-radius: .75rem;
  background: rgba(255, 255, 255, .52);
}
#page-home .oh-record-panel p { color: var(--text-secondary); }
#page-home .oh-record-tag {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--brand-seal);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
#page-home .oh-scorecard {
  margin-top: 1.5rem;
  padding: 1.2rem;
  border: 1px solid var(--line-forest);
  border-radius: .65rem;
  background: #fcf9f1;
}
#page-home .oh-score-top { display: flex; justify-content: space-between; gap: 1rem; }
#page-home .oh-score-id { display: flex; gap: .7rem; align-items: center; }
#page-home .oh-score-seal {
  width: 3.3rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand-seal);
  border-radius: .4rem;
  font: 2rem var(--font-cjk);
}
#page-home .oh-score-id strong { display: block; color: var(--brand-forest-dark); font-family: var(--font-display); }
#page-home .oh-score-id small { color: var(--text-secondary); }
#page-home .oh-score-total { text-align: right; }
#page-home .oh-score-total strong { display: block; font: 2.2rem var(--font-display); color: var(--text-primary); }
#page-home .oh-score-total small { color: var(--text-secondary); }
#page-home .oh-badges { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0; }
#page-home .oh-badge {
  padding: .24rem .48rem;
  border: 1px solid rgba(36, 76, 58, .35);
  border-radius: .35rem;
  color: var(--brand-forest);
  font-size: .75rem;
}
#page-home .oh-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: .75rem 0;
  border-block: 1px solid var(--line-forest);
  text-align: center;
}
#page-home .oh-metrics strong { display: block; color: var(--brand-forest-dark); }
#page-home .oh-metrics span { font-size: .7rem; color: var(--text-secondary); }
#page-home .oh-score-lines { margin-top: .8rem; }
#page-home .oh-score-line { display: flex; justify-content: space-between; padding: .3rem 0; color: var(--text-secondary); font-size: .83rem; }
#page-home .oh-score-line.total {
  margin-top: .4rem;
  padding-top: .6rem;
  border-top: 1px solid var(--line-forest);
  color: var(--text-primary);
  font-weight: 800;
}
#page-home .oh-supu-preview { margin-top: 1.5rem; }
#page-home .oh-timeline { margin-top: 1rem; display: grid; gap: .55rem; }
#page-home .oh-timeline > div { display: flex; gap: .7rem; align-items: baseline; color: var(--text-secondary); font-size: .9rem; }
#page-home .oh-timeline b {
  flex: 0 0 auto;
  min-width: 2rem;
  text-align: center;
  padding: .12rem .3rem;
  border-radius: .3rem;
  color: var(--brand-forest);
  background: var(--surface-mist);
  font-family: var(--font-display);
}
#page-home .oh-distinction {
  margin-top: 1.5rem;
  padding: 1.3rem;
  border-left: .3rem solid var(--brand-seal);
  background: var(--surface-paper-deep);
  color: var(--text-secondary);
}

/* ---- Paths ---- */
#page-home .oh-paths { background: var(--surface-paper-deep); }
#page-home .oh-path-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
#page-home .oh-path {
  padding: clamp(1.7rem, 4vw, 2.8rem);
  border: 1px solid var(--line-forest);
  border-radius: .7rem;
  background: rgba(255, 255, 255, .52);
}
#page-home .oh-path p { color: var(--text-secondary); }
#page-home .oh-path-tag {
  display: inline-block;
  margin-bottom: .9rem;
  color: var(--brand-seal);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
#page-home .oh-auth-note {
  margin-top: 1rem;
  padding: .9rem 1rem;
  border-left: 3px solid var(--brand-forest);
  color: var(--text-secondary);
  background: rgba(220, 232, 220, .55);
  font-size: .87rem;
}
#page-home .oh-auth-note strong { color: var(--brand-forest-dark); }

/* ---- Ecosystem (dark) ---- */
#page-home .oh-ecosystem { background: var(--brand-forest-dark); color: #fff; }
#page-home .oh-ecosystem h2, #page-home .oh-ecosystem h3 { color: #fff; }
#page-home .oh-ecosystem .oh-section-head p, #page-home .oh-eco p { color: rgba(248, 244, 233, .75); }
#page-home .oh-eco-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
#page-home .oh-eco {
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: .65rem;
  background: rgba(255, 255, 255, .05);
}
#page-home .oh-eco span { display: block; margin-bottom: 1.5rem; color: #deb6a5; font: 1rem var(--font-display); }
#page-home .oh-eco a { color: #fff; font-weight: 750; text-decoration: none; }
#page-home .oh-eco a:hover { color: #e7b2a6; }

/* ---- Ranking band ---- */
#page-home .oh-ranking { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 7vw, 6rem); align-items: center; }
#page-home .oh-ranking p { color: var(--text-secondary); }
#page-home .oh-rank-card {
  padding: 2rem;
  border: 1px solid var(--line-forest);
  border-radius: .7rem;
  text-align: center;
  background: rgba(255, 255, 255, .55);
}
#page-home .oh-rank-mark {
  width: 4rem;
  aspect-ratio: 1;
  margin: auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand-forest);
  font: 1.5rem var(--font-cjk);
}
#page-home .oh-rank-card p { max-width: 28rem; margin: .7rem auto; }

/* ---- Weekly study ---- */
#page-home .oh-study-section { background: var(--surface-paper-deep); }
#page-home .oh-study {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  overflow: hidden;
  border: 1px solid var(--line-forest);
  border-radius: .75rem;
  background: rgba(255, 255, 255, .58);
}
#page-home .oh-study-art { min-height: 18rem; display: grid; place-items: center; background: var(--surface-mist); }
#page-home .oh-study-board {
  width: 13rem;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 2px;
  background: var(--brand-forest-dark);
}
#page-home .oh-study-board i {
  display: grid;
  place-items: center;
  border: 1px solid rgba(36, 76, 58, .25);
  color: var(--brand-forest);
  background: var(--surface-tea);
  font: normal 1.6rem var(--font-display);
}
#page-home .oh-study-board i:nth-child(5) { color: #fff; background: var(--brand-seal); }
#page-home .oh-study-copy { padding: clamp(2rem, 5vw, 3.5rem); align-self: center; }
#page-home .oh-study-copy p { color: var(--text-secondary); }
#page-home .oh-study-meta {
  color: var(--brand-seal);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---- Trust band (dark) ---- */
#page-home .oh-trust { background: var(--brand-forest-dark); color: #fff; }
#page-home .oh-trust h2 { color: #fff; }
#page-home .oh-trust p { color: rgba(255, 255, 255, .75); }
#page-home .oh-trust-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 7vw, 7rem); }
#page-home .oh-trust .oh-btn { color: #fff; border-color: #fff; }
#page-home .oh-trust-links { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
#page-home .oh-trust-links a {
  padding: .75rem;
  border-bottom: 1px solid rgba(255, 255, 255, .17);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
#page-home .oh-trust-links a:hover { color: #e7b2a6; }

/* ---- Responsive ---- */
@media (max-width: 1000px) {
  #page-home .oh-hero { grid-template-columns: 1fr; }
  #page-home .oh-hero-replay { max-width: 45rem; }
  #page-home .oh-eco-grid { grid-template-columns: 1fr 1fr; }
  #page-home .oh-ranking, #page-home .oh-study, #page-home .oh-trust-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  #page-home .oh-record-grid, #page-home .oh-path-grid, #page-home .oh-eco-grid { grid-template-columns: 1fr; }
  #page-home .oh-metrics { grid-template-columns: 1fr 1fr; gap: .6rem; }
  #page-home .oh-trust-links { grid-template-columns: 1fr; }
  #page-home .oh-hero .oh-btn { width: 100%; text-align: center; }
  #page-home .oh-score-top { display: block; }
  #page-home .oh-score-total { text-align: left; margin-top: .8rem; }
}
