:root {
  color-scheme: dark;
  --bg: #081e1c;
  --panel: #12352f;
  --panel2: #17463b;
  --ink: #f3f8f0;
  --muted: #b5d1c4;
  --edge: #35685a;
  --accent: #ff8c32;
  --light: #ffcf9d;
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 4px;
}
.site-header {
  max-width: 1600px; min-height: 80px; margin: auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; padding: 14px clamp(20px, 4vw, 56px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; border: 1px solid #ffad68;
  background: #d96d22; color: #fff; width: 45px; height: 45px;
  border-radius: 10px; font-size: 13px; font-weight: 850; letter-spacing: .08em;
  flex-shrink: 0;
}
.brand b { display: block; font-size: 20px; line-height: 1.25; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.site-header > nav, .site-nav {
  display: flex; align-items: center; gap: clamp(12px, 2vw, 30px);
  font-size: 14px; margin-left: auto;
}
.site-header nav a { color: var(--muted); }
.site-header nav a:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  border: 1px solid var(--edge); border-radius: 50%; flex-shrink: 0;
  background: var(--panel); color: var(--light);
  width: 40px; height: 40px; font-size: 20px;
}
.mobile-menu { display: none; position: relative; z-index: 20; }
.mobile-menu summary {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  list-style: none; border: 1px solid var(--edge); border-radius: 9px;
  padding: 10px 12px; font-size: 13px; font-weight: 700; min-height: 40px;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu nav {
  position: absolute; right: 0; top: calc(100% + 8px);
  display: grid; width: 178px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 12px;
  box-shadow: 0 20px 45px #0008; padding: 8px;
}
.mobile-menu nav a {
  display: block; padding: 12px 10px; border-radius: 8px;
  font-size: 14px; min-height: 42px;
}
.mobile-menu nav a:hover { background: var(--panel2); }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 14px; min-height: 52px; padding: 12px 23px;
  border-radius: 11px; border: 1px solid var(--edge);
  font-size: 15px; font-weight: 800; text-align: center;
  transition: transform .16s ease, filter .16s ease;
}
.button.primary {
  background: linear-gradient(115deg, #ffab36, #f26b1e); color: #291a0e;
  border-color: #ffb15a; box-shadow: 0 10px 25px #f2682148;
}
.button.outlined { background: #071d1dc7; border-color: #ffab59; color: #fffaf0; }
.button:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* A2: one accessible HTML hero over decorative perspective artwork. */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  max-width: 1568px; min-height: 680px; margin: 0 auto 30px;
  border-radius: 22px;
  display: flex; align-items: center;
  padding: 72px clamp(30px, 4.8vw, 78px) 86px;
  background: #082722;
}
.hero-art {
  position: absolute; inset: 0; overflow: hidden; z-index: -2;
  margin: 0; pointer-events: none;
}
.hero-art img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 55% 50%;
}
.hero-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg,
    #072b27 0%, #072b27f7 25%, #092c29e2 43%,
    #0a29268c 59%, #0a292610 82%);
}
.hero::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0;
  height: 24%; z-index: -1; pointer-events: none;
  background: linear-gradient(0deg, #071b1b7a, transparent);
}
.hero-copy { width: min(760px, 59%); position: relative; z-index: 2; }
.eyebrow, .kicker {
  font-size: 12px; letter-spacing: .15em; font-weight: 800;
  color: var(--accent);
}
.hero h1 {
  font-size: clamp(72px, 8.3vw, 130px);
  color: #ff992f; letter-spacing: -.06em; line-height: 1.14;
  font-weight: 900; margin: 20px 0 30px;
  text-shadow: 0 8px 36px #031c15a8;
  white-space: nowrap;
}
.hero h1::after {
  content: ""; display: block; width: 85%; height: 8px;
  border-radius: 90% 0 90% 0; transform: rotate(-2deg);
  background: linear-gradient(90deg, #fdae49, #e97018, #f5b04c00);
  margin-top: 6px;
}
.hero-slogan {
  color: #fff9ee; font-size: clamp(22px, 2.35vw, 35px);
  font-weight: 800; line-height: 1.55; letter-spacing: .01em;
  margin: 12px 0 13px; text-shadow: 0 4px 24px #001c1bc9;
}
.hero-description {
  color: #e4f0e9; font-size: 16px; line-height: 1.8;
  margin: 0 0 26px; max-width: 600px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions .button { font-size: 16px; min-height: 57px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }
.hero-tags span {
  color: #d9eddf; font-size: 12px; padding: 7px 12px;
  border: 1px solid #75908091; border-radius: 999px;
  background: #072a27b8;
}
.art-stamp {
  position: absolute; display: inline-block; padding: 8px 18px;
  font-weight: 800; font-size: 16px; border-radius: 999px;
  color: #fff9eb; border: 2px solid #ffac45;
  background: #071c19c9; box-shadow: 0 8px 18px #0004;
  white-space: nowrap;
}
.art-start { right: 6%; top: 11%; }
.art-route { right: 30%; top: 25%; }
.art-finish { right: 41%; bottom: 12%; }

/* Sections retain the v51 IA and actual navigation targets. */
.how, .modes {
  max-width: 1600px; margin: auto;
  padding: 35px clamp(20px, 4vw, 56px) 55px;
}
.section-heading h2 { font-size: clamp(25px,2.5vw,37px); margin: 8px 0 10px; }
.section-heading p { color: var(--muted); margin: 0; line-height: 1.7; }
.steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-top: 26px; }
.steps article, .mode-card {
  background: var(--panel); border: 1px solid var(--edge);
  border-radius: 16px; padding: 24px;
}
.steps b { font-size: 33px; color: var(--accent); font-variant-numeric: tabular-nums; }
.steps h3 { margin: 10px 0 5px; font-size: 18px; }
.steps p, .mode-card p { color: var(--muted); line-height: 1.75; margin: 0; }
.modes { padding-top: 50px; }
.mode-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-top: 28px; }
.mode-card { display: flex; flex-direction: column; min-height: 274px; }
.mode-card.featured {
  border-color: #ea7c2d;
  background: linear-gradient(145deg, #22453a, #4e391f);
}
.mode-icon {
  display: grid; place-items: center; font-size: 27px; color: var(--accent);
  border: 1px solid var(--edge); border-radius: 12px; width: 46px; height: 46px;
}
.mode-card small { font-size: 12px; color: var(--accent); margin-top: 16px; }
.mode-card h3 { font-size: 22px; margin: 4px 0 8px; }
.mode-card a { color: var(--light); font-weight: 800; margin-top: auto; padding-top: 22px; }
.mode-card a:hover { text-decoration: underline; }
.hardware {
  max-width: 1488px; margin: 30px auto 85px; padding: 35px;
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  border-radius: 18px; background: linear-gradient(100deg,#20594a,#275247 70%,#765031);
}
.hardware h2 { font-size: 28px; margin: 8px 0; }
.hardware p { color: #d4e7d7; max-width: 740px; line-height: 1.7; }
.hardware .button.outlined { background: #10352ec2; color: #fff; border-color: #f7ceaa; }
footer {
  border-top: 1px solid var(--edge); padding: 24px clamp(20px,4vw,56px);
  display: flex; justify-content: space-between; gap: 20px;
  color: var(--muted); font-size: 12px;
}
footer a:hover { color: var(--accent); }

/* Member entrance remains separate and locked until auth / API is configured. */
.challenge-page main { max-width: 1050px; margin: 20px auto 90px; padding: 0 22px; }
.challenge-intro { text-align: center; padding: 35px 0 15px; }
.challenge-intro h1 { font-size: clamp(29px,4vw,42px); margin: 12px 0; }
.challenge-intro p { color: var(--muted); line-height: 1.7; }
.identity {
  background: var(--panel); border: 1px solid var(--edge);
  border-radius: 14px; padding: 18px 22px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 24px 0;
}
.identity p { margin: 4px 0; color: var(--muted); }
.identity button {
  border: 1px solid var(--accent); border-radius: 8px;
  background: var(--accent); color: #211809;
  padding: 10px 19px; font-weight: 800;
}
.challenge-page .mode-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
.challenge-page .mode-card button {
  margin-top: auto; padding: 11px 16px; border-radius: 9px;
  border: 1px solid var(--accent); background: var(--accent);
  color: #211809; font-weight: 800; text-align: left;
}
.challenge-page .mode-card button:disabled {
  border-color: var(--edge); background: transparent; color: var(--muted);
}
.notice { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 18px 0; }
.back-link { color: var(--light); font-size: 14px; }

html[data-theme="light"] {
  color-scheme: light; --bg: #fff7ee; --panel: #fffdf9;
  --panel2: #fff0df; --ink: #30251b; --muted: #715c4d;
  --edge: #e9c9aa; --accent: #bd540f; --light: #a8490b;
}
html[data-theme="light"] .hero { background: #082722; }
html[data-theme="light"] .hero .eyebrow { color: #ffac56; }
html[data-theme="light"] .hero .button.primary { color: #22170d; }
html[data-theme="light"] .button.primary,
html[data-theme="light"] .challenge-page .mode-card button:not(:disabled) { color: #fff; }
html[data-theme="light"] .mode-card.featured { background: linear-gradient(145deg,#fff2e4,#ffdfc4); }
html[data-theme="light"] .hardware {
  background: linear-gradient(100deg,#a44710,#db691d); color: #fff;
}
html[data-theme="light"] .hardware .kicker,
html[data-theme="light"] .hardware p { color: #fff1df; }
html[data-theme="light"] .hardware .button.outlined {
  background: #6e2f10; color: #fff; border-color: #ffe1b8;
}
html[data-theme="light"] .identity button { color: #fff; }
html[data-theme="light"] .mobile-menu nav { box-shadow: 0 20px 40px #351a112a; }

@media (max-width: 1100px) {
  .hero { min-height: 600px; }
  .hero-copy { width: min(675px,65%); }
  .hero h1 { font-size: clamp(64px,8.2vw,105px); }
  .hero-art::after { background: linear-gradient(90deg,#072b27 0%,#072b27f5 31%,#092c29c7 55%,#0a292622 90%); }
  .hardware { margin-left: 20px; margin-right: 20px; }
}
@media (max-width: 800px) {
  .home-page .site-nav { display: none; }
  .mobile-menu { display: block; }
  .hero {
    display: flex; flex-direction: column; align-items: stretch; min-height: 0;
    padding: 46px 24px 0; border-radius: 18px; margin: 0 16px 26px;
  }
  .hero-copy { width: 100%; max-width: 650px; }
  .hero-art { position: relative; order: 2; height: 350px; margin: 15px -24px 0; }
  .hero-art::after { background: linear-gradient(180deg,#08292377,transparent 35%,#08292330 90%); }
  .hero-art img { object-fit: cover; object-position: 72% 50%; }
  .hero h1 { font-size: clamp(55px,10vw,82px); margin: 18px 0 25px; }
  .hero-slogan { font-size: clamp(21px,3.6vw,29px); }
  .hero-description { font-size: 15px; }
  .art-start { right: 4%; top: 13%; }
  .art-route { right: 34%; top: 29%; }
  .art-finish { right: 38%; bottom: 10%; }
  .art-stamp { padding: 5px 10px; font-size: 12px; border-width: 1px; }
  .steps { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mode-cards { grid-template-columns: 1fr; }
  .hardware { flex-direction: column; align-items: flex-start; }
  .challenge-page .site-header > nav a { display: none; }
}
@media (max-width: 550px) {
  .brand small { display: none; }
  .brand b { font-size: 18px; }
  .site-header { min-height: 70px; }
  .hero { padding: 32px 20px 0; margin: 0 10px 22px; }
  .hero h1 { font-size: clamp(51px,14vw,75px); }
  .hero-slogan { font-size: 21px; }
  .hero-description { font-size: 14px; }
  .hero-actions .button { width: 100%; min-height: 52px; }
  .hero-art { height: 290px; margin: 18px -20px 0; }
  .hero-art img { object-position: 74% 50%; transform: scale(1.22); }
  .art-finish { display: none; }
  .steps article { padding: 16px; }
  .mode-card { min-height: 230px; }
  .challenge-page .mode-cards { grid-template-columns: 1fr; }
  .identity { flex-direction: column; align-items: flex-start; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
  .button:hover { transform: none; }
}

/* v51 public preview: explicit mock-member navigation; never grants real auth. */
.preview-member-entry{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;margin:16px 0 26px;padding:17px 21px;border:1px solid #d89b49;border-radius:13px;background:var(--panel2)}
.preview-member-entry>div{flex:1 1 310px}
.preview-member-entry strong{font-size:16px;color:var(--light)}
.preview-member-entry p{margin:5px 0 0;color:var(--muted);font-size:13px;line-height:1.7}
.preview-member-entry .button{flex:0 0 auto;min-height:47px;font-size:14px}
.preview-home-entry{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin-top:10px!important;font-size:13px;line-height:1.6}
.preview-home-entry a{color:var(--light);font-weight:850;text-decoration:underline;text-underline-offset:4px}
.preview-home-entry span{font-size:12px;color:var(--muted)}
@media(max-width:550px){.preview-member-entry{padding:14px;gap:11px}.preview-member-entry .button{width:100%;flex:1 1 100%}}
