/* ==========================================================================
   DocShield AI — Stylesheet
   Table of contents:
   1. Tokens
   2. Reset & base
   3. Layout helpers
   4. Buttons
   5. Navbar
   6. Hero
   7. Verify section (dropzone / preview / result / error)
   8. How it works
   9. Technology
   10. Footer
   11. Animations
   12. Responsive
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* color */
  --charcoal-950: #12141a;
  --charcoal-900: #181b22;
  --charcoal-800: #262a34;
  --charcoal-700: #3a3f4c;
  --ink: #15171c;
  --paper: #faf9f5;
  --paper-alt: #f1efe8;
  --line: #e3e1d9;
  --line-strong: #cfccc0;
  --gray: #6e7178;
  --gray-soft: #9a9da6;
  --teal: #1f6f64;
  --teal-strong: #16544c;
  --teal-tint: #e6f1ee;
  --forged: #a5433a;
  --forged-tint: #f7eae8;
  --white: #ffffff;

  /* type */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* layout */
  --max-width: 1120px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(18, 20, 26, 0.06);
  --shadow-md: 0 8px 24px rgba(18, 20, 26, 0.08);
  --shadow-lg: 0 20px 48px rgba(18, 20, 26, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Reset & base ---------- */
* , *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@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;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}

p { margin: 0; }

a { color: inherit; }

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

button {
  font-family: inherit;
  cursor: pointer;
}

ul, ol, dl { margin: 0; padding: 0; list-style: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -3rem;
  background: var(--ink);
  color: var(--white);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 999;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

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

/* ---------- 3. Layout helpers ---------- */
.section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--teal-tint);
  margin: 0 0 0.9rem;
}
.eyebrow--dark { color: var(--teal); }

.section__heading {
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem);
  font-weight: 600;
  max-width: 34ch;
}
.section__heading--light { color: var(--white); }

.section__sub {
  margin-top: 0.85rem;
  max-width: 52ch;
  color: var(--gray);
  font-size: 1.02rem;
}
.section__sub--light { color: #b7bcc5; }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--teal-strong); box-shadow: var(--shadow-md); }
.btn--primary:disabled {
  background: var(--line-strong);
  color: var(--gray);
  cursor: not-allowed;
  box-shadow: none;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--ink); background: var(--paper-alt); }

.btn--text {
  background: transparent;
  color: var(--gray);
  padding: 0.6rem 0.2rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn--text:hover { color: var(--ink); }

/* ---------- 5. Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 245, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.navbar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark { color: var(--teal); display: inline-flex; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}
.brand__ai { color: var(--teal); }

.navbar__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.navbar__links a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray);
  transition: color 0.15s var(--ease);
}
.navbar__links a:hover { color: var(--ink); }
.navbar__links a.navbar__cta {
  color: var(--white);
  background: var(--ink);
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background 0.15s var(--ease);
}
.navbar__links a.navbar__cta:hover { background: var(--teal-strong); }

.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.navbar__toggle span {
  display: block;
  height: 2px;
  margin: 0 8px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.navbar__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navbar__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 1.5rem 1.25rem;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  padding: 0.75rem 0.25rem;
  border-bottom: 1px solid var(--line);
}
.mobile-menu a.navbar__cta {
  margin-top: 0.5rem;
  text-align: center;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-sm);
  border-bottom: none;
  padding: 0.75rem;
}

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  background: var(--charcoal-950);
  color: var(--white);
  overflow: hidden;
  padding: 6.5rem 1.5rem 6rem;
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, black 30%, transparent 78%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.hero .eyebrow { color: var(--teal-tint); text-align: center; }

.hero__heading {
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.14;
  color: var(--white);
}

.hero__sub {
  margin: 1.4rem auto 0;
  max-width: 52ch;
  color: #b7bcc5;
  font-size: 1.06rem;
}

.hero__actions {
  margin-top: 2.1rem;
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero .btn--ghost {
  color: var(--white);
  border-color: rgba(255,255,255,0.25);
}
.hero .btn--ghost:hover {
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.06);
}

/* ---------- 7. Verify section ---------- */
.verify {
  padding: 5.5rem 0;
  background: var(--paper);
}

.verify__panel {
  margin-top: 2.5rem;
  max-width: 760px;
}

.state { display: none; }
.state.is-active { display: block; }

/* Dropzone */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 3.6rem 2rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--teal);
  background: var(--teal-tint);
}
.dropzone.is-dragover {
  border-color: var(--teal);
  background: var(--teal-tint);
  border-style: solid;
}

.dropzone__corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  opacity: 0.9;
  transition: border-color 0.2s var(--ease);
}
.dropzone:hover .dropzone__corner,
.dropzone.is-dragover .dropzone__corner { border-color: var(--teal); }
.dropzone__corner--tl { top: 10px; left: 10px; border-right: none; border-bottom: none; border-top-left-radius: 4px; }
.dropzone__corner--tr { top: 10px; right: 10px; border-left: none; border-bottom: none; border-top-right-radius: 4px; }
.dropzone__corner--bl { bottom: 10px; left: 10px; border-right: none; border-top: none; border-bottom-left-radius: 4px; }
.dropzone__corner--br { bottom: 10px; right: 10px; border-left: none; border-top: none; border-bottom-right-radius: 4px; }

.dropzone__icon {
  color: var(--teal);
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal-tint);
  border-radius: 50%;
  margin-bottom: 0.3rem;
}

.dropzone__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
}
.dropzone__hint { color: var(--gray); font-size: 0.9rem; }

.form-error {
  margin-top: 0.9rem;
  color: var(--forged);
  background: var(--forged-tint);
  border: 1px solid #e6c9c5;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
}

/* Preview */
.preview {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.75rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.preview__image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
  background: var(--paper-alt);
}
.preview__image { width: 100%; height: 100%; object-fit: cover; }

.scan-line {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  box-shadow: 0 0 12px 1px rgba(31, 111, 100, 0.6);
  opacity: 0;
}
.scan-line.is-scanning {
  opacity: 1;
  animation: scan 1.6s ease-in-out infinite;
}

.preview__meta { display: flex; flex-direction: column; gap: 0.35rem; }
.preview__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gray);
  text-transform: uppercase;
}
.preview__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  word-break: break-word;
}
.preview__details { color: var(--gray); font-size: 0.92rem; margin-bottom: 0.6rem; }

.preview__actions {
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.analyzing-label {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--teal-strong);
  font-weight: 600;
  font-size: 0.92rem;
}

.spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--teal-tint);
  border-top-color: var(--teal);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* Result */
.result {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.75rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  animation: rise 0.4s var(--ease);
}

.result__image-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
  background: var(--paper-alt);
}
.result__image { width: 100%; height: 100%; object-fit: cover; }

.result__body { display: flex; flex-direction: column; gap: 0.35rem; }

.result__verdict {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.35rem;
}
.result__icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.result__icon::before { font-size: 1rem; line-height: 1; font-weight: 700; }

.result__label {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.result--genuine .result__icon { background: var(--teal-tint); color: var(--teal-strong); }
.result--genuine .result__icon::before { content: "\2713"; }
.result--genuine .result__label { color: var(--teal-strong); }

.result--forged .result__icon { background: var(--forged-tint); color: var(--forged); }
.result--forged .result__icon::before { content: "\2715"; }
.result--forged .result__label { color: var(--forged); }

.result__confidence {
  margin-top: 0.9rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.result__confidence-value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
}
.result__confidence-caption {
  font-size: 0.85rem;
  color: var(--gray);
  font-weight: 500;
}

.result__meter {
  margin-top: 0.6rem;
  height: 6px;
  background: var(--paper-alt);
  border-radius: 999px;
  overflow: hidden;
}
.result__meter-fill {
  height: 100%;
  width: 0%;
  background: var(--teal);
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}
.result--forged .result__meter-fill { background: var(--forged); }

.result__facts {
  margin-top: 1.1rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.result__facts dt {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 0.15rem;
}
.result__facts dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.result__body .btn { margin-top: 1.4rem; align-self: flex-start; }

/* Error panel */
.error-panel {
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  box-shadow: var(--shadow-sm);
}
.error-panel__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--forged-tint);
  color: var(--forged);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 1rem;
}
.error-panel__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}
.error-panel__message {
  color: var(--gray);
  max-width: 42ch;
  margin: 0 auto 1.4rem;
}

/* ---------- 8. How it works ---------- */
.how {
  padding: 5.5rem 0;
  background: var(--paper-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.steps {
  margin-top: 2.75rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.steps__item { position: relative; padding-top: 1.25rem; border-top: 2px solid var(--line-strong); }
.steps__index {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.05em;
  margin-bottom: 0.9rem;
}
.steps__item h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.5rem; }
.steps__item p { color: var(--gray); font-size: 0.95rem; }

/* ---------- 9. Technology ---------- */
.tech {
  padding: 5.5rem 0;
  background: var(--charcoal-950);
  color: var(--white);
}

.tech__list {
  margin-top: 2.75rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--charcoal-800);
  border: 1px solid var(--charcoal-800);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tech__list li {
  background: var(--charcoal-950);
  padding: 1.9rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tech__label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-tint);
  font-weight: 600;
}
.tech__value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}
.tech__desc {
  color: #b7bcc5;
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

/* ---------- 10. Footer ---------- */
.footer {
  background: var(--charcoal-950);
  border-top: 1px solid var(--charcoal-800);
  padding: 2.5rem 0;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  color: #8b8f99;
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--white);
}
.footer__brand .brand__mark { color: var(--teal); }
.footer__brand .brand__name { font-size: 0.98rem; }
.footer__tagline { font-size: 0.88rem; }
.footer__copyright { font-size: 0.82rem; color: #676b74; margin-top: 0.4rem; }

/* ---------- 11. Animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes scan {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.state.is-active { animation: fadeIn 0.35s var(--ease); }

/* ---------- 12. Responsive ---------- */
@media (max-width: 860px) {
  .navbar__links { display: none; }
  .navbar__toggle { display: flex; }
  .mobile-menu { display: none; }
  .mobile-menu.is-open { display: flex; }

  .tech__list { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding: 5rem 1.25rem 4.5rem; }
}

@media (max-width: 640px) {
  .preview, .result { grid-template-columns: 1fr; }
  .preview__image-wrap, .result__image-wrap { max-width: 220px; margin: 0 auto; }
  .result__facts { gap: 1.25rem; }
  .result__body .btn { align-self: stretch; }
  .preview__actions { flex-direction: column; align-items: stretch; }
  .preview__actions .btn--text { text-align: center; }
}

@media (max-width: 480px) {
  .section__inner { padding: 0 1.15rem; }
  .dropzone { padding: 2.6rem 1.25rem; }
}