/* Reset and base styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #ffffff;
  --color-text: #111111;
  --color-text-muted: #555555;
  --color-accent: #0066cc;
  --color-accent-hover: #0052a3;
  --color-border: #d0d0d0;
  --color-card-bg: #f5f5f5;
  --max-width: 800px;
  --spacing: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #141414;
    --color-text: #f0f0f0;
    --color-text-muted: #b0b0b0;
    --color-accent: #4d9fff;
    --color-accent-hover: #6eb0ff;
    --color-border: #2a2a2a;
    --color-card-bg: #1e1e1e;
  }
}

[data-theme="dark"] {
  --color-bg: #141414;
  --color-text: #f0f0f0;
  --color-text-muted: #b0b0b0;
  --color-accent: #4d9fff;
  --color-accent-hover: #6eb0ff;
  --color-border: #2a2a2a;
  --color-card-bg: #1e1e1e;
}

html {
  font-size: 16px;
  line-height: 1.6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg);
}

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

a:hover {
  text-decoration: underline;
}

/* Layout */
header,
main,
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

/* Header & Navigation */
header {
  padding-top: var(--spacing);
  padding-bottom: var(--spacing);
  border-bottom: 1px solid var(--color-border);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.nav-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

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

/* Buttons */
.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background-color: var(--color-card-bg);
  text-decoration: none;
}

.button-primary {
  color: #ffffff;
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.button-primary:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.cta-button {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
  background-color: var(--color-accent);
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.cta-button:hover {
  background-color: var(--color-accent-hover);
  text-decoration: none;
}

/* Hero Section */
.hero {
  padding: 5rem 0 4rem;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero .tagline {
  font-size: 1.1875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hero .intro {
  color: var(--color-text-muted);
  max-width: 600px;
  line-height: 1.7;
}

/* Sections */
section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--color-border);
}

section:first-child {
  border-top: none;
}

section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.section-intro {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

/* Products Section */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  margin-top: 2rem;
}

.product-card {
  padding: 0;
  background-color: transparent;
  border: none;
  border-radius: 0;
}

.product-card h3 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.product-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.product-card p {
  margin-bottom: 1rem;
}

.product-price {
  font-weight: 600;
  color: var(--color-text);
}

.product-status {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.product-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.product-card.coming-soon {
  opacity: 0.6;
}

/* Devlog Preview */
.devlog-preview .post-list {
  margin-top: 1.5rem;
}

.post-preview {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.post-preview:last-child {
  border-bottom: none;
}

.post-preview time {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.post-preview h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.post-preview h3 a {
  color: var(--color-text);
}

.post-preview h3 a:hover {
  color: var(--color-accent);
}

.post-preview p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.view-all {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
}

/* Newsletter */
.newsletter {
  text-align: center;
  padding: 4.5rem 0;
}

.newsletter h2 {
  margin-bottom: 0.5rem;
}

.newsletter p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.signup-form {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 400px;
  margin: 0 auto;
}

.signup-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 0.625rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-bg);
  color: var(--color-text);
}

.signup-form input[type="email"]:focus {
  outline: none;
  border-color: var(--color-accent);
}

.signup-form button {
  padding: 0.625rem 1.5rem;
  font-size: 1rem;
}

/* Form Messages */
.form-message {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.form-message:empty {
  display: none;
}

.form-message-success {
  color: #16a34a;
}

.form-message-error {
  color: #dc2626;
}

/* Product Detail Section */
.product-detail {
  padding-top: 5rem;
}

.product-detail h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.product-detail > .tagline {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.product-detail .cta-button {
  margin-bottom: 3rem;
}

.product-detail .features,
.product-detail .description,
.product-detail .demo {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-border);
}

.product-detail .features h3,
.product-detail .description h3,
.product-detail .demo h3 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

/* Screenshot */
.screenshot-container {
  max-width: 100%;
  margin: 0 auto 2rem;
}

.screenshot-container img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background-color: var(--color-card-bg);
  min-height: 250px;
  object-fit: cover;
}

/* Video */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin-bottom: 2rem;
  background-color: #000;
  border-radius: 6px;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-thumbnail {
  position: relative;
  width: 100%;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.video-thumbnail img {
  width: 100%;
  display: block;
  border-radius: 6px;
}

.video-thumbnail .play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.video-thumbnail:hover .play-button {
  background: rgba(0, 0, 0, 0.85);
}

.video-thumbnail .play-button::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 24px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}

/* Features List */
.features ul {
  list-style: none;
}

.features li {
  padding: 0.625rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.features li::before {
  content: "\2022";
  color: var(--color-accent);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.platform-note {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Description */
.description p {
  margin-bottom: 1rem;
}

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

.requirements {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Demo */
.demo p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* About */
.about p {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

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

/* Footer */
footer {
  padding: 3rem var(--spacing);
  text-align: center;
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
}

.social-links {
  margin-bottom: 1rem;
}

.social-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  margin: 0 0.75rem;
}

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

.copyright {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Devlog Page */
.devlog-page {
  padding-bottom: 3rem;
}

.devlog-header {
  padding: 3rem 0;
  border-top: none;
}

.devlog-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.devlog-header p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.rss-link {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

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

.posts {
  border-top: none;
  padding-top: 0;
}

.post {
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-border);
}

.post:last-child {
  border-bottom: none;
}

.post-header {
  margin-bottom: 1.5rem;
}

.back-link {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

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

.post-header time {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.post-header h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 0;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content p:last-child {
  margin-bottom: 0;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.post-content ul {
  list-style: disc;
}

.post-content ol {
  list-style: decimal;
}

.post-content li {
  margin-bottom: 0.25rem;
}

.post-content pre {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow-x: auto;
}

.post-content code {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.875rem;
}

.post-content p code {
  padding: 0.125rem 0.375rem;
  background-color: var(--color-card-bg);
  border-radius: 3px;
}

.post-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--color-border);
  color: var(--color-text-muted);
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

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

  section {
    padding: 3rem 0;
  }

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

  .signup-form {
    flex-direction: column;
  }

  .signup-form input[type="email"] {
    width: 100%;
  }

  .product-actions {
    flex-direction: column;
  }

  .product-actions .button {
    text-align: center;
  }
}
