/* PicTris landing — main styles */

:root[data-theme="light"] {
  --bg-gradient-start: #7eb8e8;
  --bg-gradient-mid: #e8a0b8;
  --bg-gradient-end: #f5c896;
  --text-color: #1a1a2e;
  --text-muted: #4a4a6a;
  --heading-color: #0d1b3e;
  --link-color: #08296c;
  --link-hover: #0a3d8f;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-border: rgba(255, 255, 255, 0.6);
  --header-bg: rgba(255, 255, 255, 0.88);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --accent-purple: #7b3ff2;
  --accent-cyan: #00bcd4;
  --accent-orange: #ff9800;
  --focus-ring: #2196f3;
}

:root[data-theme="dark"] {
  --bg-gradient-start: #1a2a4a;
  --bg-gradient-mid: #3d1f3d;
  --bg-gradient-end: #2a1a10;
  --text-color: #f0f0f5;
  --text-muted: #b0b0c8;
  --heading-color: #ffffff;
  --link-color: #90caf9;
  --link-hover: #bbdefb;
  --surface: rgba(20, 20, 40, 0.75);
  --surface-solid: #1a1a2e;
  --surface-border: rgba(255, 255, 255, 0.12);
  --header-bg: rgba(10, 10, 30, 0.88);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --accent-purple: #9d6ff7;
  --accent-cyan: #26c6da;
  --accent-orange: #ffb74d;
  --focus-ring: #64b5f6;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-color);
  background: linear-gradient(160deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 45%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link-color);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--heading-color);
  font-weight: 700;
  font-size: 1.15rem;
}

.logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.nav-links a:hover {
  background: var(--surface);
  color: var(--link-color);
}

.header-cta .app-store-badge {
  height: 36px;
  width: auto;
}

/* App Store badge theme toggle */
.app-store-badge {
  transition: opacity 0.2s ease;
}

:root[data-theme="light"] .light-badge { display: inline-block; }
:root[data-theme="light"] .dark-badge { display: none; }
:root[data-theme="dark"] .light-badge { display: none; }
:root[data-theme="dark"] .dark-badge { display: inline-block; }

/* Layout */
main {
  padding-top: 60px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 72px 0;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--heading-color);
  text-align: center;
  margin: 0 0 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 48px;
  font-size: 1.05rem;
}

/* Hero */
.hero {
  padding: 80px 0 64px;
}

.hero-centered {
  text-align: center;
  max-width: 640px;
}

.hero-centered h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--heading-color);
  margin: 0 0 20px;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 auto 32px;
  max-width: 520px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.hero-badges .app-store-badge {
  height: 48px;
}

/* Video + What's new layout */
.video-whats-new-section {
  padding: 72px 0;
}

.layout-table {
  width: 100%;
  border-collapse: collapse;
  border: none;
}

.layout-table td {
  border: none;
  padding: 0;
  vertical-align: top;
}

.layout-col-video {
  width: 38%;
  padding-right: 32px;
}

.layout-col-whats-new {
  width: 62%;
  padding-left: 32px;
}

.layout-col-video .section-title,
.layout-col-whats-new .section-title {
  text-align: left;
}

.layout-col-video .section-subtitle {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 24px;
  max-width: none;
}

.video-wrapper {
  max-width: 300px;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #111;
  position: relative;
}

.video-wrapper video {
  width: 100%;
  display: block;
  height: auto;
  object-fit: contain;
  background: #111;
  vertical-align: middle;
}

.video-unmute-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.video-unmute-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}

.whats-new-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

/* Play modes */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.mode-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.mode-card:hover {
  transform: translateY(-4px);
}

.mode-card picture,
.mode-card img {
  width: 100%;
}

.mode-card-body {
  padding: 20px;
}

.mode-card h3 {
  font-size: 1.1rem;
  color: var(--heading-color);
  margin: 0 0 8px;
}

.mode-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

.mode-badge {
  display: inline-block;
  background: var(--accent-purple);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 8px;
}

/* What's new cards */
.whats-new-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.whats-new-lead {
  font-size: 0.95rem;
  color: var(--text-color);
  margin: 0 0 12px;
}

.whats-new-card ul {
  margin: 0;
  padding-left: 1.25rem;
}

.whats-new-card li {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.whats-new-card li:last-child {
  margin-bottom: 0;
}

.whats-new-footnote {
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* How to play */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.control-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.control-gesture {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--accent-purple);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
}

.control-card h3 {
  font-size: 1rem;
  color: var(--heading-color);
  margin: 0 0 8px;
}

.control-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.controls-tips {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow: var(--shadow);
}

.controls-tips h3 {
  font-size: 1rem;
  color: var(--heading-color);
  margin: 0 0 12px;
}

.controls-tips ul {
  margin: 0;
  padding-left: 1.25rem;
}

.controls-tips li {
  font-size: 0.95rem;
  color: var(--text-color);
  margin-bottom: 8px;
}

.controls-tips li:last-child {
  margin-bottom: 0;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 12px;
  line-height: 1;
}

.feature-card h3 {
  font-size: 1rem;
  color: var(--heading-color);
  margin: 0 0 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Use cases */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.use-case-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.use-case-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  line-height: 1;
}

.use-case-card h3 {
  font-size: 1.15rem;
  color: var(--heading-color);
  margin: 0 0 12px;
}

.use-case-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.use-case-card .privacy-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.95rem;
}

/* Pro section */
.pro-section {
  padding: 72px 0;
}

.pro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.pro-visual img {
  border-radius: 12px;
  max-width: 320px;
  margin: 0 auto;
}

.pro-content h2 {
  font-size: 1.75rem;
  color: var(--heading-color);
  margin: 0 0 16px;
}

.pro-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.pro-list li {
  padding: 8px 0 8px 28px;
  position: relative;
  color: var(--text-color);
}

.pro-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
  font-weight: 700;
}

.pro-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Privacy teaser */
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.privacy-item {
  text-align: center;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 24px 16px;
  box-shadow: var(--shadow);
}

.privacy-item .icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.privacy-item h3 {
  font-size: 0.95rem;
  color: var(--heading-color);
  margin: 0 0 4px;
}

.privacy-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.privacy-link {
  text-align: center;
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
}

/* Footer */
.site-footer {
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--surface-border);
  padding: 32px 0;
  margin-top: 32px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Subpages (privacy, about) */
.page-content {
  max-width: 800px;
  margin: 40px auto;
  padding: 32px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.page-content h1 {
  color: var(--heading-color);
  margin-top: 0;
}

.page-content h2 {
  color: var(--heading-color);
  margin-top: 32px;
}

.page-content h3 {
  color: var(--heading-color);
}

.page-content .date {
  color: var(--text-muted);
  font-style: italic;
}

.page-content ul {
  padding-left: 1.25rem;
  margin: 0 0 16px;
}

.page-content li {
  margin-bottom: 6px;
  color: var(--text-color);
}

.tip-section {
  margin-top: 40px;
  padding-top: 8px;
  border-top: 1px solid var(--surface-border);
}

.tip-section:first-of-type {
  margin-top: 24px;
  border-top: none;
  padding-top: 0;
}

.tip-section .video-wrapper {
  margin: 24px auto;
}

.tip-video-caption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -8px 0 24px;
}

.tip-code {
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 0 0 16px;
}

.tip-footer-link {
  margin-top: 32px;
}

.bot-cta {
  display: inline-block;
  margin: 4px 0 16px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  background: #2aabee;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, transform 0.15s ease;
}

.bot-cta:hover {
  color: #fff;
  background: #229ed9;
  transform: translateY(-1px);
}

.use-case-card .privacy-link + .privacy-link {
  margin-left: 16px;
}

.page-hero-img {
  border-radius: 12px;
  margin: 0 auto 24px;
  max-width: 300px;
}

/* FAQ */
.faq-list {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  overflow: hidden;
}

.faq-question {
  padding: 16px 20px;
  font-weight: 600;
  color: var(--heading-color);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  content: "−";
}

.faq-answer {
  padding: 0 20px 16px;
  color: var(--text-color);
}

.faq-answer p {
  margin: 0 0 12px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ol,
.faq-answer ul {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}

.faq-answer li {
  margin-bottom: 6px;
}

.faq-answer code {
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  padding: 1px 6px;
}

.tech-stack {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-stack li {
  background: var(--surface-solid);
  border: 1px solid var(--surface-border);
  padding: 5px 15px;
  border-radius: 15px;
  font-size: 0.9rem;
}

.developer-cat {
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.developer-cat:hover {
  transform: scale(1.02);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-color);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  border-radius: 2px;
}

/* Responsive */
@media (max-width: 900px) {
  .layout-table,
  .layout-table tbody,
  .layout-table tr,
  .layout-table td {
    display: block;
    width: 100%;
  }

  .layout-col-video,
  .layout-col-whats-new {
    width: 100%;
    padding: 0;
  }

  .layout-col-whats-new {
    margin-top: 48px;
  }

  .layout-col-video .video-wrapper {
    margin: 0 auto;
  }

  .controls-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modes-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .use-cases-grid {
    grid-template-columns: 1fr;
  }

  .pro-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .privacy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    padding: 16px;
    border-bottom: 1px solid var(--surface-border);
  }

  .nav-links.open {
    display: flex;
  }

  .header-cta {
    display: none;
  }

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

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

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

  .section {
    padding: 48px 0;
  }

  .pro-grid {
    padding: 24px;
  }
}
