/**
 * Third Band - drafting for lawyers and firms
 * Production Design System & Stylesheet (css/site.css)
 * Domain: thirdband.in
 */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,300..900;1,300..900&family=Lora:ital,wght@0,400..700;1,400..700&family=Space+Grotesk:wght@400..700&display=swap');

:root {
  /* Brand color tokens mirroring Third Band Pilot Mac app */
  --background: #f8fbfd;
  --surface: #fcfdfe;
  --surface-low: #f3f7fa;
  --surface-container: #edf3f7;
  --surface-high: #e6eef4;
  --on-surface: #14202a;
  --on-surface-variant: #3d4a55;
  --on-surface-subtle: #6c7c8a;
  
  --primary: #a85a48;
  --primary-hover: #8f4a3a;
  --primary-container: #f0e0da;
  --primary-text: #ffffff;

  --secondary: #3d6b8a;
  --secondary-hover: #2f5570;
  --secondary-container: #d4e4ef;
  --secondary-text: #ffffff;

  --outline: #d0dce6;
  --outline-variant: #e6eef4;
  
  --brand-accent: #ac2d00;
  --wordmark-mid: #0c134d;

  --success: #2e7d32;
  --success-bg: #e8f5e9;

  /* Typography */
  --font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Shadows - low opacity, large subtle blur */
  --shadow-sm: 0 1px 3px rgba(20, 32, 42, 0.04), 0 1px 2px rgba(20, 32, 42, 0.02);
  --shadow-md: 0 4px 16px -2px rgba(20, 32, 42, 0.06), 0 2px 6px -1px rgba(20, 32, 42, 0.03);
  --shadow-lg: 0 12px 32px -4px rgba(20, 32, 42, 0.08), 0 4px 12px -2px rgba(20, 32, 42, 0.04);
  --shadow-floating: 0 24px 48px -12px rgba(12, 19, 77, 0.12);

  /* Layout */
  --max-width: 1200px;
  --nav-height: 88px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

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

body {
  background-color: var(--background);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  opacity: 0;
  animation: pageFadeIn 0.35s ease-out forwards;
}

@keyframes pageFadeIn {
  to { opacity: 1; }
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--on-surface);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 4vw, 3.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p { color: var(--on-surface-variant); }

a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 200ms ease;
}
a:hover {
  color: var(--secondary-hover);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 180ms ease, box-shadow 200ms ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-text);
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(168, 90, 72, 0.25);
}
.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--secondary);
  border-color: var(--outline);
}
.btn-secondary:hover {
  background-color: var(--surface-low);
  border-color: var(--secondary);
  color: var(--secondary-hover);
  transform: scale(1.02);
}
.btn-secondary:active {
  transform: scale(0.98);
}

.btn-outline {
  background-color: transparent;
  color: var(--on-surface);
  border-color: var(--outline);
}
.btn-outline:hover {
  background-color: var(--surface-low);
  border-color: var(--on-surface-subtle);
}

.signup-off {
  display: inline-block;
  cursor: not-allowed;
}
.signup-off-block {
  display: block;
}
.signup-off > .is-inactive {
  pointer-events: none;
}

button.btn.is-inactive,
button.btn.is-inactive:hover,
button.btn.is-inactive:focus,
button.btn.is-inactive:active,
a.btn.is-inactive,
a.btn.is-inactive:hover,
a.btn.is-inactive:focus,
a.btn.is-inactive:active {
  background-color: #d5d0ca;
  color: #7a736c;
  border-color: #d5d0ca;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
  opacity: 1;
}

button.sheet-link.is-inactive,
button.sheet-link.is-inactive:hover,
a.is-inactive:not(.btn),
a.is-inactive:not(.btn):hover {
  color: #8a8178;
  background: none;
  border-color: transparent;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
  text-decoration: none;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(248, 251, 253, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 250ms ease, background-color 250ms ease, box-shadow 250ms ease;
  height: var(--nav-height);
}
.site-header.is-scrolled {
  background-color: rgba(248, 251, 253, 0.96);
  border-bottom-color: var(--outline);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--on-surface);
  text-decoration: none;
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.brand-link img, .brand-link svg, .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 22%;
  object-fit: contain;
}
.site-header .brand-link img,
.site-header .brand-link svg {
  width: 56px;
  height: 56px;
}
.site-header .brand-wordmark {
  font-size: 1.7rem;
}
.site-footer .brand-link img,
.site-footer .brand-link svg {
  width: 40px;
  height: 40px;
}
.brand-wordmark {
  display: inline;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--wordmark-mid);
}
.wm-mid { color: var(--wordmark-mid); }
.wm-accent { color: var(--brand-accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  color: var(--on-surface-variant);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 180ms ease;
  padding: 6px 2px;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--on-surface);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Auth state toggles via .is-signed-in on body */
.auth-signed-out { display: inline-flex; gap: 10px; align-items: center; }
.auth-signed-in { display: none; gap: 10px; align-items: center; }
body.is-signed-in .auth-signed-out { display: none !important; }
body.is-signed-in .auth-signed-in { display: inline-flex !important; }
.nav-links .auth-signed-in { display: none; }
body.is-signed-in .nav-links .auth-signed-in { display: list-item !important; }
.site-footer li.auth-signed-in { display: none; }
body.is-signed-in .site-footer li.auth-signed-in { display: list-item !important; }
.site-footer .footer-col.auth-signed-in { display: none; }
body.is-signed-in .site-footer .footer-col.auth-signed-in { display: block !important; }
.nav-text-btn {
  background: none;
  border: none;
  padding: 6px 2px;
  color: var(--on-surface-variant);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
}
.nav-text-btn:hover { color: var(--primary); }

.sheet-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--secondary);
  font-weight: 600;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

/* Motion & Reveal */
.reveal-item {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1), transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal-item.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger utilities */
.reveal-group > *:nth-child(1) { transition-delay: 0ms; }
.reveal-group > *:nth-child(2) { transition-delay: 70ms; }
.reveal-group > *:nth-child(3) { transition-delay: 140ms; }
.reveal-group > *:nth-child(4) { transition-delay: 210ms; }
.reveal-group > *:nth-child(5) { transition-delay: 280ms; }
.reveal-group > *:nth-child(6) { transition-delay: 350ms; }

/* Cards & Surfaces */
.card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.card:hover {
  border-color: #bccad6;
  box-shadow: var(--shadow-md);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 9999px;
  background-color: var(--surface-container);
  color: var(--secondary);
  border: 1px solid var(--outline);
}
.badge-primary {
  background-color: var(--primary-container);
  color: var(--primary);
  border-color: #e5cbbf;
}

/* Hero Section */
.hero {
  padding: 72px 0 48px;
  text-align: center;
}
.hero-pill {
  margin-bottom: 20px;
}
.hero-title {
  max-width: 880px;
  margin: 0 auto 20px;
}
.hero-subtitle {
  max-width: 680px;
  margin: 0 auto 32px;
  font-size: 1.2rem;
  line-height: 1.6;
}
.hero-stage {
  position: relative;
  max-width: 420px;
  margin: 0 auto 48px;
  min-height: 52px;
  overflow: hidden;
  transition: height 720ms cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-step {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 720ms cubic-bezier(0.22, 1, 0.36, 1), transform 720ms cubic-bezier(0.22, 1, 0.36, 1), visibility 720ms;
  pointer-events: none;
}
.hero-step.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
.hero-step .form-group { width: 100%; text-align: left; }
.form-error {
  width: 100%;
  margin: 0;
  min-height: 1.2em;
  text-align: center;
  color: var(--error, #b3261e);
  font-size: 0.9rem;
}
.hero-note {
  width: 100%;
  margin: 0;
  text-align: center;
  color: var(--on-surface-variant);
  line-height: 1.55;
}
.hero-switch {
  width: 100%;
  margin: 0;
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 0.9rem;
}

/* Screenshot Frame */
.app-frame-wrapper {
  margin: 20px auto 0;
  max-width: 1040px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(208, 220, 230, 0.4) 0%, rgba(208, 220, 230, 0.1) 100%);
  border: 1px solid var(--outline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-floating);
}
.app-frame {
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--outline);
  position: relative;
}
.app-frame img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.screen-montage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--surface-low);
}
.screen-montage figure {
  margin: 0;
  position: relative;
  min-height: 180px;
  overflow: hidden;
  background: var(--surface);
}
.screen-montage img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: left top;
  display: block;
}
.agents {
  margin: 8px auto 0;
  max-width: 1100px;
}
.agents h2 {
  margin-bottom: 28px;
  font-size: 1.35rem;
}
.postits {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px 18px;
  padding: 8px 0 12px;
}
.postits li {
  width: 240px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 22px 16px;
  background: #fff6df;
  color: #1a2330;
  text-align: center;
  border-radius: 3px;
  box-shadow:
    0 14px 28px rgba(28, 36, 48, 0.14),
    0 2px 0 rgba(255, 255, 255, 0.65) inset;
}
.postits strong {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.postits p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.45;
  color: #3a4553;
}
.postits li:nth-child(odd) { transform: rotate(-2.4deg); }
.postits li:nth-child(even) { transform: rotate(2.1deg); }
.postits li:nth-child(3) { background: #f6e4d8; }
.postits li:nth-child(4) { background: #e5f0f6; }
.postits li:nth-child(5) { background: #f8efe4; }
.postits li:nth-child(6) { background: #efe6f2; }
.postits li:nth-child(7) { background: #e8f3ea; }
.section-padding {
  padding: 72px 0;
}
.section-muted {
  background: var(--surface-low);
}
.section-header {
  max-width: 720px;
  margin: 0 auto 36px;
  text-align: center;
}
.section-header p {
  margin-top: 12px;
  color: var(--on-surface-variant);
  font-size: 1.05rem;
  line-height: 1.6;
}
.story-grid,
.modes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.story-grid h3,
.modes-grid h3 {
  margin: 12px 0 8px;
  font-size: 1.25rem;
}
.story-grid p,
.modes-grid p,
.plain-list {
  color: var(--on-surface-variant);
  line-height: 1.6;
}
.plain-list {
  margin: 8px 0 0;
  padding-left: 1.1rem;
}
.plain-list li + li {
  margin-top: 8px;
}
.story-aside,
.story-note {
  max-width: 760px;
  margin: 28px auto 0;
  text-align: center;
  color: var(--on-surface-variant);
  line-height: 1.6;
}
.story-note a {
  color: var(--secondary);
  font-weight: 600;
}
.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.faq-item h4 {
  margin-bottom: 8px;
}
.faq-item p {
  color: var(--on-surface-variant);
  line-height: 1.6;
}
.pricing-teaser-card {
  max-width: 720px;
  margin: 36px auto 0;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  box-shadow: var(--shadow-sm);
}

/* Grid Sections */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Pull quote */
.pull-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--on-surface);
  line-height: 1.6;
  border-left: 3px solid var(--primary);
  padding-left: 20px;
  margin: 40px 0;
}

/* Accordion */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto;
}
.accordion-item {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 200ms ease;
}
.accordion-item.is-open {
  border-color: var(--secondary);
}
.accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: transparent;
  border: none;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--on-surface);
  text-align: left;
  cursor: pointer;
}
.accordion-header .icon {
  transition: transform 250ms ease;
  color: var(--secondary);
  flex-shrink: 0;
  margin-left: 16px;
}
.accordion-item.is-open .accordion-header .icon {
  transform: rotate(180deg);
}
.accordion-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 250ms ease, opacity 250ms ease, padding 250ms ease;
  padding: 0 24px;
}
.accordion-item.is-open .accordion-content {
  max-height: 400px;
  opacity: 1;
  padding: 0 24px 20px;
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.data-table th {
  background: var(--surface-low);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--on-surface);
  border-bottom: 1px solid var(--outline);
  font-family: var(--font-heading);
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--outline-variant);
  color: var(--on-surface-variant);
  transition: background-color 150ms ease;
}
.data-table tbody tr:hover td {
  background-color: var(--surface-low);
  color: var(--on-surface);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Form inputs */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}
.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--on-surface);
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(61, 107, 138, 0.15);
}
.form-input:disabled, .form-input[readonly] {
  background: var(--surface-low);
  color: var(--on-surface-subtle);
  cursor: not-allowed;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--outline);
  background: var(--surface-low);
  padding: 56px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
}
.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  color: var(--on-surface);
}
.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 10px;
}
.footer-col a {
  color: var(--on-surface-variant);
  font-size: 0.9rem;
}
.footer-col a:hover {
  color: var(--primary);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--outline);
  font-size: 0.85rem;
  color: var(--on-surface-subtle);
}

/* Accessibility & Reduced motion */
:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }
  .btn-primary:hover, .btn-secondary:hover {
    transform: none !important;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .story-grid, .modes-grid { grid-template-columns: 1fr; }
  .screen-montage { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; } /* hamburger or simplified */
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; }
}
