/* ===========================================================================
   Texpert — shared design system
   Loaded alongside Tailwind CDN. Defines tokens, typography, and component
   classes for buttons, cards, segmented control, kicker, accent rule,
   pricing cards, FAQ rows, and footer primitives.
   =========================================================================== */

:root {
  --ink:        #111111;
  --ink-soft:   #2B2A28;
  --muted:      #6B6660;
  --muted-2:    #9B9791;
  --paper:      #F7F4EE;
  --paper-warm: #FBF8F2;
  --surface:    #FFFFFF;
  --line:       #E8E3DA;
  --line-soft:  #F1ECE3;
  --accent:     #1E3A5F;
  --accent-hover: #152B46;
  --accent-tint: #EDF1F7;
  --gold:       #B08D57;
  --success:    #2F6A4F;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* --------------------------------- Base --------------------------------- */

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

.display {
  font-family: "Fraunces", "Times New Roman", Georgia, serif;
  font-weight: 450;
  letter-spacing: -0.022em;
  color: var(--ink);
  font-feature-settings: "ss01", "ss02";
  font-variation-settings: "SOFT" 30, "WONK" 0;
}

.display-xl {
  font-size: clamp(2.6rem, 5.2vw + 0.5rem, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
}

.display-lg {
  font-size: clamp(2rem, 3.2vw + 0.5rem, 3rem);
  line-height: 1.08;
  letter-spacing: -0.022em;
}

.display-md {
  font-size: clamp(1.5rem, 1.6vw + 0.5rem, 2rem);
  line-height: 1.15;
  letter-spacing: -0.018em;
}

.serif-italic {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "SOFT" 100;
}

.kicker {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker-accent {
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

.muted-2 {
  color: var(--muted-2);
}

.eyebrow-rule {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--ink);
  vertical-align: middle;
  margin-right: 14px;
  opacity: 0.6;
}

/* Lead paragraph */
.lede {
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  line-height: 1.55;
  color: var(--muted);
}

/* ------------------------------- Layout -------------------------------- */

.container-x {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.container-sm {
  max-width: 820px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.section {
  padding-block: clamp(64px, 9vw, 112px);
}

.section-tight {
  padding-block: clamp(48px, 6vw, 80px);
}

.section-divider {
  border-top: 1px solid var(--line);
}

/* --------------------------------- Nav --------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 238, 0.82);
  backdrop-filter: saturate(1.1) blur(10px);
  -webkit-backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 200ms var(--ease);
}

.nav-link:hover {
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  color: var(--ink);
}

.nav-group {
  display: none;
  gap: 28px;
  align-items: center;
}

@media (min-width: 860px) {
  .nav-group { display: flex; }
}

.nav-aux {
  font-size: 13px;
  color: var(--muted);
  position: relative;
  padding-left: 18px;
}

.nav-aux::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 1px;
  background: var(--line);
  transform: translateY(-50%);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: background 200ms var(--ease), color 200ms var(--ease),
              border-color 200ms var(--ease), box-shadow 200ms var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--accent);
}

.btn-primary {
  background: var(--ink);
  color: #FDFCF9;
  border-color: var(--ink);
}

.btn-primary:hover {
  background: #000;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(17, 17, 17, 0.18);
}

.btn-ghost:hover {
  background: rgba(17, 17, 17, 0.04);
  border-color: rgba(17, 17, 17, 0.28);
}

.btn-accent {
  background: var(--accent);
  color: #FDFCF9;
  border-color: var(--accent);
}

.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-link {
  background: transparent;
  color: var(--ink);
  border: none;
  height: auto;
  padding: 0;
  font-weight: 500;
  text-decoration: none;
  position: relative;
}

.btn-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  opacity: 0.25;
  transition: opacity 200ms var(--ease);
}

.btn-link:hover::after { opacity: 0.6; }

.btn-lg {
  height: 52px;
  padding: 0 28px;
  font-size: 15.5px;
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13.5px;
}

.btn .arrow {
  width: 14px;
  height: 14px;
  transition: transform 200ms var(--ease);
}
.btn:hover .arrow { transform: translateX(2px); }

/* --------------------------------- Card -------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.card-flat {
  background: transparent;
  border: none;
  padding: 0;
}

.card-elevated {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.03), 0 1px 0 rgba(17, 17, 17, 0.02);
}

/* ------------------------------- Kicker rule --------------------------- */

.accent-rule {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--ink);
  margin-bottom: 18px;
  opacity: 0.85;
}

.accent-rule-accent {
  background: var(--accent);
}

/* ------------------------------ Feature row ---------------------------- */

.feature-row {
  display: flex;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.feature-row .icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--ink);
  stroke-width: 1.25;
}

.feature-row h4 {
  font-weight: 500;
  font-size: 16.5px;
  margin-bottom: 4px;
  color: var(--ink);
}

.feature-row p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

/* ---------------------------- Segmented toggle ------------------------- */

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  position: relative;
  isolation: isolate;
}

.segmented label {
  position: relative;
  z-index: 1;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  transition: color 200ms var(--ease);
  white-space: nowrap;
}

.segmented .seg-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 4px);
  background: var(--ink);
  border-radius: 999px;
  transition: transform 240ms var(--ease);
  z-index: 0;
}

.segmented input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented input[type="checkbox"]:checked ~ .seg-thumb {
  transform: translateX(100%);
}

.segmented:has(input[type="checkbox"]:focus-visible) {
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--accent);
}

.segmented input[type="checkbox"]:not(:checked) ~ .seg-label-monthly { color: #FDFCF9; }
.segmented input[type="checkbox"]:checked ~ .seg-label-yearly  { color: #FDFCF9; }

.segmented .save-chip {
  font-size: 11px;
  font-weight: 500;
  color: var(--success);
  margin-left: 6px;
  letter-spacing: 0.02em;
}

.segmented input[type="checkbox"]:checked ~ .seg-label-yearly .save-chip { color: #B7D9C1; }

/* Back-compat: the existing app.js animates `.pricing-toggle:checked ~ .dot`.
   We keep that selector working by aliasing the thumb. */

.pricing-toggle:checked ~ .dot {
  transform: translateX(100%);
}

/* --------------------------- Pricing plan cards ------------------------ */

.plan-grid {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

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

.plan {
  display: flex;
  flex-direction: column;
  padding: 36px 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
  background: var(--surface);
}

@media (min-width: 900px) {
  .plan {
    border-bottom: none;
    border-right: 1px solid var(--line);
  }
  .plan:last-child { border-right: none; }
}

@media (max-width: 899.98px) {
  .plan:last-child { border-bottom: none; }
}

.plan-featured {
  background: #FDFCF9;
}

.plan-featured::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-top: 2px solid var(--ink);
}

.plan-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.plan-recommended {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}
.plan-recommended::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--ink);
  display: inline-block;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.plan-price .amount {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variation-settings: "SOFT" 40;
}

.plan-price .period {
  color: var(--muted);
  font-size: 15px;
}

.plan-billing {
  font-size: 13px;
  color: var(--muted-2);
  margin-bottom: 26px;
}

.plan-features {
  list-style: none;
  margin: 0 0 32px 0;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-features li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.plan-features li::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'><path d='M3 8.2l3 3 7-7' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center / contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'><path d='M3 8.2l3 3 7-7' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center / contain;
}

.plan-features li.included-in::before {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3 8h10' stroke='black' stroke-width='1.4' stroke-linecap='round'/></svg>") no-repeat center / contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3 8h10' stroke='black' stroke-width='1.4' stroke-linecap='round'/></svg>") no-repeat center / contain;
  background: var(--muted-2);
}

.plan-features li.included-in {
  color: var(--muted);
  font-style: italic;
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: 14.5px;
  font-variation-settings: "SOFT" 80;
}

.plan-cta {
  width: 100%;
}

/* --------------------------- Steps (01 / 02 / 03) ---------------------- */

.steps {
  display: grid;
  gap: 48px;
}

@media (min-width: 780px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 64px; }
}

.step-num {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-style: italic;
  font-size: 30px;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  font-variation-settings: "SOFT" 100;
}

.step h3 {
  font-family: "Fraunces", serif;
  font-weight: 450;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  color: var(--ink);
}

.step p {
  color: var(--muted);
  line-height: 1.55;
}

/* -------------------------- Services grid (AV) ------------------------ */

.svc-grid {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

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

.svc {
  padding: 32px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 780px) {
  .svc { border-right: 1px solid var(--line); }
  .svc-grid > .svc:nth-child(3n) { border-right: none; }
  .svc-grid > .svc:nth-last-child(-n+3) { border-bottom: none; }
}

@media (max-width: 779.98px) {
  .svc-grid > .svc:last-child { border-bottom: none; }
}

.svc svg.icon {
  width: 22px;
  height: 22px;
  color: var(--ink);
  stroke-width: 1.25;
  margin-bottom: 8px;
}

.svc h3 {
  font-family: "Fraunces", serif;
  font-weight: 450;
  font-size: 20px;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.svc p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
  margin-bottom: 8px;
}

.svc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.svc li::before {
  content: "—  ";
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

/* -------------------------- Steps (4-up variant) ---------------------- */

.steps-4 {
  display: grid;
  gap: 48px;
  grid-template-columns: 1fr;
}

@media (min-width: 780px) {
  .steps-4 { grid-template-columns: repeat(4, 1fr); gap: 48px; }
}

/* -------------------------------- Worries ------------------------------ */

.worries {
  display: grid;
  gap: 40px;
}

@media (min-width: 780px) {
  .worries { grid-template-columns: repeat(3, 1fr); gap: 48px; }
}

.worry h3 {
  font-family: "Fraunces", serif;
  font-weight: 450;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
  color: var(--ink);
}

.worry p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 15.5px;
}

/* -------------------------------- Testimonial -------------------------- */

.testimonial {
  padding: clamp(48px, 6vw, 80px) 0;
  text-align: center;
}

.testimonial blockquote {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.25rem, 1.4vw + 0.9rem, 1.6rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 36ch;
  margin: 0 auto;
  font-variation-settings: "SOFT" 80;
}

.testimonial .attrib {
  margin-top: 28px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
}

.monogram {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--ink);
  color: #FDFCF9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

/* ----------------------------------- FAQ ------------------------------- */

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-row {
  border-bottom: 1px solid var(--line);
}

.faq-row > button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 4px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: color 200ms var(--ease);
}

.faq-row > button:hover { color: var(--accent); }

.faq-row .chev {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 240ms var(--ease);
}

.faq-row > button[aria-expanded="true"] .chev {
  transform: rotate(180deg);
  color: var(--ink);
}

.faq-content {
  padding: 0 4px 24px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15.5px;
  max-width: 65ch;
}

/* --------------------------------- Footer ------------------------------ */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 32px;
  background: var(--paper);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 200ms var(--ease);
}

.site-footer a:hover { color: var(--ink); }

.footer-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
}

@media (min-width: 780px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-blurb {
  color: var(--muted);
  max-width: 42ch;
  line-height: 1.55;
}

.footer-heading {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 18px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
  align-items: flex-start;
  color: var(--muted-2);
  font-size: 13px;
}

@media (min-width: 780px) {
  .footer-bottom { flex-direction: row; align-items: center; }
}

/* ---------------------------------- Misc ------------------------------- */

.trust-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  color: var(--muted);
  font-size: 13.5px;
}

.trust-dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--muted-2);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 780px) {
  .stat-row { grid-template-columns: repeat(4, 1fr); }
}

.stat-value {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: clamp(1.75rem, 1.6vw + 1rem, 2.4rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 6px;
}

.stat-label {
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: 0.04em;
}

/* ------------------------------ Hero frame ----------------------------- */

.hero {
  padding-block: clamp(64px, 10vw, 120px);
  position: relative;
  overflow: hidden;
}

.hero-mark {
  position: absolute;
  right: -80px;
  top: 50%;
  transform: translateY(-50%);
  width: min(46vw, 520px);
  height: min(46vw, 520px);
  opacity: 0.06;
  pointer-events: none;
  color: var(--ink);
}

@media (max-width: 860px) {
  .hero-mark { display: none; }
}

/* ----------------------------- Atom utilities -------------------------- */

.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------- Motion reduced --------------------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
  html { scroll-behavior: auto; }
}
