/* ========================================
   ShelfNest Marketing — Design System CSS
   ======================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

/* --- CSS Custom Properties: Light Mode --- */
:root {
  --bg-primary: #F6F3EC;
  --bg-card: #EDE7DA;
  --bg-card-hover: #E4DDD0;
  --accent-teal: #1F5D5E;
  --accent-teal-hover: #174A4B;
  --accent-gold: #C6A75E;
  --text-primary: #1C1C1C;
  --text-secondary: #5F5F5F;
  --text-on-teal: #FFFFFF;
  --error: #B04A3F;
  --border: rgba(28, 28, 28, 0.10);
  --shadow-sm: 0 1px 3px rgba(28, 28, 28, 0.08), 0 1px 2px rgba(28, 28, 28, 0.05);
  --shadow-md: 0 4px 12px rgba(28, 28, 28, 0.10), 0 2px 4px rgba(28, 28, 28, 0.06);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --nav-height: 64px;
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #121414;
    --bg-card: #1E2323;
    --bg-card-hover: #252C2C;
    --accent-teal: #3E8A8B;
    --accent-teal-hover: #4FA0A1;
    --accent-gold: #D4B870;
    --text-primary: #F2F2F2;
    --text-secondary: #A8A8A8;
    --border: rgba(242, 242, 242, 0.10);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.30);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.40);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  text-decoration: underline;
}

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

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }
p  { color: var(--text-secondary); }

/* --- Layout Helpers --- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

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

/* ========================================
   NAVIGATION
   ======================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

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

.nav__logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
}

.nav__logo-text {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav__links a:hover {
  color: var(--accent-teal);
  text-decoration: none;
}

.nav__cta {
  background-color: var(--accent-teal) !important;
  color: var(--text-on-teal) !important;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500 !important;
  transition: background-color 0.15s ease !important;
}

.nav__cta:hover {
  background-color: var(--accent-teal-hover) !important;
  color: white !important;
  text-decoration: none !important;
}

/* ========================================
   HERO
   ======================================== */

.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-bottom: 22px;
  padding: 6px 14px;
  border: 1px solid var(--accent-teal);
  border-radius: 100px;
  opacity: 0.85;
}

.hero__title {
  margin-bottom: 24px;
}

.hero__title span {
  color: var(--accent-teal);
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 44px;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Apple App Store Button */
.app-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: var(--text-primary);
  color: var(--bg-primary) !important;
  padding: 13px 24px;
  border-radius: var(--radius-md);
  transition: transform 0.15s ease, opacity 0.15s ease;
  text-decoration: none !important;
}

.app-store-btn:hover {
  transform: translateY(-2px);
  opacity: 0.88;
  text-decoration: none !important;
}

.app-store-btn__icon {
  font-size: 1.8rem;
  line-height: 1;
}

.app-store-btn__text {
  display: flex;
  flex-direction: column;
  text-align: left;
  color: var(--bg-primary);
}

.app-store-btn__sub {
  font-size: 0.65rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bg-primary);
}

.app-store-btn__main {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--bg-primary);
}

.hero__note {
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* CSS Book Shelf Illustration */
.hero__visual {
  margin: 68px auto 0;
  max-width: 380px;
}

.book-shelf {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  padding: 28px 32px 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  box-shadow: var(--shadow-md);
}

.book {
  border-radius: 2px 5px 5px 2px;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.14);
  position: relative;
  flex-shrink: 0;
}

.book::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgba(0,0,0,0.14);
  border-radius: 2px 0 0 2px;
}

.shelf-plank {
  height: 14px;
  background: #C2B8A3;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  border: 1px solid rgba(28,28,28,0.12);
  box-shadow: 0 4px 10px rgba(28,28,28,0.14);
}

/* ========================================
   FEATURES
   ======================================== */

.features__header {
  text-align: center;
  margin-bottom: 60px;
}

.features__header h2 {
  margin-bottom: 14px;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}

.feature-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-card__icon {
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  color: var(--accent-teal);
  display: block;
}

.feature-card__icon svg {
  width: 44px;
  height: 44px;
}

.feature-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: 10px;
}

.feature-card__desc {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.pro-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  padding: 2px 7px;
  border-radius: 100px;
  margin-left: 8px;
  vertical-align: middle;
  opacity: 0.9;
}

/* ========================================
   SUPPORT / FAQ
   ======================================== */

.support__header {
  text-align: center;
  margin-bottom: 56px;
}

.support__header h2 {
  margin-bottom: 14px;
}

.support__layout {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 56px;
  align-items: start;
}

@media (max-width: 720px) {
  .support__layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 20px;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  transition: background-color 0.15s;
}

.faq-question:hover {
  background-color: var(--bg-card-hover);
}

.faq-chevron {
  color: var(--accent-teal);
  font-size: 0.9rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-chevron.open {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 14px 20px 18px;
  font-size: 0.875rem;
  line-height: 1.72;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* ========================================
   SCREENSHOTS
   ======================================== */

.screenshots__header {
  text-align: center;
  margin-bottom: 60px;
}

.screenshots__header h2 {
  margin-bottom: 14px;
}

.screenshots__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  align-items: start;
  max-width: 840px;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .screenshots__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .screenshots__grid {
    grid-template-columns: 1fr;
    max-width: 260px;
  }
}

.screenshot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Screenshot image — phone-screen shape, no chrome */
.phone-screenshot {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  border-radius: 36px;
  box-shadow:
    0 8px 24px rgba(28, 28, 28, 0.12),
    0 2px 6px rgba(28, 28, 28, 0.08),
    0 0 0 1px rgba(28, 28, 28, 0.06);
  display: block;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease;
  background: var(--bg-card);
}

.phone-screenshot:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow:
    0 24px 48px rgba(28, 28, 28, 0.16),
    0 8px 16px rgba(28, 28, 28, 0.10),
    0 0 0 1px rgba(28, 28, 28, 0.06);
}

@media (prefers-color-scheme: dark) {
  .phone-screenshot {
    box-shadow:
      0 8px 24px rgba(0, 0, 0, 0.40),
      0 2px 6px rgba(0, 0, 0, 0.30),
      0 0 0 1px rgba(255, 255, 255, 0.06);
  }
  .phone-screenshot:hover {
    box-shadow:
      0 24px 48px rgba(0, 0, 0, 0.50),
      0 8px 16px rgba(0, 0, 0, 0.35),
      0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

.screenshot-caption {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  letter-spacing: 0.01em;
}

/* ========================================
   SUPPORT / FAQ
   ======================================== */

.support-contact {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.support-contact h3 {
  margin-bottom: 12px;
}

.support-contact p {
  font-size: 0.875rem;
  margin-bottom: 22px;
  line-height: 1.65;
}

.btn-teal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--accent-teal);
  color: var(--text-on-teal) !important;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn-teal:hover {
  background-color: var(--accent-teal-hover);
  transform: translateY(-1px);
  text-decoration: none !important;
  color: white !important;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 52px 0 32px;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.footer__brand {
  max-width: 240px;
}

.footer__brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer__logo-img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  object-fit: cover;
}

.footer__brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.footer__brand p {
  font-size: 0.8rem;
  line-height: 1.6;
}

.footer__links h4 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-family: var(--font-body);
}

.footer__links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

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

.footer__bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer__copy {
  font-size: 0.76rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

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

.footer__legal-links a {
  font-size: 0.76rem;
  color: var(--text-secondary);
  opacity: 0.75;
  text-decoration: none;
  transition: opacity 0.15s, color 0.15s;
}

.footer__legal-links a:hover {
  opacity: 1;
  color: var(--accent-teal);
}

/* ========================================
   LEGAL PAGES (Privacy, Terms)
   ======================================== */

.legal-page {
  padding: 72px 0 96px;
}

.legal-page__header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.legal-page__header h1 {
  margin-bottom: 10px;
}

.legal-page__meta {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.legal-body {
  max-width: 720px;
}

.legal-body h2 {
  font-size: 1.15rem;
  margin-top: 44px;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.legal-body h3 {
  font-size: 0.95rem;
  margin-top: 28px;
  margin-bottom: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-primary);
}

.legal-body p {
  font-size: 0.9rem;
  line-height: 1.78;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.legal-body ul, .legal-body ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

.legal-body li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.legal-body a {
  color: var(--accent-teal);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
  .section {
    padding: 64px 0;
  }

  .hero {
    padding: 60px 0 48px;
  }

  .nav__links {
    gap: 16px;
  }

  .footer__inner {
    flex-direction: column;
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ========================================
   UTILITY
   ======================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Blazor loading */
.loading-progress {
  position: absolute;
  display: block;
  width: 8rem;
  height: 8rem;
  inset: 20vh 0 auto 0;
  margin: 0 auto;
}

.loading-progress circle {
  fill: none;
  stroke: var(--bg-card);
  stroke-width: 0.6rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}

.loading-progress circle:last-child {
  stroke: var(--accent-teal);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
  position: absolute;
  text-align: center;
  font-weight: 500;
  inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.loading-progress-text::after {
  content: var(--blazor-load-percentage-text, "Loading");
}

/* Blazor error */
#blazor-error-ui {
  display: none;
}

.blazor-error-boundary {
  background: var(--error);
  padding: 1rem 1.5rem;
  color: white;
  border-radius: var(--radius-sm);
}

.blazor-error-boundary::after {
  content: "An error has occurred.";
}
