:root {
  --bg: #ffffff;
  --text: #000000;
  --text-dim: #555555;
  --accent: #0069ff;
  --border: #000000;
  --max-width: 880px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --text: #ffffff;
    --text-dim: #aaaaaa;
    --accent: #0069ff;
    --border: #ffffff;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --text: #ffffff;
  --text-dim: #aaaaaa;
  --accent: #0069ff;
  --border: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

section,
footer {
  scroll-margin-top: 76px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.topbar-brand {
  display: inline-block;
  line-height: 0;
}

.topbar-logo {
  height: 28px;
  width: auto;
}

.topbar-links {
  display: flex;
  gap: 24px;
}

.topbar-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.topbar-links a:hover {
  color: var(--accent);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.burger,
.burger::before,
.burger::after {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.burger {
  position: relative;
  display: block;
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
  transition: transform 0.2s ease;
}

.burger::before {
  top: -7px;
}

.burger::after {
  top: 7px;
}

.menu-toggle[aria-expanded="true"] .burger {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .burger::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .burger::after {
  top: 0;
  transform: rotate(-45deg);
}

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

  .topbar-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 4px 20px 12px;
  }

  .topbar-links.is-open {
    display: flex;
  }

  .topbar-links a {
    padding: 12px 0;
    border-top: 1px solid var(--border);
  }

  .topbar-links a:first-child {
    border-top: none;
  }
}

.hero {
  text-align: center;
}

.hero-top {
  padding: 20px 20px 24px;
}

.hero-bottom {
  padding: 24px 20px 56px;
}

.brand {
  margin: 0;
}

.brand a {
  display: inline-block;
}

.logo {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.logo-light {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-dark {
    display: none;
  }
  :root:not([data-theme="light"]) .logo-light {
    display: block;
  }
}

:root[data-theme="dark"] .logo-dark {
  display: none;
}

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

.tagline {
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 700;
  margin: 0 0 20px;
}

.subtext {
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 32px;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 700;
  transition: opacity 0.15s ease;
}

.button:hover {
  opacity: 0.85;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 12px 24px;
}

main {
  padding: 48px 0;
}

section + section {
  margin-top: 48px;
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 24px;
  text-align: center;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.card p {
  color: var(--text-dim);
  margin-bottom: 16px;
}

.card.product {
  text-align: left;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.app-icon {
  width: 64px;
  height: 64px;
  border-radius: 22%;
  flex-shrink: 0;
}

.app-info {
  flex: 1;
  min-width: 0;
}

.app-meta {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 16px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 28px;
}

.video-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.video-card__thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
  margin-bottom: 12px;
}

.video-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform 0.3s ease;
}

.video-card:hover .video-card__thumb {
  transform: scale(1.03);
}

.video-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  transition: opacity 0.2s ease;
}

.video-card:hover .video-card__play {
  opacity: 1;
}

.video-card__play svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.card .video-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 0 0 6px;
}

.card .video-card__date {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
}

.youtube-more {
  text-align: center;
  margin-top: 24px;
}

.blog-more {
  text-align: center;
  margin-top: 24px;
}

@media (max-width: 700px) {
  .video-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
}

footer {
  text-align: center;
  color: var(--text-dim);
}

footer .container {
  padding-top: 32px;
  padding-bottom: 48px;
}

footer a {
  color: var(--text-dim);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent);
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.social-icon svg {
  width: 22px;
  height: 22px;
}

.social-icon:hover {
  color: var(--accent);
}

.social-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
}

.copyright {
  font-size: 0.85rem;
  margin-top: 8px;
}

@media (max-width: 480px) {
  .hero-top {
    padding: 12px 16px 20px;
  }

  .hero-bottom {
    padding: 20px 16px 40px;
  }

  .logo {
    max-width: 240px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  main {
    padding: 40px 0;
  }

  section + section {
    margin-top: 40px;
  }

  .card.product {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Blog + product detail pages */

.page-hero {
  padding: 48px 20px 32px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-hero .wip-badge {
  margin-bottom: 14px;
}

.page-hero h1 {
  font-size: 1.9rem;
  margin: 0 0 10px;
}

.page-hero .page-meta {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.page-hero .subtext {
  margin-top: 16px;
}

.back-link-row {
  padding: 20px 20px 0;
}

.back-link {
  display: inline-block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--accent);
}

.post-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

.post-body p {
  margin: 0 0 20px;
  color: var(--text);
  line-height: 1.7;
}

.post-body h2 {
  font-size: 1.2rem;
  margin: 36px 0 14px;
  text-align: left;
}

.post-body ul {
  margin: 0 0 20px;
  padding-left: 1.2em;
  color: var(--text);
  line-height: 1.7;
}

.post-body li {
  margin-bottom: 6px;
}

.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--border);
  color: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  margin: 8px 0 28px;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.wip-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
}

.card .wip-badge {
  margin-bottom: 10px;
}

.app-icon-lg {
  width: 96px;
  height: 96px;
  border-radius: 22%;
  margin: 0 auto 20px;
  display: block;
}

.post-date {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0 0 6px;
}

.blog-list {
  padding: 40px 20px 64px;
}

a.card {
  display: block;
  text-decoration: none;
  color: inherit;
}

a.card:hover {
  border-color: var(--accent);
}
