:root {
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Playfair Display", "Times New Roman", serif;
}

html,
body {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* Typography defaults for all non-workspace surfaces */
body,
nav,
footer,
p,
a,
li,
span,
label,
small,
button,
input,
textarea,
select {
  font-family: var(--font-body);
  font-feature-settings: "liga" 1, "calt" 1;
}

h1,
h2,
h3,
h4,
h5,
h6,
.hero-title,
.section-heading {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.01em;
}

blockquote,
blockquote p {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand-mark {
  font-family: var(--font-heading);
}

blockquote footer,
blockquote cite {
  font-family: var(--font-body);
  letter-spacing: normal;
  font-weight: 400;
}

.nav-trigger[aria-expanded="true"] {
  background-color: rgba(31, 41, 55, 0.5);
}

[id] {
  scroll-margin-top: 80px;
}

[data-mega-dropdown] .mega-surface {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* Ensure mobile hamburger remains clickable above hero overlays */
header.marketing-header {
  z-index: 2000;
  pointer-events: auto;
}

header.marketing-header [data-mobile-toggle] {
  position: relative;
  z-index: 2001;
  pointer-events: auto;
}
header.marketing-header * {
  pointer-events: auto;
}

/* Media defaults */
img,
video {
  max-width: 100%;
  height: auto;
}

/* Mobile nav */
[data-mobile-panel] {
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

body.nav-open {
  overflow: hidden;
}

/* Responsive helpers for hero/split canvases */
.responsive-showcase {
  min-height: 240px;
  height: clamp(240px, 70vw, 520px);
}

@media (min-width: 640px) {
  .responsive-showcase {
    height: clamp(320px, 60vh, 600px);
  }
}

@media (min-width: 1024px) {
  .responsive-showcase {
    height: clamp(420px, 62vh, 720px);
  }
}

.responsive-pane {
  min-height: 240px;
  height: auto;
}

@media (min-width: 640px) {
  .responsive-pane {
    min-height: clamp(320px, 60vh, 600px);
  }
}

@media (min-width: 1024px) {
  .responsive-pane {
    min-height: clamp(420px, 62vh, 720px);
  }
}

.responsive-wide-media {
  height: clamp(220px, 60vw, 480px);
}

@media (min-width: 768px) {
  .responsive-wide-media {
    height: clamp(320px, 55vh, 640px);
  }
}

/* Research/post typography (restore spacing after Tailwind reset) */
.prose {
  color: inherit;
  line-height: 1.7;
}

.prose p {
  margin: 0 0 1em;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  margin: 1.2em 0 0.5em;
  font-family: var(--font-heading);
  line-height: 1.3;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1em 1.25em;
  padding: 0 0 0 0.4em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin: 0.2em 0;
}

.prose blockquote {
  margin: 0 0 1.2em;
  padding: 0.6em 1em;
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.prose pre {
  margin: 0 0 1.2em;
  padding: 0.9em 1em;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  overflow-x: auto;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 0.95em;
}

.prose th,
.prose td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.65em 0.8em;
}

.prose th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
  text-align: left;
}

.prose tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

@media (min-width: 1280px) {
  .responsive-wide-media {
    height: clamp(380px, 50vh, 720px);
  }
}

.responsive-illustration {
  min-height: 220px;
  height: clamp(240px, 65vw, 480px);
}

@media (min-width: 768px) {
  .responsive-illustration {
    height: clamp(280px, 55vh, 540px);
  }
}

/* Contact UI */
.contact-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #e5e7eb;
  background: rgba(59, 130, 246, 0.08);
  transition: all 0.2s ease;
}

.contact-pill:hover {
  border-color: rgba(59, 130, 246, 0.35);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.contact-chat-log {
  background: linear-gradient(145deg, rgba(24, 24, 27, 0.9), rgba(17, 24, 39, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.4;
  max-width: 90%;
  font-size: 14px;
}

.bubble.bot {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  align-self: flex-start;
}

.bubble.user {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #dbeafe;
  margin-left: auto;
  display: inline-block;
  align-self: flex-end;
}

.bubble.success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.4);
  color: #bfdbfe;
}

.bubble.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecdd3;
}

.contact-form-panel {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
}

@media (max-width: 768px) {
  .contact-shell {
    padding: 14px 12px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  #contact-modal .contact-shell {
    align-items: flex-start;
  }

  #contact-modal > .absolute {
    background-color: rgba(15, 23, 42, 0.55);
  }

  #contact-modal .contact-shell > .bg-white {
    max-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
  }

  #contact-modal .contact-shell > .bg-white > .grid {
    flex: 1;
    overflow-y: auto;
  }

  .contact-chat-log {
    min-height: 180px;
    max-height: 260px;
  }

  .contact-form-panel {
    padding: 12px;
  }

  #contact-modal [data-contact-submit] {
    width: 100%;
    justify-content: center;
  }

  .contact-pill {
    font-size: 14px;
  }

  .bubble {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  #contact-modal .contact-shell {
    padding: 10px 8px;
  }

  #contact-modal .contact-shell > .bg-white {
    border-radius: 1.25rem;
  }

  .contact-chat-log {
    min-height: 160px;
    max-height: 220px;
  }

  .contact-form-panel {
    padding: 10px;
  }
}

/* Job Application Modal */
#job-apply-modal {
  z-index: 60;
}

#job-apply-modal input:focus,
#job-apply-modal textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

#job-apply-modal input::placeholder,
#job-apply-modal textarea::placeholder {
  color: #94a3b8;
}

#job-apply-modal input,
#job-apply-modal textarea {
  font-size: 16px; /* Prevents iOS zoom on focus */
}

@media (max-width: 768px) {
  #job-apply-modal {
    padding: 0;
  }

  #job-apply-modal > div:nth-child(2) {
    padding: 12px;
    padding-top: 120px; /* Push down from top on mobile */
    align-items: flex-start;
    min-height: auto;
  }

  #job-apply-modal .bg-white {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    margin: 0;
    border-radius: 1.25rem;
  }

  #job-apply-modal textarea {
    min-height: 70px;
  }
  
  #job-apply-modal form {
    padding: 1rem;
  }
  
  #job-apply-modal #job-apply-success {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  #job-apply-modal > div:nth-child(2) {
    padding: 8px;
    padding-top: 100px; /* Push down from top on smaller phones */
  }

  #job-apply-modal .bg-white {
    max-height: calc(100vh - 80px);
    border-radius: 1rem;
  }

  #job-apply-modal h3 {
    font-size: 1.1rem;
  }

  #job-apply-modal label {
    font-size: 0.75rem;
  }

  #job-apply-modal input,
  #job-apply-modal textarea {
    padding: 0.625rem 0.75rem;
    font-size: 16px;
  }
  
  #job-apply-modal textarea {
    min-height: 60px;
  }
  
  /* Header padding on mobile */
  #job-apply-modal .border-b {
    padding: 0.875rem 1rem;
  }
  
  #job-apply-modal .border-b h3 {
    font-size: 1rem;
  }
  
  #job-apply-modal .border-b p {
    font-size: 0.7rem;
  }
  
  #job-apply-modal .border-b .w-10,
  #job-apply-modal .border-b .w-12 {
    width: 2rem;
    height: 2rem;
  }
  
  #job-apply-modal .border-b svg {
    width: 1rem;
    height: 1rem;
  }
}

@media (max-width: 380px) {
  #job-apply-modal > div:nth-child(2) {
    padding: 6px;
    padding-top: 80px;
  }

  #job-apply-modal h3 {
    font-size: 0.95rem;
  }

  #job-apply-modal label {
    font-size: 0.7rem;
  }

  #job-apply-modal input,
  #job-apply-modal textarea {
    padding: 0.5rem 0.625rem;
  }
}

@media (min-width: 1280px) {
  .responsive-illustration {
    height: clamp(320px, 50vh, 620px);
  }
}
