@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:ROND,opsz,wght@0..100,8..144,100..1000&display=swap');

:root {
  /* System Colors (Light Mode) from ColorGrid.swift & Spec Chart */
  --system-red:    rgb(255, 56, 60);
  --system-orange: rgb(255, 141, 40);
  --system-yellow: rgb(255, 204, 0);
  --system-green:  rgb(52, 199, 89);
  --system-teal:   rgb(0, 195, 208);
  --system-blue:   rgb(0, 136, 255);
  --system-indigo: rgb(97, 85, 245);
  --system-purple: rgb(203, 48, 224);
  --system-pink:   rgb(255, 45, 85);

  /* Feature Title Gradients (Light Mode: Default Dark [Col 4] -> Increased Contrast Light [Col 5]) */
  --feature-red-top:      rgb(255, 66, 69);
  --feature-red-bottom:   rgb(233, 21, 45);

  --feature-green-top:    rgb(48, 209, 88);
  --feature-green-bottom: rgb(0, 137, 50);

  --feature-blue-top:     rgb(0, 145, 255);
  --feature-blue-bottom:  rgb(30, 110, 244);

  --feature-indigo-top:   rgb(109, 124, 255);
  --feature-indigo-bottom: rgb(86, 74, 222);

  --feature-purple-top:   rgb(219, 52, 242);
  --feature-purple-bottom: rgb(176, 47, 194);

  /* Theme Defaults (Light Mode) */
  --background: #FFFFFF;
  --secondary-background: #F5F5F7;
  --tertiary-background: #E8E8ED;
  --label: #1D1D1F;
  --secondary-label: #86868B;
  --tertiary-label: #AEAEB2;
  --border: rgba(0, 0, 0, 0.1);
  --header-bg: rgba(255, 255, 255, 0.8);
  --card-bg: #FFFFFF;
  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  
  --font-family: 'Google Sans Flex', ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* System Colors (Dark Mode) from ColorGrid.swift & Spec Chart */
    --system-red:    rgb(255, 66, 69);
    --system-orange: rgb(255, 146, 48);
    --system-yellow: rgb(255, 214, 0);
    --system-green:  rgb(48, 209, 88);
    --system-teal:   rgb(0, 210, 224);
    --system-blue:   rgb(0, 145, 255);
    --system-indigo: rgb(109, 124, 255);
    --system-purple: rgb(219, 52, 242);
    --system-pink:   rgb(255, 55, 95);

    /* Feature Title Gradients (Dark Mode: Default Light [Col 3] -> Increased Contrast Dark [Col 6]) */
    --feature-red-top:      rgb(255, 56, 60);
    --feature-red-bottom:   rgb(255, 97, 101);

    --feature-green-top:    rgb(52, 199, 89);
    --feature-green-bottom: rgb(74, 217, 104);

    --feature-blue-top:     rgb(0, 136, 255);
    --feature-blue-bottom:  rgb(92, 184, 255);

    --feature-indigo-top:   rgb(97, 85, 245);
    --feature-indigo-bottom: rgb(167, 170, 255);

    --feature-purple-top:   rgb(203, 48, 224);
    --feature-purple-bottom: rgb(234, 141, 255);

    /* Theme Defaults (Dark Mode) */
    --background: #000000;
    --secondary-background: #1C1C1E;
    --tertiary-background: #2C2C2E;
    --label: #F5F5F7;
    --secondary-label: #86868B;
    --tertiary-label: #48484A;
    --border: rgba(255, 255, 255, 0.1);
    --header-bg: rgba(0, 0, 0, 0.8);
    --card-bg: #1C1C1E;
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body, button, input, select, textarea, h1, h2, h3, h4, h5, h6, a, p, span, div, li {
  font-family: var(--font-family);
  font-variation-settings: 'ROND' 100;
}

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--label);
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Header & Nav */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background-color: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

.nav-container {
  width: 100%;
  max-width: 1024px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--label);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.03em;
  gap: 10px;
}

/* 3x3 Grid Logo Tiny */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 24px;
  height: 24px;
  gap: 2px;
  border-radius: 6px;
  overflow: hidden;
}

.logo-grid span {
  width: 100%;
  height: 100%;
}

.c-red    { background-color: var(--system-red); }
.c-orange { background-color: var(--system-orange); }
.c-yellow { background-color: var(--system-yellow); }
.c-green  { background-color: var(--system-green); }
.c-teal   { background-color: var(--system-teal); }
.c-blue   { background-color: var(--system-blue); }
.c-indigo { background-color: var(--system-indigo); }
.c-purple { background-color: var(--system-purple); }
.c-pink   { background-color: var(--system-pink); }

nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

nav a {
  text-decoration: none;
  color: var(--secondary-label);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

nav a:hover, nav a.active {
  color: var(--label);
}

/* Hero Section */
.hero {
  padding-top: 140px;
  padding-bottom: 80px;
  text-align: center;
  background: radial-gradient(circle at 50% 30%, rgba(88, 86, 214, 0.08) 0%, transparent 60%);
}

.hero-tagline {
  font-size: 17px;
  font-weight: 600;
  color: var(--system-indigo);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.07143;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 21px;
  font-weight: 400;
  color: var(--secondary-label);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.381;
}

.cta-group {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--system-blue);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: #0066CC;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--secondary-background);
  color: var(--system-blue);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--tertiary-background);
  transform: translateY(-1px);
}

/* Main Container */
main {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 48px;
}

/* Feature Grid & Showcase Rows (1024px Alternating Side-by-Side) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.showcase-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.showcase-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 60px 0;
  gap: 40px;
  position: relative;
}

.showcase-row:nth-child(even) {
  flex-direction: row-reverse;
}

/* Full-width screen-spanning horizontal divider bar */
.showcase-row:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100vw;
  height: 1px;
  background-color: var(--border);
  transform: translateX(-50%);
}

.showcase-content {
  flex: 1 1 50%;
  width: 50%;
  text-align: left;
}

.showcase-content h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
}

/* Title Vertical Gradient Rules */
.title-gradient {
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.title-red {
  background-image: linear-gradient(180deg, var(--feature-red-top) 0%, var(--feature-red-bottom) 100%);
}

.title-green {
  background-image: linear-gradient(180deg, var(--feature-green-top) 0%, var(--feature-green-bottom) 100%);
}

.title-blue {
  background-image: linear-gradient(180deg, var(--feature-blue-top) 0%, var(--feature-blue-bottom) 100%);
}

.title-indigo {
  background-image: linear-gradient(180deg, var(--feature-indigo-top) 0%, var(--feature-indigo-bottom) 100%);
}

.title-purple {
  background-image: linear-gradient(180deg, var(--feature-purple-top) 0%, var(--feature-purple-bottom) 100%);
}

.showcase-content p {
  color: var(--secondary-label);
  font-size: 18px;
  line-height: 1.48;
}

.showcase-media {
  flex: 1 1 50%;
  width: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.showcase-media img {
  width: 100%;
  max-width: 280px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.14));
}

.feature-card {
  background-color: var(--card-bg);
  border-radius: 18px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 20px;
  display: inline-block;
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--secondary-label);
  font-size: 15px;
  line-height: 1.47;
}

/* About / Team Section */
.about-intro {
  max-width: 760px;
  margin: 0 auto 60px;
  text-align: left;
  font-size: 19px;
  line-height: 1.6;
  color: var(--secondary-label);
}

.about-intro p {
  margin-bottom: 24px;
}

.about-intro p:last-child {
  margin-bottom: 0;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.team-grid.single-member {
  max-width: 540px;
  margin: 40px auto 0;
  grid-template-columns: 1fr;
}

.team-card {
  text-align: center;
  padding: 36px 28px;
  background-color: var(--card-bg);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.team-avatar-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 24px;
  color: #FFFFFF;
}

.team-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.team-role {
  color: var(--system-indigo);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.team-bio {
  font-size: 14px;
  color: var(--secondary-label);
  line-height: 1.4;
}

/* Contact / Forms */
.contact-container {
  max-width: 500px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary-label);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--secondary-background);
  color: var(--label);
  font-family: var(--font-family);
  font-size: 15px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--system-blue);
  background-color: var(--background);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.alert-box {
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  display: none;
}

.alert-success {
  background-color: rgba(52, 199, 89, 0.15);
  color: var(--system-green);
  border: 1px solid rgba(52, 199, 89, 0.3);
}

/* Terms & Legal */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

.legal-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 16px;
}

.legal-content p {
  color: var(--secondary-label);
  margin-bottom: 16px;
}

.legal-content ul {
  padding-left: 20px;
  margin-bottom: 16px;
  color: var(--secondary-label);
}

.legal-content li {
  margin-bottom: 8px;
}

/* Tic-Tac-Toe Game Footer */
.logo-game-section {
  text-align: center;
  padding: 40px 0;
  margin: 40px 0;
}

.logo-game-section h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.logo-game-subtitle {
  font-size: 15px;
  color: var(--secondary-label);
  margin-bottom: 32px;
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 270px;
  height: 270px;
  gap: 8px;
  margin: 0 auto 24px;
}

.ttt-cell {
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
  user-select: none;
}

.ttt-cell:hover:not(.taken) {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.ttt-cell.taken {
  cursor: not-allowed;
}

/* Style cell states */
.ttt-cell span {
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.game-status {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 20px;
  height: 24px;
}

/* Footer style */
footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--border);
  color: var(--secondary-label);
  font-size: 13px;
}

.footer-links {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.footer-links a {
  color: var(--secondary-label);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--label);
}

/* Responsive */
@media (max-width: 860px) {
  main {
    max-width: 100%;
    padding: 0 16px;
  }
  .showcase-row,
  .showcase-row:nth-child(even) {
    flex-direction: column-reverse;
    padding: 40px 24px;
    text-align: center;
    gap: 32px;
  }
  .showcase-content,
  .showcase-media {
    flex: initial;
    width: 100%;
    padding: 0;
  }
  .showcase-content {
    text-align: center;
  }
  .showcase-content h2 {
    font-size: 26px;
  }
  .showcase-content p {
    font-size: 16px;
  }
  .showcase-media img {
    max-width: 240px;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 40px;
  }
  .hero-subtitle {
    font-size: 18px;
  }
  nav ul {
    gap: 12px;
  }
}
