:root {
  color-scheme: light;
  --ink: #10233d;
  --muted: rgba(16, 35, 61, 0.68);
  --paper: #f8f7f2;
  --paper-2: #eef2f5;
  --line: rgba(16, 35, 61, 0.1);
  --accent: #0d6efd;
  --accent-2: #14a38b;
  --shadow: 0 24px 80px rgba(16, 35, 61, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(20, 163, 139, 0.12), transparent 34%),
    linear-gradient(180deg, #fbfbf8 0%, #eef4f6 100%);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

body {
  overflow-x: hidden;
}

.page-shell {
  position: relative;
  height: 100vh;
  width: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  padding: clamp(0.5rem, 1.6vw, 1rem);
  border: 10px solid #c89a66;
  border-radius: 20px;
  background:
    radial-gradient(circle at 12% 16%, rgba(56, 97, 130, 0.08), transparent 22%),
    radial-gradient(circle at 86% 74%, rgba(40, 76, 104, 0.07), transparent 26%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.99), rgba(245, 248, 251, 0.97));
  box-shadow:
    inset 0 0 0 4px rgba(142, 98, 53, 0.28),
    inset 0 -8px 24px rgba(13, 30, 44, 0.07),
    0 30px 70px rgba(12, 26, 39, 0.16);
}

.center-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(6.5rem, 14vw, 10rem);
  height: clamp(6.5rem, 14vw, 10rem);
  border-radius: 16px;
  border: 3px solid rgba(26, 58, 84, 0.16);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 12px 32px rgba(17, 38, 57, 0.15);
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease;
}

.center-logo.is-visible {
  opacity: 1;
  visibility: visible;
}

.center-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 14px;
}

.whiteboard-content {
  position: relative;
  min-height: 0;
  overflow: hidden;
  z-index: 1;
}

.tab-panel {
  position: absolute;
  inset: 0;
  display: none !important;
  min-height: 0;
}

.tab-panel.is-active {
  display: block !important;
}

.game-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem 4.75rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero::before {
  inset: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(31, 57, 79, 0.075) 0,
      rgba(31, 57, 79, 0.075) 2px,
      transparent 2px,
      transparent 60px
    );
  opacity: 0.34;
}

.hero::after {
  width: 40%;
  height: 60%;
  top: -8%;
  left: -6%;
  transform: rotate(-8deg);
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.45), transparent 68%);
}

.math-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
  font-size: clamp(1rem, 2vw, 1.8rem);
  color: rgba(23, 65, 96, 0.26);
}

.math-veil span {
  position: absolute;
  font-style: italic;
  animation: drift 18s linear infinite;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.math-veil .equation {
  letter-spacing: 0.02em;
}

.math-veil .code-line {
  font-style: normal;
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(0.72rem, 1.2vw, 1rem);
  color: rgba(20, 54, 82, 0.3);
}

.math-veil span:nth-child(1) { top: 7%; left: 8%; transform: rotate(-5deg); }
.math-veil span:nth-child(2) { top: 14%; right: 11%; transform: rotate(4deg); animation-delay: -4s; }
.math-veil span:nth-child(3) { bottom: 27%; left: 9%; transform: rotate(-8deg); animation-delay: -8s; }
.math-veil span:nth-child(4) { bottom: 10%; right: 8%; transform: rotate(6deg); animation-delay: -11s; }
.math-veil span:nth-child(5) { top: 54%; left: 20%; transform: rotate(-3deg); animation-delay: -14s; }
.math-veil span:nth-child(6) { top: 66%; right: 22%; transform: rotate(7deg); animation-delay: -2s; }
.math-veil span:nth-child(7) { top: 20%; left: 30%; transform: rotate(-6deg); animation-delay: -7s; }
.math-veil span:nth-child(8) { top: 30%; right: 20%; transform: rotate(5deg); animation-delay: -10s; }
.math-veil span:nth-child(9) { top: 40%; left: 56%; transform: rotate(-4deg); animation-delay: -5s; }
.math-veil span:nth-child(10) { bottom: 30%; right: 36%; transform: rotate(3deg); animation-delay: -13s; }
.math-veil span:nth-child(11) { top: 74%; left: 12%; transform: rotate(-7deg); animation-delay: -9s; }
.math-veil span:nth-child(12) { top: 9%; left: 45%; transform: rotate(4deg); animation-delay: -12s; }
.math-veil span:nth-child(13) { bottom: 14%; left: 40%; transform: rotate(-5deg); animation-delay: -6s; }
.math-veil span:nth-child(14) { top: 25%; left: 6%; transform: rotate(-2deg); animation-delay: -15s; }
.math-veil span:nth-child(15) { bottom: 22%; right: 12%; transform: rotate(2deg); animation-delay: -3s; }
.math-veil span:nth-child(16) { top: 78%; right: 26%; transform: rotate(-3deg); animation-delay: -1s; }

.logo-block {
  position: relative;
  text-align: center;
  max-width: 44rem;
  padding: 1rem;
  z-index: 2;
}

.logo-mark {
  width: clamp(8rem, 20vw, 12rem);
  height: clamp(8rem, 20vw, 12rem);
  margin: 0 auto;
  border-radius: 18px;
  border: 3px solid rgba(26, 58, 84, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.7);
  box-shadow:
    0 14px 28px rgba(17, 38, 57, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.logo-zero,
.logo-infinity {
  display: inline-block;
  line-height: 1;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-weight: 700;
}

.logo-zero {
  font-size: 2rem;
  transform: translateY(-0.05em);
}

.logo-infinity {
  font-size: 2.15rem;
  transform: translateY(0.06em);
}

.logo-block h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.logo-block p {
  margin: 0.8rem 0 0;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.intro-text {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
}

.intro-text h1 {
  margin: 0;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  color: rgba(20, 58, 89, 0.86);
}

.intro-text p {
  margin: 0.3rem 0 0;
  font-family: "Bradley Hand", "Comic Sans MS", "Segoe Print", cursive;
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  color: rgba(28, 64, 92, 0.8);
}

.about-section {
  height: 100%;
  overflow-y: auto;
  padding: 1.4rem 0 1.8rem;
  background: transparent;
  border-top: 0;
}

.hero.tab-panel.is-active,
.game-panel.tab-panel.is-active {
  display: grid !important;
}

.whiteboard-toolbar {
  position: relative;
  display: grid;
  place-items: end center;
  padding: 0.2rem 0;
  z-index: 4;
}

.whiteboard-toolbar.is-home {
  padding-top: 2.8rem;
}

.global-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  z-index: 4;
}

.global-footer > * {
  min-width: 0;
}

.footer-legal {
  display: grid;
  gap: 0.2rem;
  width: fit-content;
  justify-self: center;
  text-align: left;
}

.tab-strip {
  width: min(52rem, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.board-tab {
  appearance: none;
  border: 1px solid rgba(24, 60, 90, 0.22);
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(231, 239, 246, 0.88));
  color: rgba(15, 47, 73, 0.9);
  text-transform: lowercase;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.board-tab:hover {
  transform: translateY(-2px);
}

.board-tab.is-active {
  background: linear-gradient(180deg, rgba(224, 239, 252, 0.95), rgba(197, 225, 247, 0.95));
  box-shadow: 0 10px 18px rgba(21, 53, 80, 0.16);
}

.eraser {
  position: absolute;
  z-index: 2;
  top: 0.45rem;
  width: clamp(5.8rem, 14vw, 8rem);
  height: clamp(2rem, 4.2vw, 2.6rem);
  border-radius: 8px;
  background: linear-gradient(135deg, #f7ecdf 0%, #d7c9b8 48%, #b49d86 100%);
  border: 1px solid rgba(90, 66, 45, 0.3);
  box-shadow: 0 8px 14px rgba(56, 33, 17, 0.24);
  opacity: 0;
  visibility: hidden;
}

.whiteboard-toolbar.is-home .eraser {
  opacity: 1;
  visibility: visible;
}

.eraser::before {
  content: "";
  position: absolute;
  inset: 0.22rem auto 0.22rem 0.28rem;
  width: 38%;
  border-radius: 6px;
  background: rgba(246, 248, 250, 0.8);
}

.intro-card {
  position: absolute;
  top: 5.6rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 48rem;
  width: min(48rem, calc(100% - 2rem));
  padding: 1.25rem 1.25rem 1rem;
  border-radius: 22px;
  border: 1px solid rgba(16, 35, 61, 0.12);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(6px);
  z-index: 5;
}

.intro-card.hidden {
  display: none;
}

.intro-card h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.intro-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 62ch;
}

.intro-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.intro-actions button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.25rem;
  font: inherit;
  color: white;
  background: linear-gradient(135deg, var(--accent), #083d8c);
  box-shadow: 0 12px 28px rgba(13, 110, 253, 0.24);
  cursor: pointer;
}

.intro-actions button:hover {
  transform: translateY(-1px);
}

.tip {
  color: var(--muted);
  font-family: "Trebuchet MS", sans-serif;
}

.game-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  scroll-margin-top: 0.8rem;
  position: relative;
}

.game-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(9, 20, 32, 0.24);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s ease;
  z-index: 4;
}

.game-panel.active {
  box-shadow: 0 30px 90px rgba(16, 35, 61, 0.18);
}

.game-panel.active::before {
  opacity: 0;
}

.hud,
.footer-strip {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: rgba(248, 247, 242, 0.78);
  border-bottom: 1px solid rgba(16, 35, 61, 0.08);
  font-family: "Trebuchet MS", sans-serif;
}

.footer-strip {
  border-bottom: 0;
  border-top: 1px solid rgba(16, 35, 61, 0.08);
  color: var(--muted);
  font-size: 0.95rem;
  align-items: flex-start;
}

.footer-brand,
.footer-contact {
  display: grid;
  gap: 0.2rem;
}

.footer-brand strong,
.footer-contact span {
  color: var(--ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.footer-brand span {
  max-width: 34rem;
}

.footer-contact a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-word;
}

.footer-contact a:hover {
  text-decoration: underline;
}

.hud > div {
  display: grid;
  gap: 0.15rem;
}

.hud-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud strong {
  font-size: 1.3rem;
  letter-spacing: 0.12em;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: block;
  background:
    radial-gradient(circle at 20% 20%, rgba(13, 110, 253, 0.11), transparent 28%),
    radial-gradient(circle at 80% 70%, rgba(20, 163, 139, 0.14), transparent 26%),
    linear-gradient(180deg, #eff6f9 0%, #dfeaf0 100%);
}

.game-controls-hint {
  padding: 0.65rem 1rem 0.9rem;
  text-align: right;
  color: var(--muted);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  border-top: 1px solid rgba(16, 35, 61, 0.08);
  background: rgba(248, 247, 242, 0.55);
}

.controls {
  text-align: right;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  50% {
    transform: translate3d(24px, -18px, 0) rotate(6deg);
  }
}

/* About Section Styles */

.about-container {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
}

.about-block {
  width: 100%;
  padding: 0 1.2rem;
  margin-bottom: 2rem;
}

.about-block h2 {
  margin: 0 0 1.2rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--ink);
  letter-spacing: 0.02em;
}

.about-block h3 {
  margin: 1rem 0 0.6rem;
  font-size: 1.1rem;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  max-width: 100%;
}

.about-block p {
  margin: 0.9rem 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 100%; 
}

.about-block ul {
  margin: 0.8rem 0;
  padding-left: 1.4rem;
  color: var(--muted);
  line-height: 1.8;
}

.about-block ul li {
  margin-bottom: 0.4rem;
}

.founder-link {
  background: rgba(13, 110, 253, 0.08);
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border-left: 3px solid var(--accent);
  margin: 1.2rem 0;
}

.founder-link a {
  color: var(--accent);
  text-decoration: none;
}

.founder-link a:hover {
  text-decoration: underline;
}

.service-tagline {
  margin-top: 1.4rem;
  font-size: 1.05rem;
  color: var(--ink);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.2rem;
  margin: 1.4rem 0;
}

.service-card {
  padding: 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
}

.service-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
  color: var(--ink);
}

.service-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.service-card ul li {
  font-size: 0.95rem;
}

.philosophy-block {
  margin-bottom: 2rem;
}

.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1.4rem;
  margin-top: 1.2rem;
}

.phil-card {
  padding: 1.6rem;
  border-radius: 18px;
  border: 2px solid var(--accent-2);
  background: linear-gradient(135deg, rgba(20, 163, 139, 0.08), rgba(13, 110, 253, 0.06));
  text-align: center;
}

.phil-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1.3rem;
  color: var(--accent-2);
}

.phil-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.link-item {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.link-item strong {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.link-item a {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  word-break: break-word;
  margin-bottom: 0.4rem;
}

.link-item a:hover {
  text-decoration: underline;
}

.tech-stack {
  background: rgba(248, 247, 242, 0.8);
  padding: 1.6rem;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.tech-category {
  margin-bottom: 1.8rem;
}

.tech-category:last-child {
  margin-bottom: 0;
}

.tech-category h3 {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.7rem;
}

.badge {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(13, 110, 253, 0.3);
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.12), rgba(20, 163, 139, 0.08));
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.03em;
}

.section-divider {
  margin: 2rem 0;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16, 35, 61, 0.2), transparent);
}

@media (max-width: 720px) {
  .page-shell {
    padding: 0.35rem;
    border-width: 7px;
  }

  .center-logo {
    width: clamp(5.2rem, 18vw, 7.2rem);
    height: clamp(5.2rem, 18vw, 7.2rem);
  }

  .hero {
    padding: 2rem 1rem 3.6rem;
  }

  .logo-mark {
    width: clamp(7rem, 34vw, 9rem);
    height: clamp(7rem, 34vw, 9rem);
  }

  .intro-text {
    bottom: 0.8rem;
  }

  .whiteboard-toolbar {
    padding-top: 0.15rem;
  }

  .whiteboard-toolbar.is-home {
    padding-top: 2.45rem;
  }

  .intro-card {
    top: 4.9rem;
    width: calc(100% - 1rem);
  }

  .tab-strip {
    gap: 0.35rem;
  }

  .board-tab {
    font-size: 0.76rem;
    letter-spacing: 0.03em;
    padding: 0.55rem 0.45rem;
  }

  .about-section {
    padding: 0.8rem 0 1.1rem;
  }

  .hud,
  .footer-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-strip {
    gap: 0.85rem;
  }

  .global-footer {
    grid-template-columns: 1fr;
  }

  .controls {
    text-align: left;
  }

  .game-controls-hint {
    text-align: left;
  }

  #gameCanvas {
    min-height: 200px;
  }

  .about-section {
    padding: 0.8rem 0 1.1rem;
  }

  .about-container {
    max-width: 100%;
  }

  .about-block {
    padding: 0;
  }

  .services-grid,
  .tech-category .badge-grid {
    grid-template-columns: 1fr;
  }

  .philosophy-grid {
    grid-template-columns: 1fr;
  }

  .links-grid {
    grid-template-columns: 1fr;
  }
}