/* ==========================================================================
   Bookstack Marketing Site — Stylesheet
   Design tokens sourced from instructions.md — do not drift from spec.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&display=swap');

:root {
  /* Neutrals */
  --snow: #FFFFFF;
  --anchor: #202A38;
  --trek: #415166;
  --shark: #808D9D;
  --dark-putty: #E4E6E5;
  --putty: #F2F2EF;

  /* Crush (primary) */
  --crush: #FF4B00;
  --crush-dark: #B71D00;
  --crush-light: #FFA580;
  --crush-lightest: #FFF5EB;

  /* Nautica */
  --nautica: #08A5D2;
  --nautica-dark: #0087C2;
  --nautica-light: #83D2E8;
  --nautica-lightest: #ECF8FB;

  /* Berry */
  --berry: #E1465A;
  --berry-dark: #B43848;
  --berry-light: #F8AAAD;
  --berry-lightest: #FEEEEF;

  /* Amethyst */
  --amethyst: #323296;
  --amethyst-dark: #242481;
  --amethyst-light: #9999DF;
  --amethyst-lightest: #EAEAF8;

  /* Pine */
  --pine: #6AB04C;
  --pine-dark: #429537;
  --pine-light: #B4D7A6;
  --pine-lightest: #E9F3E4;

  /* Gradient */
  --sundown: linear-gradient(180deg, #FF4B00 0%, #E1465A 100%);

  --font-sans: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 960px;
  --inset: 48px; /* interior left/right padding for "narrow" sections, 960 - 2*48 = 864 */
  --radius-card: 16px;
  --radius-btn: 8px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--anchor);
  background: var(--snow);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--nautica);
  outline-offset: 2px;
}

/* ---------- Container system ----------
   .container       = 960px max, no interior padding — used ONLY by: hero image,
                       the 3-reasons-why box grid, and the testimonial card grid.
   .container-inset = 960px max, 48px padding each side (864px content) — used
                       by everything else: headlines, intro copy, feature grid,
                       FAQ, footer, and all inner-page content.
   Both collapse to a small edge gutter on narrow viewports. */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0;
}
.container-inset {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--inset);
}
@media (max-width: 860px) {
  .container { padding: 0 24px; }
  .container-inset { padding: 0 24px; }
}

/* ---------- Typography ---------- */
h1, .h1 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--anchor);
  margin: 0;
}
.hero-subhead {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--trek);
  margin: 0;
  max-width: 54ch;
}
h2, .h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--anchor);
  margin: 0;
}
h3, .h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--shark);
  margin: 0;
}
.h3-highlight {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0;
  background: var(--sundown);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
p {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.4;
  color: var(--shark);
  margin: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 17px;
  border: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.btn-primary {
  background: var(--anchor);
  color: var(--snow);
}
.btn-primary:hover { background: #2c394a; }
.btn-secondary {
  background: rgba(65, 81, 102, 0.08);
  color: var(--trek);
}
.btn-secondary:hover { background: rgba(65, 81, 102, 0.14); }

/* ---------- Sticky mini header (shiori.sh-style) ----------
   Hidden until scroll, then a ~60px frosted-glass strip with a small logo
   left and a Sign In pill right. The blur/fade lives on ::before so it never
   touches the opacity of the logo or button sitting in front of it. */
.mini-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 60px;
  z-index: 100;
  transform: translateY(-100%);
  transition: transform 0.25s ease;
}
.mini-header.is-visible { transform: translateY(0); }
.mini-header::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .mini-header::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 100%);
  }
}
.mini-header__inner {
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin: 0 auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mini-header__logo img { width: 32px; height: 32px; }
.mini-header .btn-primary {
  background: var(--snow);
  color: var(--trek);
  font-size: 15px;
  font-weight: 600;
  height: auto;
  padding: 12px;
  line-height: 1;
}
.mini-header .btn-primary:hover { background: var(--dark-putty); }

/* ---------- Hero ---------- */
.hero {
  background: var(--putty);
  border-bottom: 1px solid var(--dark-putty);
  padding: 64px 0 0;
  overflow: visible;
}
.hero__logo {
  width: 48px;
  height: 48px;
  margin-bottom: 32px;
}
.hero__content h1 { margin-bottom: 16px; }
.hero__content .hero-subhead { margin-bottom: 32px; }
.hero__ctas {
  display: flex;
  gap: 12px;
  margin-bottom: 56px;
}
.hero__image {
  display: block;
  width: 100%;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 12px 24px 0 rgba(65, 81, 102, 0.12);
  margin-bottom: 0;
}

/* ---------- Features section ---------- */
.features {
  background: var(--snow);
  padding: 96px 0 0 0;
}
.features__intro {
  margin-bottom: 48px;
}
.features__intro h2 { margin-bottom: 16px; max-width: 30ch }
.features__intro p { margin-bottom: 8px; }

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.feature-card {
  position: relative;
  background: rgba(242, 242, 239, 0.5);
  border-radius: var(--radius-card);
  padding: 24px 40px 32px 32px;
}
.feature-card__icon {
  width: 32px;
  height: 32px;
  margin-bottom: 24px;
}
.feature-card__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 17px;
  color: var(--anchor);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.feature-card__copy {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.4;
  color: var(--trek);
  margin: 0;
}
.badge-soon {
  position: absolute;
  top: 24px;
  right: -12px;
  transform: rotate(5deg);
  border: 2px solid var(--pine-light);
  background: var(--pine-lightest);
  border-radius: 6px;
  padding: 6px 8px 5px 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pine-dark);
  white-space: nowrap;
}

/* ---------- Reasons why ---------- */
.reasons {
  background: var(--snow);
  padding: 96px 0;
}
.reasons__intro {
  margin-bottom: 48px;
}
.reasons__intro h2 { margin-bottom: 16px; }
.reasons__intro p { margin-bottom: 8px; }

.reasons-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(255, 165, 128, 0.24);
  border-radius: 16px;
  overflow: hidden;
}
.reasons-panel__item {
  padding: 32px;
  border-left: 1px solid rgba(255, 165, 128, 0.24);
}
.reasons-panel__item:first-child { border-left: none; }
.reasons-panel__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--crush-lightest);
  border-radius: 12px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 24px;
  color: var(--crush);
  margin-bottom: 24px;
}
.reasons-panel__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--anchor);
  margin: 0 0 6px;
}
.reasons-panel__copy {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.4;
  color: var(--trek);
  margin: 0;
}

/* ---------- Testimonials ---------- */
.testimonials {
  background: var(--anchor);
  padding: 96px 0;
  text-align: center;
}
.testimonials__intro { margin-bottom: 48px; }
.testimonials__intro h2 { color: var(--snow); margin-bottom: 12px; }
.testimonials__intro p { margin: 0 auto; }

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  text-align: left;
}
.testimonial-card {
  background: #18202B;
  border-radius: var(--radius-card);
  padding: 24px;
}
.testimonial-card__stars {
  height: 16px;
  margin-bottom: 16px;
}
.testimonial-card__quote {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.4;
  color: var(--snow);
  margin: 0 0 16px;
}
.testimonial-card__quote mark {
  background: rgba(65,81,102,.32);
  padding: 1px 4px 2px 4px;
  border-radius: 4px;
}
.testimonial-card__quote mark span {
  background: var(--sundown);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.testimonial-card__author {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  color: var(--shark);
}

/* ---------- FAQ ---------- */
.faq {
  background: var(--putty);
  padding: 96px 0;
  text-align: center;
}
.faq h2 { margin-bottom: 48px; }
.faq__list {
  text-align: left;
}
.faq-item {
  border-bottom: 1px solid rgba(128,141,157,.24);
}
.faq-item:first-child { border-top: 1px solid var(--dark-putty); }
.faq-item__question {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 17px;
  color: var(--anchor);
  text-align: left;
}
.faq-item__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}
.faq-item[data-open="true"] .faq-item__icon { transform: rotate(180deg); }
.faq-item__answer-wrap {
  overflow: hidden;
  height: 0;
  transition: height 0.22s ease;
}
.faq-item__answer {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.4;
  color: var(--trek);
  padding: 0 4px 20px;
  margin: 0;
}

.faq-item__answer a {
	color: var(--anchor);
	font-weight: 600;
	text-decoration: underline;
}
.faq-item__answer a:hover {
	color: var(--crush);
}

.faq__cta {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--snow);
  padding: 96px 0 56px;
  text-align: center;
}
.site-footer__mark img {
  width: 96px;
  height: auto;
  margin: 0 auto 32px;
}
.site-footer__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 16px;
}
.site-footer__links a {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  color: var(--anchor);
  transition: color 0.15s ease;
}
.site-footer__links a:hover { color: var(--crush); }
.site-footer__copyright {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--shark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.site-footer__copyright img { width: 14px; height: 14px; }

/* ---------- Simple inner pages (Terms / Privacy / PWA / Contact) ----------
   Heading and body copy share the same container-inset — no separate
   shaded band for the page title. */
.page-content {
  padding: 64px 0 96px;
}
.page-content h1 { margin-bottom: 16px; }
.page-content .page-intro { margin-bottom: 40px; }

.prose h3 {
  color: var(--anchor);
  font-weight: 600;
  font-size: 22px;
  margin: 40px 0 12px;
}
.prose h3:first-child { margin-top: 0; }
.prose p {
  color: var(--trek);
  margin-bottom: 16px;
}
.prose .updated {
  color: var(--shark);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 32px;
}

/* PWA steps */
.pwa-steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.pwa-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.pwa-step__num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--dark-putty);
  border-radius: 12px;
  font-weight: 700;
  font-size: 20px;
  color: var(--trek);
}
.pwa-step .pwa-step__title {
  font-weight: 600;
  font-size: 20px;
  color: var(--anchor);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.pwa-step__copy {
  color: var(--trek);
  margin: 0;
}
.pwa-android {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--dark-putty);
}
.pwa-android h3 {
  color: var(--anchor);
  font-weight: 600;
  font-size: 22px;
  margin: 0 0 12px;
}
.pwa-android p { color: var(--trek); }

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--anchor);
}
.form-field input,
.form-field textarea {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  color: var(--anchor);
  background: var(--snow);
  border: 1px solid var(--dark-putty);
  border-radius: 8px;
  padding: 12px 14px;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--nautica);
  box-shadow: 0 0 0 3px var(--nautica-lightest);
}
.contact-form .btn { align-self: flex-start; margin-top: 8px; }
.contact-confirm {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--pine-lightest);
  border: 1px solid var(--pine-light);
  border-radius: 8px;
  color: var(--pine-dark);
  font-weight: 600;
  font-size: 15px;
}
.contact-confirm.is-visible { display: flex; }
.contact-form.is-hidden { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  h1, .h1 { font-size: 32px; }
  .hero-subhead { font-size: 24px; }
  h2, .h2 { font-size: 26px; }
  .h3-highlight, h3, .h3 { font-size: 20px; }
  p { font-size: 16px; }

  .hero { padding-top: 48px; }
  .hero__ctas { flex-wrap: wrap; }

  .features { padding: 64px 0; }
  .feature-grid { grid-template-columns: 1fr; }

  .reasons { padding: 64px 0; }
  .reasons-panel { grid-template-columns: 1fr; }
  .reasons-panel__item {
    border-left: none;
    border-top: 1px solid rgba(255, 165, 128, 0.24);
  }
  .reasons-panel__item:first-child { border-top: none; }

  .testimonials { padding: 64px 0; }
  .testimonial-grid { grid-template-columns: 1fr; gap: 24px; }

  .faq { padding: 64px 0; }

  .site-footer__links { flex-wrap: wrap; gap: 16px 24px; }

  .pwa-step { gap: 14px; }
}

@media (max-width: 520px) {
  h1, .h1 { font-size: 28px; }
  .hero__ctas { flex-direction: column; align-items: stretch; }
}
