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

:root {
  /* System Colors */
  --system-red: #FF3B30;
  --system-orange: #FF9500;
  --system-yellow: #FFCC00;
  --system-green: #34C759;
  --system-teal: #30B0C7;
  --system-blue: #007AFF;
  --system-indigo: #5856D6;
  --system-purple: #AF52DE;
  --system-pink: #FF2D55;

  /* 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', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* System Dark Colors */
    --system-red: #FF453A;
    --system-orange: #FF9F0A;
    --system-yellow: #FFD60A;
    --system-green: #30D158;
    --system-teal: #40C8E0;
    --system-blue: #0A84FF;
    --system-indigo: #5E5CE6;
    --system-purple: #BF5AF2;
    --system-pink: #FF375F;

    /* 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;
}

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: 80px 0;
  border-top: 1px solid var(--border);
}

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

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

.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: 720px;
  margin: 0 auto 60px;
  text-align: center;
  font-size: 19px;
  line-height: 1.5;
  color: var(--secondary-label);
}

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

.team-card {
  text-align: center;
  padding: 32px 24px;
  background-color: var(--card-bg);
  border-radius: 18px;
  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;
  background-color: var(--secondary-background);
  border-radius: 28px;
  padding: 60px 20px;
  margin: 60px 0;
  border: 1px solid var(--border);
}

.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: 768px) {
  .hero h1 {
    font-size: 40px;
  }
  .hero-subtitle {
    font-size: 18px;
  }
  nav ul {
    gap: 12px;
  }
}
