/* First Move Chess — static HTML rewrite */

:root {
  --brand-blue: #003865;
  --brand-blue-light: #EDF7FF;
  --brand-orange: #ED8B00;
  --brand-orange-light: #FFE8C8;
  --background: #ffffff;
  --foreground: #151819;
  --muted: #f5f5f5;
  --border: #e8e8e8;
  --radius: 0.5rem;
  --font-sans: "Hiragino Kaku Gothic Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ------------------------------------------------------------------ */
/* Header components */
/* ------------------------------------------------------------------ */

.marketing-header,
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: var(--background);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.app-header {
  background: var(--brand-blue);
  border-bottom: none;
  box-shadow: 0 4px 2px rgba(0,0,0,0.25);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.marketing-header .header-inner { height: 72px; }

.logo-color { height: 56px; width: auto; }
.logo-white { height: 67px; width: auto; }
.marketing-header .logo-color { height: 56px; }

.desktop-nav,
.app-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 14px;
  color: rgba(21,24,25,0.8);
  transition: color 0.2s;
}
.nav-link:hover,
.nav-link.active {
  color: var(--brand-blue);
}
.nav-link.active {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.app-nav .nav-link {
  color: #fff;
  font-size: 16px;
  opacity: 0.9;
}
.app-nav .nav-link:hover,
.app-nav .nav-link.active {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.app-nav .nav-link.active { font-weight: 600; }

.btn-login {
  background: var(--brand-blue);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
}
.btn-login:hover { opacity: 0.9; }

.btn-logout {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  padding: 8px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  transition: opacity 0.2s;
}
.btn-logout:hover { opacity: 0.9; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  padding: 12px;
  border-radius: 12px;
  transition: opacity 0.2s;
}
.back-link:hover { opacity: 0.8; }
.chevron-left { font-size: 14px; }

/* ------------------------------------------------------------------ */
/* Marketing home */
/* ------------------------------------------------------------------ */

.page-home { min-height: 100vh; }

.hero-section { position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: 37.5% 1fr;
  gap: 108px;
}

.hero-image-wrap {
  position: relative;
  z-index: 10;
  align-self: start;
  position: sticky;
  top: 88px;
}
.hero-img {
  width: 100%;
  height: calc(100vh - 88px);
  object-fit: cover;
  opacity: 0.9;
}
.king-silhouette {
  position: absolute;
  right: 308px;
  top: 48px;
  height: 624px;
  width: auto;
  pointer-events: none;
  transform: rotate(0deg);
  transform-origin: bottom right;
  transition: transform 700ms ease-out;
}
.king-silhouette.tipped { transform: rotate(45deg); }

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0 108px 0 0;
}

.hero-intro { padding: 240px 0 0; }
.hero-intro h1 {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.36;
  letter-spacing: -1.44px;
  color: var(--brand-blue);
  margin: 0;
}

.history-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 32px;
  padding: 16px 20px;
  border: none;
  border-radius: 16px;
  background: var(--brand-blue);
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  text-align: left;
  transition: opacity 0.2s;
}
.history-toggle:hover { opacity: 0.9; }
.history-toggle img { width: 24px; height: 24px; }

.history-timeline {
  display: none;
  margin-top: 12px;
  border-radius: 16px;
  background: var(--brand-blue-light);
  padding: 32px 40px;
}
.history-timeline.open { display: block; }
.history-timeline ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
}
.history-timeline li {
  display: grid;
  grid-template-columns: 4rem auto 1fr;
  align-items: stretch;
  gap: 8px;
}
.history-timeline .year {
  display: flex;
  height: 24px;
  align-items: center;
  justify-content: flex-end;
  font-size: 16px;
  font-weight: 600;
  color: var(--brand-blue);
}
.history-timeline .icon-col {
  display: flex;
  flex-direction: column;
  width: 24px;
  justify-content: flex-start;
  align-items: center;
  height: 100%;
}
.history-timeline .icon-col img {
  width: 24px;
  object-fit: contain;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.history-timeline .line {
  width: 4px;
  flex: 1;
  border-radius: 999px;
  background: var(--brand-blue);
  margin-bottom: -28px;
}
.history-timeline p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(21,24,25,0.85);
}

.mission-section {
  position: relative;
  padding: 240px 0;
}
.mission-section::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 100vw;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffffff 0%, #EDF7FF 100%);
  z-index: -1;
}
.mission-inner { position: relative; z-index: 1; }
.mission-section h2 {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.36;
  letter-spacing: -1.44px;
  color: var(--brand-blue);
  margin: 0;
}
.mission-section p {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(21,24,25,0.8);
}

.btn-brand {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  padding: 12px 24px;
  border-radius: 16px;
  background: var(--brand-blue);
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  transition: opacity 0.2s;
}
.btn-brand:hover { opacity: 0.9; }

.sister-site { background: var(--brand-blue); }
.sister-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.sister-inner p {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
}
.btn-sister {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 16px;
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.btn-sister:hover { transform: translateY(-2px); }
.external { font-size: 20px; }

.testimonials { background: var(--background); padding: 64px 0; }
.testimonial-track-wrap {
  width: 100%;
  overflow: hidden;
  padding: 24px 0;
}
.testimonial-track {
  display: flex;
  gap: 32px;
  transition: transform 500ms ease-out;
}
.testimonial-card {
  flex: 0 0 300px;
  height: 224px;
  padding: 36px 24px 24px;
  border-radius: 12px;
  background: var(--brand-orange-light);
  border: 1px solid var(--brand-blue);
  opacity: 0.6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 300ms;
}
.testimonial-card.active {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  border-width: 4px;
}
.testimonial-card img { height: 20px; width: auto; object-fit: contain; align-self: flex-start; }
.testimonial-card .quote {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.testimonial-card p { margin: 0; font-size: 14px; }

.testimonial-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}
.round-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--brand-blue);
  color: #fff;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: opacity 0.2s;
}
.round-btn:hover { opacity: 0.9; }

.marketing-footer {
  background: var(--brand-blue);
  color: #fff;
}
.marketing-footer .footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
}
.marketing-footer h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
}
.marketing-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.marketing-footer li { margin-bottom: 4px; }
.marketing-footer a {
  color: #fff;
  font-size: 16px;
}
.marketing-footer a:hover { text-decoration: underline; }
.marketing-footer .address { padding-top: 16px; line-height: 1.5; }

/* ------------------------------------------------------------------ */
/* App pages */
/* ------------------------------------------------------------------ */

.page-app { min-height: 100vh; display: flex; flex-direction: column; }

.home-main {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.split-bg {
  position: absolute;
  inset: 0;
  display: flex;
}
.bg-half {
  width: 50%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.bg-blue { background-image: url('../images/blue_board.png'); background-position: right center; }
.bg-orange { background-image: url('../images/orange_board.png'); background-position: left center; }

.home-content {
  position: relative;
  z-index: 10;
  max-width: 1280px;
  margin: 0 auto;
  padding: 74px 24px 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.welcome-banner {
  width: 100%;
  max-width: 716px;
  height: 67px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  padding: 0 24px;
}
.welcome-banner p { margin: 0; font-size: 24px; }
.welcome-banner .semibold { font-weight: 600; }
.welcome-banner .light { font-weight: 300; }

.action-cards {
  margin-top: 115px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
.action-card {
  display: flex;
  justify-content: center;
}
.action-card > div {
  width: 329px;
  height: 252px;
  border-radius: 16px;
  padding: 28px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.action-card.blue > div { background: var(--brand-blue-light); }
.action-card.orange > div { background: var(--brand-orange-light); }
.action-card h2 { font-size: 36px; font-weight: 600; margin: 0; }
.action-card.blue h2 { color: var(--brand-blue); }
.action-card p {
  margin-top: 12px;
  max-width: 294px;
  text-align: center;
  font-size: 16px;
}
.action-card.blue p { color: var(--brand-blue); }
.action-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 16px;
  font-size: 20px;
  font-weight: 600;
  transition: opacity 0.2s;
}
.action-btn:hover { opacity: 0.9; }
.action-btn.blue { background: var(--brand-blue); color: #fff; }
.action-btn.orange { background: var(--brand-orange); color: #151819; }

/* ------------------------------------------------------------------ */
/* Auth pages */
/* ------------------------------------------------------------------ */

.page-auth { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.auth-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 91px 24px;
  overflow: hidden;
}
.auth-box {
  width: 100%;
  max-width: 536px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.auth-logo { height: 119px; width: auto; margin-bottom: 16px; }
.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  border-radius: 16px;
  padding: 32px 84px;
}
.auth-form.blue { background: var(--brand-blue); }
.auth-form.light {
  background: var(--brand-blue-light);
  border: 1px solid var(--brand-blue);
}
.auth-form.narrow { padding: 20px 40px; max-width: 528px; }

.field {
  width: 100%;
  max-width: 368px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.name-row {
  width: 100%;
  max-width: 368px;
  display: flex;
  gap: 32px;
}
.name-row .field { width: 168px; max-width: none; }

.field label,
.field .form-body {
  font-size: 16px;
  font-weight: 600;
}
.auth-form.blue .field label,
.auth-form.blue .field .form-body { color: #fff; }
.auth-form.light .field label,
.auth-form.light .field .form-body { color: var(--brand-blue); }

.field input {
  height: 52px;
  width: 100%;
  border-radius: 15px;
  border: 1px solid #fff;
  background: #fff;
  padding: 0 20px;
  font-size: 16px;
  color: var(--brand-blue);
  outline: none;
}
.auth-form.light .field input { border-color: var(--brand-blue); }
.field input::placeholder { color: rgba(0,56,101,0.7); }

.pw-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  border-radius: 15px;
  border: 1px solid #fff;
  background: #fff;
  padding: 0 20px;
}
.auth-form.light .pw-wrap { border-color: var(--brand-blue); }
.pw-wrap input {
  flex: 1;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0;
}
.pw-toggle {
  background: none;
  border: none;
  padding: 0;
}
.pw-toggle img { width: 24px; height: 24px; }

.forgot-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.link-white { color: #fff; font-size: 16px; text-decoration: underline; }

.auth-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.btn-secondary {
  padding: 12px 36px;
  border-radius: 16px;
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  font-size: 20px;
  font-weight: 600;
  border: none;
  transition: opacity 0.2s;
}
.btn-secondary:hover { opacity: 0.9; }
.btn-orange {
  padding: 12px 36px;
  border-radius: 16px;
  background: var(--brand-orange);
  color: #151819;
  font-size: 20px;
  font-weight: 600;
  border: none;
  transition: opacity 0.2s;
}
.btn-orange:hover { opacity: 0.9; }

.text-white { color: #fff; font-size: 16px; }
.text-blue { color: var(--brand-blue); font-size: 16px; }
.underline { text-decoration: underline; }

.form-title {
  width: 100%;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.34;
  color: #fff;
  margin: 0;
}
.form-body { margin: 0; font-weight: 400 !important; }

/* ------------------------------------------------------------------ */
/* App footer */
/* ------------------------------------------------------------------ */

.app-footer {
  background: var(--brand-blue);
  color: #fff;
  padding: 60px 65px;
}
.app-footer .footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-columns {
  display: flex;
  align-items: flex-start;
  gap: 100px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
}
.footer-heading { font-weight: 600; margin: 0; }
.footer-col a { color: #fff; font-weight: 300; }
.footer-col a:hover { text-decoration: underline; }
.social-placeholder { display: flex; gap: 8px; padding: 8px 0; }
.social-placeholder span {
  width: 28px;
  height: 28px;
  background: #fff;
  border-radius: 4px;
}
.address { padding: 8px 0; line-height: 1.5; font-weight: 300; }

/* ------------------------------------------------------------------ */
/* WIP pages */
/* ------------------------------------------------------------------ */

.page-wip { min-height: 100vh; display: flex; flex-direction: column; }
.wip-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.wip-main p {
  text-align: center;
  font-size: 24px;
  color: var(--brand-blue);
}

/* ------------------------------------------------------------------ */
/* Learn page */
/* ------------------------------------------------------------------ */

.learn-main {
  position: relative;
  flex: 1;
  min-height: calc(100vh - 90px);
  overflow: hidden;
  background: var(--brand-blue-light);
}
.learn-bg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 692px;
  overflow: hidden;
  pointer-events: none;
}
.learn-bg img {
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 100%;
  width: auto;
  max-width: none;
  transform: translateX(-50%);
}
.learn-content {
  position: relative;
  z-index: 10;
  max-width: 1280px;
  margin: 0 auto;
  padding: 27px 48px 0;
  height: calc(100vh - 90px);
  overflow-y: auto;
}
.dragon-talks { height: 160px; width: auto; }
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 24px 0 96px;
}
.lesson-card {
  overflow: hidden;
  border-radius: 16px;
  border: 0.5px solid var(--brand-blue);
  box-shadow: 0 4px 2px rgba(0,0,0,0.25);
}
.lesson-top {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
}
.lesson-bottom {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 16px;
  white-space: nowrap;
}
.lesson-card.current .lesson-top { background: var(--brand-orange); color: #151819; }
.lesson-card.current .lesson-bottom { background: #fff; color: #151819; }
.lesson-card.locked .lesson-top { background: var(--brand-blue); color: #fff; }
.lesson-card.locked .lesson-bottom { background: #fff; color: #151819; }
.lesson-card.done .lesson-top { background: var(--brand-blue-light); color: var(--brand-blue); }
.lesson-card.done .lesson-bottom { background: #fff; color: #151819; }

/* ------------------------------------------------------------------ */
/* Play page */
/* ------------------------------------------------------------------ */

.play-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.play-main p { font-size: 24px; color: var(--brand-blue); }

/* ------------------------------------------------------------------ */
/* Responsive */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-image-wrap { position: relative; top: auto; }
  .hero-img { height: 560px; }
  .king-silhouette { right: auto; left: 50%; transform: translateX(-50%) rotate(0deg); height: 560px; }
  .hero-content { padding: 0 24px; }
  .hero-intro { padding-top: 40px; }
  .mission-section { padding: 96px 0; }
  .marketing-footer .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .lesson-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .action-cards { grid-template-columns: 1fr; gap: 40px; }
  .footer-columns { flex-direction: column; gap: 40px; }
  .app-footer .footer-inner { flex-direction: column; align-items: flex-start; gap: 40px; }
  .lesson-grid { grid-template-columns: repeat(2, 1fr); }
  .name-row { flex-direction: column; gap: 16px; }
  .name-row .field { width: 100%; }
  .auth-form { padding: 32px 24px; }
}
