/* Markitdown — Mobbin monochrome system. Ink #141414 on canvas #ffffff,
   structure from neutral tints, stadium-pill interaction language. */

:root {
  --ink: #141414;
  --ink-soft: #262626;
  --canvas: #ffffff;
  --canvas-soft: #f3f3f3;
  --field: #f0f0f0;
  --hairline-soft: #f0f0f0;
  --hairline: #e0e0e0;
  --muted: #707070;
  --faint: #adadad;
  --accent: #0066ff;
  --on-primary: #ffffff;
  --rounded-sm: 16px;
  --rounded-md: 24px;
  --rounded-full: 9999px;
  --font: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

img, svg, video, canvas { max-width: 100%; height: auto; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 450;
  font-size: 16px;
  line-height: 1.38;
  color: var(--ink);
  background: var(--canvas);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

a { color: inherit; }

/* Floating pill nav */
.nav-wrap {
  position: sticky;
  top: 12px;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 12px 16px 0;
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(880px, 100%);
  padding: 10px 10px 10px 20px;
  background: var(--canvas-soft);
  border-radius: var(--rounded-full);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
}

.brand-squircle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 30%;
  background: var(--ink);
  color: var(--on-primary);
  font-weight: 650;
  font-size: 16px;
}

.brand-word { font-size: 16px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  padding: 10px 14px;
  border-radius: var(--rounded-full);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
}

.nav-link:hover { background: var(--field); }

.nav-email {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
  padding: 0 8px;
}

.nav-cta-form { margin: 0; }

/* Pills */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: var(--rounded-full);
  background: var(--ink);
  color: var(--on-primary);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:hover { background: var(--ink-soft); }
.btn-primary:disabled { opacity: 0.45; cursor: wait; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-full);
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-soft {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: var(--rounded-full);
  background: var(--canvas-soft);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

/* Page — fluid container, capped for ultrawide */
.page {
  flex: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 80px) clamp(16px, 4vw, 24px) 0;
}

.hero { text-align: center; max-width: 820px; margin: 0 auto; padding-inline: 4px; }
.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 2rem + 4.5vw, 5rem);
  font-weight: 650;
  line-height: 1.0;
  text-wrap: balance;
}
.hero-sub {
  margin: 24px auto 0;
  max-width: 620px;
  font-size: clamp(1rem, 0.9rem + 1vw, 1.25rem);
  font-weight: 300;
  line-height: 1.38;
  color: var(--ink);
  text-wrap: pretty;
}
.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 80px;
}

.feature-card {
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--rounded-md);
  padding: 32px;
}

.feature-card h3 { margin: 0 0 12px; font-size: 24px; font-weight: 650; line-height: 1.25; }
.feature-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.43; }

.faq { margin: 80px 0; display: grid; gap: 12px; }
.faq-row {
  background: var(--canvas-soft);
  border-radius: var(--rounded-sm);
  padding: 20px 24px;
  font-size: 16px;
}

/* Auth */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 0 80px;
}

.auth-card {
  width: min(440px, 100%);
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--rounded-md);
  padding: 32px;
}

.auth-card h1 { margin: 0; font-size: 32px; font-weight: 650; line-height: 1.13; }
.auth-card .auth-sub { margin: 12px 0 24px; color: var(--muted); font-size: 14px; }

.text-input {
  width: 100%;
  border: none;
  background: var(--field);
  border-radius: var(--rounded-sm);
  padding: 12px 16px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 12px;
}

.text-input::placeholder { color: var(--faint); }
.text-input:focus { outline: 2px solid var(--ink); outline-offset: 0; }

.auth-card .btn-primary { width: 100%; margin-top: 8px; }
.auth-card .btn-outline { width: 100%; margin-top: 12px; }
.auth-error {
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-sm);
  padding: 12px 16px;
  font-size: 14px;
  margin: 0 0 16px;
}
.auth-fine { color: var(--faint); font-size: 12px; margin: 16px 0 0; text-align: center; }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); }

/* Markitdown converter — chromeless full-viewport app screen.
   The page itself never scrolls; the two panes scroll internally. */

body.is-app {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.page-app {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px;
  height: 100vh;
  height: 100dvh;
  display: flex;
}

.md-app {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
  /* Locked geometry: equal panes, fixed rail. minmax(0, …) kills content
     minimums so tracks can never distort. */
  grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr);
  gap: 12px;
}

body.is-app .md-pane {
  min-height: 0;
  min-width: 0;
  height: 100%;
  padding: 12px;
}

.md-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}

.md-rail .btn-primary,
.md-rail .btn-outline { width: 100%; }

#md-input {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  resize: none;
  border: none;
  background: var(--field);
  border-radius: var(--rounded-sm);
  padding: 16px;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
}

#md-input:focus { outline: 2px solid var(--ink); }

.md-output {
  flex: 1;
  min-height: 0;
  height: 100%;
  background: var(--canvas-soft);
  border-radius: var(--rounded-sm);
  padding: 24px;
  overflow-y: auto;
  overflow-x: auto;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.md-output .md-empty { color: var(--faint); }
.md-output h1 { font-size: 32px; font-weight: 650; line-height: 1.13; margin: 0 0 12px; }
.md-output h2 { font-size: 20px; font-weight: 600; margin: 24px 0 8px; }
.md-output table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.md-output th, .md-output td { text-align: left; padding: 8px; border-bottom: 1px solid var(--canvas-soft); }
.md-output th { font-size: 12px; color: var(--muted); }
.md-output hr { border: none; border-top: 1px solid var(--hairline); margin: 20px 0; }
.md-output blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--canvas);
  border-radius: var(--rounded-sm);
  color: var(--muted);
}
.md-output ul { padding-left: 20px; }
.md-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--ink);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Footer — polarity inversion */
.footer {
  margin-top: 120px;
  background: var(--ink);
  color: var(--on-primary);
  border-radius: var(--rounded-md) var(--rounded-md) 0 0;
}

.footer-inner { width: min(1120px, 100%); margin: 0 auto; padding: clamp(48px, 7vw, 80px) clamp(16px, 4vw, 24px) 40px; }
.footer-word { font-size: clamp(2rem, 1.5rem + 3vw, 2.75rem); font-weight: 650; line-height: 1.13; text-wrap: balance; }
.footer-tag { color: var(--faint); margin: 12px 0 0; }
.footer-cols { display: flex; gap: 80px; margin-top: 32px; }
.footer-col { display: grid; gap: 8px; }
.footer-col a { color: var(--faint); text-decoration: none; font-size: 14px; }
.footer-col a:hover { color: var(--on-primary); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-soft);
  color: var(--faint);
  font-size: 12px;
}

/* Responsive — extreme small (320px) to extreme large (2560px+) */

/* 2xl: ultrawide — cap the measure, let canvas breathe around it */
@media (min-width: 1536px) {
  .page { width: min(1280px, 100%); }
  .page-app { width: 100%; max-width: none; }
  .nav-pill { width: min(1020px, 100%); }
  .footer-inner { width: min(1280px, 100%); }
  .md-pane { min-height: 64vh; }
}

/* lg: small laptop / landscape tablet */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); margin-top: 64px; }
  .card-grid .feature-card:last-child { grid-column: 1 / -1; }
  .faq { margin: 64px 0; }
  .footer { margin-top: 80px; }
}

/* md: narrow screens — panes stay LEFT and RIGHT at every width.
   Only the chrome tightens; the 3-column grid never stacks. */

/* md-: phones */
@media (max-width: 840px) {
  .card-grid { grid-template-columns: 1fr; }
  .nav-pill { gap: 12px; padding: 8px 8px 8px 14px; }
  .nav-links { gap: 0; }
  .nav-links .nav-link { display: none; }
  .nav-email { display: none; }
  .footer-cols { flex-wrap: wrap; gap: 32px; }
}

/* sm: narrow phones */
@media (max-width: 640px) {
  .nav-wrap { top: 8px; padding: 8px 12px 0; }
  .hero-ctas .btn-primary,
  .hero-ctas .btn-outline,
  .hero-ctas .btn-soft { flex: 1 1 100%; }
  .feature-card { padding: 24px; }
  .faq-row { padding: 16px; font-size: 14px; }
  .auth-wrap { padding: 24px 0 64px; }
  .auth-card { padding: 24px; }
  .page-app { padding: 8px; }
  /* Small screens: input on top, buttons in the middle, output at the
     bottom. Still exactly one viewport tall; panes scroll internally. */
  .md-app {
    gap: 8px;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto 1fr;
  }
  body.is-app .md-pane { padding: 8px; }
  .md-rail { flex-direction: row; gap: 8px; }
  .md-rail .btn-primary,
  .md-rail .btn-outline { flex: 1; }
  .md-rail .btn-primary,
  .md-rail .btn-outline { padding: 0 12px; font-size: 13px; }
  .md-output { padding: 16px; }
  .md-output table { display: block; overflow-x: auto; font-size: 12px; }
  .footer-cols { flex-direction: column; gap: 24px; margin-top: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}

/* xs: extreme small (≤400px) — logomark-only nav, full-bleed stacking */
@media (max-width: 400px) {
  body { font-size: 15px; }
  .brand-word { display: none; }
  .nav-pill .btn-primary { padding: 0 16px; font-size: 14px; }
  .btn-primary, .btn-outline, .btn-soft { min-height: 48px; }
  .text-input { font-size: 16px; } /* no iOS auto-zoom */
}

/* Touch: keep every target comfortably tappable */
@media (pointer: coarse) {
  .nav-link { padding: 12px 16px; }
  .footer-col a { padding: 6px 0; }
}

/* Reduced motion: static cursor, no blink */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .md-cursor { animation: none; }
}
