/* ==========================================================================
   SureTrace — Shared Stylesheet
   Pure CSS. No frameworks.
   ========================================================================== */

/* ------------------------------------------------------------------ Fonts */
@font-face {
  font-family: "Profa";
  src: url("../fonts/Profa-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Profa";
  src: url("../fonts/Profa-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Profa";
  src: url("../fonts/Profa-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Profa";
  src: url("../fonts/Profa-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------- Tokens */
:root {
  --bg: #F8F9FA;
  --text: #1A1A1A;
  --white: #FFFFFF;
  --accent: #0D9488;
  --accent-hover: #0B7A6E;
  --warning: #D97706;
  --error: #DC2626;
  --success: #16A34A;
  --border: #E5E7EB;
  --muted: #6B7280;

  --font-body: "Profa", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1152px;
  --radius-card: 8px;
  --radius-btn: 6px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

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

/* ------------------------------------------------------------ Typography */
h1, h2, h3, h4 {
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
}

h3 {
  font-size: 1.5rem;
  font-weight: 500;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

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

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

.muted {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 300;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 400;
  word-break: break-all;
}

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

.section {
  padding: 64px 0;
}

.section--tight {
  padding: 40px 0;
}

.text-center {
  text-align: center;
}

/* --------------------------------------------------------------- Wordmark */
.wordmark {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
}
.wordmark:hover {
  text-decoration: none;
  color: var(--text);
}
.wordmark .accent {
  color: var(--accent);
}

/* ---------------------------------------------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.site-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  position: relative;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after  { top: 7px; }

.nav-toggle[aria-expanded="true"] span {
  background: transparent;
}
.nav-toggle[aria-expanded="true"] span::before {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------------------------------------------------------- Footer */
.site-footer {
  flex-shrink: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer .footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 40px 0;
  flex-wrap: wrap;
}

.footer-brand .wordmark {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.footer-tagline {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 300;
  max-width: 320px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-weight: 400;
}
.footer-links a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1;
  min-height: 44px;
  padding: 13px 24px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn--warning {
  background: var(--warning);
  color: #fff;
}
.btn--warning:hover {
  background: #B45309;
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--outline:hover {
  background: var(--white);
  border-color: var(--accent);
  color: var(--accent);
}

.btn--block {
  width: 100%;
}

.btn--lg {
  font-size: 1.05rem;
  padding: 15px 30px;
}

/* ---------------------------------------------------------------- Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

/* ----------------------------------------------------------------- Hero */
.hero {
  position: relative;
  padding: 96px 0;
  overflow: hidden;
  background-color: var(--bg);
  /* Subtle CSS-only geometric pattern */
  background-image:
    linear-gradient(rgba(13, 148, 136, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 148, 136, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 0%, var(--bg) 78%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero .subtitle {
  font-size: 1.2rem;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 32px;
  line-height: 1.5;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

/* --------------------------------------------------------- Section head */
.section-head {
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
}
.section-head h2 {
  margin-bottom: 12px;
}
.section-head p {
  color: var(--muted);
  font-size: 1.05rem;
}

/* -------------------------------------------------------------- Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px 24px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(13, 148, 136, 0.1);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.step p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ------------------------------------------------------------- Features */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
  background: rgba(13, 148, 136, 0.1);
  color: var(--accent);
  margin-bottom: 16px;
}
.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.feature p {
  color: var(--muted);
  font-size: 0.925rem;
}

/* --------------------------------------------------------- Trust band */
.trust {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trust-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.trust p {
  color: var(--text);
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.trust .trust-note {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 300;
}

/* --------------------------------------------------------------- Prose */
.prose {
  max-width: 768px;
  margin: 0 auto;
}
.prose h1 {
  margin-bottom: 8px;
}
.prose .lead {
  font-size: 1.15rem;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 40px;
}
.prose h2 {
  font-size: 1.5rem;
  margin: 40px 0 12px;
}
.prose h3 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
}
.prose ul {
  margin: 0 0 1rem;
  padding-left: 22px;
}
.prose li {
  margin-bottom: 6px;
}
.prose .card + .card {
  margin-top: 20px;
}

/* ----------------------------------------------------------------- FAQ */
.faq-list {
  max-width: 768px;
  margin: 0 auto;
}
.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  font-weight: 500;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after {
  transform: rotate(-135deg);
}
.faq-item .faq-answer {
  padding: 0 24px 20px;
  color: var(--muted);
}

/* ---------------------------------------------------------- Scan page */
.scan-wrap {
  max-width: 800px;
  margin: 0 auto;
}
.scan-head {
  text-align: center;
  margin-bottom: 40px;
}
.scan-head h1 {
  margin-bottom: 8px;
}
.scan-head p {
  color: var(--muted);
}

.scan-form-card {
  max-width: 600px;
  margin: 0 auto;
}

.field {
  margin-bottom: 20px;
}
.field:last-child {
  margin-bottom: 0;
}
.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.input,
.select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.select {
  font-family: var(--font-body);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
  background: var(--white);
}
.input.has-error {
  border-color: var(--error);
}
.input.has-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.field-error {
  display: none;
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 8px;
}
.field-error.show {
  display: block;
}

/* Banners */
.banner {
  display: none;
  padding: 14px 18px;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.banner.show { display: block; }
.banner--error {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--error);
}

/* Loading state */
.scan-loading {
  display: none;
  text-align: center;
  padding: 56px 24px;
}
.scan-loading.show { display: block; }

.spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  border: 4px solid rgba(13, 148, 136, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.scan-loading .status-text {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 500;
  min-height: 1.6em;
}
.scan-loading .status-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

/* Result */
.scan-result {
  display: none;
}
.scan-result.show { display: block; }

.result-head {
  text-align: center;
  margin-bottom: 28px;
}
.result-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.result-icon svg { width: 40px; height: 40px; }
.result-icon--clean {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}
.result-icon--flagged {
  background: rgba(217, 119, 6, 0.14);
  color: var(--warning);
}
.result-head h2 {
  font-size: 1.6rem;
}

.summary-card {
  max-width: 600px;
  margin: 0 auto 28px;
}

.summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.summary-row:last-child {
  border-bottom: none;
}
.summary-row .label {
  color: var(--muted);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.summary-row .value {
  text-align: right;
  font-weight: 500;
  word-break: break-word;
}
.summary-row .value.mono {
  font-weight: 400;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
}
.badge--clean {
  background: rgba(22, 163, 74, 0.14);
  color: var(--success);
}
.badge--flagged {
  background: rgba(217, 119, 6, 0.16);
  color: var(--warning);
}

.summary-note {
  padding: 16px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.summary-note.summary-note--warn {
  color: var(--warning);
}

.result-actions {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.result-actions .btn {
  flex: 1 1 auto;
}

/* --------------------------------------------------------- Responsive */
@media (max-width: 1024px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .hero h1 { font-size: 2.1rem; }
  .hero { padding: 64px 0; }

  .section { padding: 32px 0; }

  /* Mobile nav */
  .nav-toggle {
    display: flex;
  }
  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    display: none;
  }
  .site-nav.open {
    display: flex;
  }
  .site-nav a {
    padding: 14px 24px;
    border-bottom: none;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .site-nav a.active {
    border-bottom: none;
    background: rgba(13, 148, 136, 0.07);
  }

  .steps {
    grid-template-columns: 1fr;
  }
  .features {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 24px;
  }

  .result-actions {
    flex-direction: column;
  }
  .result-actions .btn {
    width: 100%;
  }

  .summary-row {
    flex-direction: column;
    gap: 4px;
  }
  .summary-row .value {
    text-align: left;
  }
}
