/* ================================================
   Craftomatic Landing Page Styles
   ================================================ */

/* ---- CSS Reset & Base Styles ---- */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  line-height: 1.6;
}

/* ---- CSS Custom Properties ---- */

:root {
  /* Colors */
  --color-text: #222;
  --color-text-soft: #555;
  --color-border: #d1d1d1;
  --color-accent: #33C3F0;
  --color-accent-hover: #1EAEDB;
  --color-error: #b91c1c;
  --color-success: #065f46;
  --color-bg-success: #d1fae5;
  --color-bg-error: #fee2e2;

  /* Spacing */
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;

  /* Layout */
  --max-width: 800px;
  --border-radius: 6px;
}

/* ---- Typography ---- */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  color: var(--color-text);
  background-color: #fff;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.125rem;
}

p {
  margin-bottom: 1rem;
}

b, strong {
  font-weight: 600;
}

/* ---- Layout & Container ---- */

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

section {
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--color-border);
}

section:first-of-type {
  border-top: none;
}

/* ---- Hero Section ---- */

.hero {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: var(--spacing-lg);
}

.hero h1 {
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--color-text-soft);
  margin-bottom: 0;
}

.hero-newsletter {
  margin-top: 3rem;
  text-align: center;
  border-top: none;
  padding: 0;
}

.hero-newsletter-text {
  font-size: 1rem;
  color: var(--color-text-soft);
  margin-bottom: 1.5rem;
}

.product-screenshot {
  margin-top: 4rem;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  max-width: 100vw;
}

.product-screenshot img {
  width: 100%;
  max-width: 1400px;
  height: auto;
  display: block;
  margin: 0 auto;
  padding: 0;
  object-fit: contain;
}

.value-props {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  row-gap: 2rem;
  margin-top: 3rem;
}

.value-prop {
  text-align: center;
  padding: 2rem 1.5rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

.value-prop i {
  font-size: 2rem;
  display: block;
  margin: 0 auto 1rem;
  color: var(--color-text);
}

.value-prop h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.value-prop p {
  margin-bottom: 0;
  line-height: 1.5;
  font-size: 0.9375rem;
  color: var(--color-text-soft);
}

/* ---- Narrative Section ---- */

.narrative {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding: var(--spacing-lg) 1.5rem;
  background: #f9fafb;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.narrative-content {
  max-width: var(--max-width);
  margin: 0 auto;
  line-height: 1.8;
}

.narrative-content h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.narrative-content p {
  font-size: 1.125rem;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

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

/* ---- Newsletter Section ---- */

.newsletter {
  text-align: center;
}

.newsletter h2 {
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.newsletter > p {
  margin-bottom: 2rem;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.form-input {
  width: 100%;
  max-width: 300px;
  min-width: 100px;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-input::placeholder {
  color: #999;
}

/* ---- Buttons ---- */

button {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-align: center;
  cursor: pointer;
  border: none;
  border-radius: var(--border-radius);
  transition: background-color 0.15s ease;
}

.submit-button,
.loading-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 300px;
  height: 38px;
  padding: 0.563rem 1.063rem;
  background: #000;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.submit-button:hover {
  background: #333;
}

.submit-button:active {
  background: #000;
}

.loading-button {
  display: none;
  cursor: default;
}

.back-button {
  display: none;
  margin: 0.625rem auto 0;
  padding: 0.5rem 1rem;
  background: transparent;
  color: #6b7280;
  font-size: 0.875rem;
  cursor: pointer;
}

.back-button:hover {
  text-decoration: underline;
  background: transparent;
}

/* ---- Success & Error Messages ---- */

.success-message,
.error-message {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
}

.success-message {
  background: var(--color-bg-success);
  color: var(--color-success);
}

.error-message {
  background: var(--color-bg-error);
  color: var(--color-error);
}

.success-text,
.error-text {
  font-size: 0.875rem;
  margin: 0;
}

/* ---- Roadmap Section ---- */

.roadmap h2 {
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.roadmap ul {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.roadmap li {
  margin-bottom: 0.5rem;
}

.roadmap ul ul {
  margin-top: 0.5rem;
}

/* ---- Responsive Design ---- */

/* Tablet and Desktop (600px and up) */
@media (min-width: 600px) {
  /* Typography adjustments */
  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1.5rem;
  }

  /* Hero section */
  .hero {
    margin-top: 4rem;
  }

  .hero-newsletter {
    margin-top: 4rem;
  }

  .hero-newsletter-text {
    font-size: 1.125rem;
  }

  .product-screenshot {
    margin-top: 6rem;
  }

  /* Value props - 3 column grid */
  .value-props {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    row-gap: 3rem;
    margin-top: 6rem;
  }

  /* Section spacing */
  section {
    padding: var(--spacing-xl) 0;
  }

  /* Narrative section */
  .narrative {
    padding: var(--spacing-xl) 1.5rem;
  }

  .narrative-content p {
    font-size: 1.25rem;
  }
}

/* ---- Utilities ---- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
