/* site.css — Dormi public pages (homepage, features, FAQ)
   Mobile-first responsive design using app brand colors.
   Roboto loaded from Google Fonts CDN in HTML <link>. */

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  --color-primary: #008cbb;
  --color-primary-dark: #007399;
  --color-accent: #24adde;
  --color-green: #96aa39;
  --color-green-light: #d2e86d;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7fa;
  --color-border: #e0e0e0;
  --max-width: 960px;
  --header-height: 64px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  /* Prevent content shift when scrollbar appears/disappears between pages.
     overflow-y: scroll always shows the scrollbar track, avoiding both
     the layout shift AND the white gutter that scrollbar-gutter creates. */
  overflow-y: scroll;
}

body {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  /* Sticky footer: body fills viewport, footer pushed to bottom */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Main content area grows to push footer down */
.hero,
.content-body,
.section {
  flex-shrink: 0;
}

/* The last content section before footer grows */
body > section:last-of-type,
body > .content-body {
  flex: 1;
}

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

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

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

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: 2rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.6rem; color: var(--color-primary); }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.05rem; margin-bottom: 0.4rem; color: var(--color-text-light); }

p {
  margin-bottom: 1rem;
}

ul, ol {
  margin: 0 0 1rem 1.5rem;
}

li {
  margin-bottom: 0.4rem;
}

strong {
  font-weight: 500;
}

/* ============================================================
   Layout
   ============================================================ */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 3rem 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
}

.site-header .logo img,
.site-header .logo svg {
  width: 40px;
  height: 40px;
}

.site-header .logo-text {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--color-text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text-light);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: transform 0.2s;
}

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

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--color-primary);
    gap: 0;
  }

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

  .site-nav a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav li:last-child a {
    border-bottom: none;
  }
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #ffffff;
  padding: 3rem 0;
  text-align: center;
}

.hero h1 {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 0.5rem;
}

.hero .tagline {
  font-size: 1.1rem;
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.hero .secondary-links {
  margin-top: 1rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

.hero .secondary-links a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

.hero .secondary-links a:hover {
  opacity: 1;
  text-decoration-color: #fff;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.hero-text {
  max-width: 480px;
}

.hero-image {
  max-width: 260px;
}

.hero-image img {
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
  .hero {
    padding: 4rem 0;
    text-align: left;
  }

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

  .hero-content {
    flex-direction: row;
    justify-content: space-between;
  }

  .hero-text {
    flex: 1;
    max-width: 520px;
  }

  .hero-image {
    max-width: 300px;
  }
}

/* ============================================================
   Icon (animated Dormi cart)
   ============================================================ */
.dormi-icon-animated {
  display: inline-block;
  width: 88px;
  height: 88px;
  margin-bottom: 1rem;
}

/* ============================================================
   Badges (Google Play)
   ============================================================ */
.play-badge {
  display: inline-block;
  margin-top: 1rem;
  width: 200px;
  height: auto;
}

/* ============================================================
   Feature Cards
   ============================================================ */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.feature-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.feature-card h3 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: 0;
}

/* ============================================================
   Feature Detail Sections (features page)
   ============================================================ */
.feature-section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.feature-section:last-child {
  border-bottom: none;
}

.feature-section-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.feature-section-text {
  flex: 1;
}

.feature-section-text h3 {
  margin-top: 1.5rem;
}

.feature-section-image {
  max-width: 280px;
  margin: 0 auto;
}

.feature-section-image img {
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

@media (min-width: 768px) {
  .feature-section-content {
    flex-direction: row;
    align-items: flex-start;
  }

  .feature-section-content.reverse {
    flex-direction: row-reverse;
  }

  .feature-section-image {
    flex-shrink: 0;
    max-width: 260px;
  }
}

/* ============================================================
   Trust / Privacy Signal
   ============================================================ */
.trust-section {
  text-align: center;
  padding: 2.5rem 0;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

.trust-badge {
  text-align: center;
  max-width: 200px;
}

.trust-badge .badge-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.trust-badge h3 {
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.trust-badge p {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 0;
}

/* ============================================================
   Pricing Teaser
   ============================================================ */
.pricing-teaser {
  text-align: center;
  background: var(--color-primary-dark);
  color: #ffffff;
  padding: 2.5rem 0;
}

.pricing-teaser h2 {
  color: #ffffff;
}

.pricing-teaser p {
  opacity: 0.9;
  max-width: 480px;
  margin: 0 auto 1rem;
}

.pricing-teaser a {
  color: var(--color-green-light);
}

.pricing-teaser a:hover {
  color: #ffffff;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--color-green);
  color: #ffffff;
}

.btn-primary:hover {
  background: #7a8e2e;
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ============================================================
   FAQ Styles
   ============================================================ */
.faq-section h2 {
  margin-top: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.faq-section h2:first-child {
  margin-top: 0;
}

.faq-section h3 {
  margin-top: 1.5rem;
  color: var(--color-text);
}

.faq-section h4 {
  margin-top: 1rem;
  color: var(--color-text-light);
}

/* ============================================================
   Code
   ============================================================ */
code {
  background: var(--color-bg-alt);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}

pre {
  background: var(--color-bg-alt);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1rem;
  position: relative;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  border-radius: 3px;
  font-size: 0.75rem;
  font-family: 'Roboto', sans-serif;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.copy-btn:hover {
  opacity: 1;
}

/* ============================================================
   Tables
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
  background: var(--color-bg);
}

th, td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border: 1px solid var(--color-border);
}

th {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 500;
}

td {
  vertical-align: top;
}

/* Responsive table */
@media (max-width: 600px) {
  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.4rem 0.5rem;
  }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 2rem 0;
  font-size: 0.9rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.8);
}

.site-footer a:hover {
  color: #ffffff;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  padding: 0.25rem 0;
}

.footer-copy {
  font-size: 0.8rem;
  opacity: 0.7;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

/* ============================================================
   Content Pages (features, FAQ detail)
   ============================================================ */
.page-title {
  background: var(--color-primary);
  color: #ffffff;
  padding: 2rem 0;
}

.page-title h1 {
  color: #ffffff;
  margin-bottom: 0;
}

.content-body {
  padding: 2rem 0 3rem;
}

.content-body a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(0, 140, 187, 0.3);
}

.content-body a:hover {
  text-decoration-color: var(--color-primary);
}

/* ============================================================
   Utility
   ============================================================ */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
