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

/* Base */
:root {
  --color-bg: #faf9f0;
  --color-text: #131314;
  --color-text-muted: #5c5c5c;
  --color-accent: #d97757;
  --color-border: #d4d1c7;
  --max-width: 860px;
  --spacing-section: 80px;
}

html {
  font-size: 18px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.7;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
header, main, footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  padding-top: 64px;
  padding-bottom: 0;
}

.navbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.logo {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--color-text);
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
}

/* Labs Dropdown */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-labs-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
  padding: 0;
}

.labs-icon, .labs-chevron {
  flex-shrink: 0;
}

.labs-chevron {
  transition: transform 0.2s ease;
}

.nav-labs-trigger[aria-expanded="true"] .labs-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--color-bg);
  padding: 8px 0;
  z-index: 50;
  border: 1.5px dashed #b0a994;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-dropdown-panel::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-dropdown-panel.open {
  display: block;
}

.nav-dropdown-panel.open.visible {
  opacity: 1;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: block;
  padding: 8px 20px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus-visible {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.03);
}

/* Hamburger Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  padding: 48px 0 var(--spacing-section) 0;
}

.hero h1 {
  font-family: 'Source Serif Pro', 'Georgia', 'Times New Roman', serif;
  font-size: 2.8rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 50ch;
  margin-bottom: 16px;
}

.hero .subtitle {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  max-width: 40ch;
  line-height: 1.6;
}

.amplify {
  color: var(--color-accent);
  display: inline;
  transition: all 0.2s ease;
  cursor: default;
  border-radius: 4px;
}

.amplify:hover {
  color: var(--color-bg);
  background: var(--color-accent);
  padding: 0 0.15em;
  margin: 0 -0.15em;
}

/* Headline Stat */
.headline-stat {
  position: relative;
  padding: 32px 36px;
  margin: 24px 0;
  animation: fadeInStat 1s ease-out forwards;
}

.headline-stat-border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.headline-stat-border rect {
  fill: none;
  stroke: #c9c5b8;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 8 6;
  opacity: 0.5;
}

.headline-stat p {
  font-size: 1.35rem;
  line-height: 1.6;
  max-width: 50ch;
  color: var(--color-text-muted);
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1;
  vertical-align: baseline;
  color: var(--color-accent);
}

.stat-number-secondary {
  font-size: 1.8rem;
}

.headline-stat-secondary p {
  font-size: 1.2rem;
}

.stat-source a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.stat-source a:hover {
  opacity: 0.8;
}

.stat-source {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  opacity: 0.5;
}

/* Hover Stats */
.stat-hover {
  position: relative;
  border-bottom: 1.5px dotted var(--color-text-muted);
  cursor: help;
}

.stat-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 340px;
  max-width: calc(100vw - 48px);
  background: #fff;
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.popover-source {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  opacity: 0.7;
  font-style: italic;
}

.stat-hover:hover .stat-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

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

/* Content Blocks */
.content {
  padding-bottom: 48px;
}

.block {
  padding: 56px 0;
}

.block:last-child {
  padding-bottom: 0;
}

.block h2 {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.block p {
  font-size: 1.25rem;
  line-height: 1.6;
  max-width: 50ch;
}

/* How We Work */
.how-we-work {
  padding: 56px 0;
  margin: 24px 0;
}

.how-we-work h2 {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.principles {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.principle {
  border-bottom: 1px solid var(--color-border);
}

.principle:last-child {
  border-bottom: none;
}

.principle summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s ease;
}

.principle summary::-webkit-details-marker {
  display: none;
}

.principle summary::marker {
  display: none;
  content: '';
}

.principle summary:hover {
  color: var(--color-accent);
}

.principle-number {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  opacity: 0.5;
  min-width: 24px;
}

.principle-title {
  font-size: 1.15rem;
  font-weight: 500;
  flex: 1;
  color: var(--color-accent);
}

.principle-chevron {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.principle[open] .principle-chevron {
  transform: rotate(180deg);
}

.principle p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 50ch;
  padding: 0 0 24px 40px;
  animation: principleReveal 0.3s ease-out;
}

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

/* Research Page */
.research-intro {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 50ch;
  margin-top: 16px;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0 0 48px 0;
}

.section-heading {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.publications {
  padding-bottom: 48px;
}

.pub-table {
  width: 100%;
  border-collapse: collapse;
}

.pub-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: 0 0 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.pub-table th:first-child {
  width: 120px;
}

.pub-table th:nth-child(2) {
  width: 140px;
}

.pub-table td {
  padding: 14px 0;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.pub-table td:first-child {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.pub-table td:nth-child(2) {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.pub-table td {
  transition: color 0.2s ease;
}

.pub-table tbody tr[data-href] {
  cursor: pointer;
}

.pub-table tbody tr:hover td {
  color: var(--color-text);
  text-decoration: underline;
}

.pub-empty {
  padding: 32px 0;
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* Business Page – section headings */
.biz-page .block h2,
.biz-page .how-we-work h2,
.biz-page .headline-stat h2 {
  font-family: 'Source Serif Pro', 'Georgia', 'Times New Roman', serif;
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-bottom: 16px;
}

/* Business Page */
/* Business Contact Form */
.biz-contact-form {
  padding: 32px 36px;
  margin: 24px 0;
  border: 1px solid var(--color-border);
  border-radius: 14px;
}

.biz-contact-form .required {
  color: var(--color-accent);
}

.biz-contact-form .optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.6;
}

.biz-contact-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.biz-contact-form input[type="text"],
.biz-contact-form input[type="email"],
.biz-contact-form textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.biz-contact-form input:focus,
.biz-contact-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.15);
}

.biz-contact-form textarea {
  resize: vertical;
}

.biz-contact-form button {
  display: inline-block;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.biz-contact-form button:hover {
  background: #c4664a;
}

.biz-form-sub {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.biz-thanks {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-accent);
  padding: 24px 0;
}

.biz-subhead {
  margin-top: 20px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.biz-list {
  list-style: none;
  margin-top: 12px;
}

.biz-list li {
  position: relative;
  padding-left: 20px;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 10px;
  max-width: 50ch;
}

.biz-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

.biz-numbered {
  counter-reset: biz-num;
}

.biz-numbered li::before {
  content: counter(biz-num);
  counter-increment: biz-num;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  top: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
}

.biz-sprint-label {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 24px;
}

.timeline {
  list-style: none;
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--color-border);
}

.timeline-step {
  position: relative;
  padding-bottom: 32px;
}

.timeline-step:last-child {
  padding-bottom: 0;
}

.timeline-step::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: var(--color-bg);
  z-index: 1;
}

.timeline-step {
  cursor: default;
  transition: transform 0.2s ease;
}

.timeline-step:hover {
  transform: translateX(6px);
}

.timeline-step:hover::before {
  background: var(--color-accent);
}

.timeline-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.timeline-step:hover .timeline-title {
  color: var(--color-accent);
}

.timeline-desc {
  display: block;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.biz-principles-link {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.biz-principles-link a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.biz-principles-link a:hover {
  border-bottom-color: var(--color-accent);
}

.biz-principles-list {
  margin-top: 16px;
}

/* Footer */
footer {
  padding: 48px 24px;
}

footer a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--color-accent);
}

/* Background Doodles */
.bg-doodles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-doodles svg {
  position: absolute;
  opacity: 0.35;
  stroke: #b0a994;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doodle-1 {
  width: 120px;
  top: 8%;
  left: 5%;
  animation: float1 18s ease-in-out infinite;
}

.doodle-2 {
  width: 100px;
  top: 25%;
  right: 8%;
  animation: float2 23s ease-in-out infinite;
}

.doodle-3 {
  width: 110px;
  top: 55%;
  left: 10%;
  animation: float3 21s ease-in-out infinite;
}

.doodle-4 {
  width: 90px;
  top: 70%;
  right: 12%;
  animation: float1 26s ease-in-out infinite reverse;
}

.doodle-5 {
  width: 100px;
  top: 40%;
  left: 80%;
  animation: float2 20s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(8px, -12px) rotate(4deg); }
  66% { transform: translate(-5px, 7px) rotate(-3deg); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-10px, -14px) rotate(-5deg); }
}

@keyframes float3 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(7px, -8px) rotate(3deg); }
  75% { transform: translate(-8px, 5px) rotate(-4deg); }
}

header {
  position: relative;
  z-index: 2;
}

main, footer {
  position: relative;
  z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  header {
    padding-top: 48px;
  }

  :root {
    --spacing-section: 56px;
  }

  .hero {
    padding: 40px 0 56px 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero .subtitle {
    font-size: 1.1rem;
  }

  .block {
    padding: 40px 0;
  }

  .block p {
    font-size: 1.1rem;
  }

  .headline-stat p {
    font-size: 1.15rem;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .stat-number-secondary {
    font-size: 1.5rem;
  }

  .headline-stat-secondary p {
    font-size: 1.05rem;
  }

  .block {
    position: relative;
  }

  .stat-hover {
    position: static;
  }

  .stat-popover {
    width: calc(100% - 0px);
    left: 0;
    max-width: none;
  }

  .how-we-work {
    padding: 40px 0;
  }

  .principle-title {
    font-size: 1.05rem;
  }

  .principle p {
    font-size: 0.95rem;
    padding-left: 40px;
  }

  .content {
    padding-bottom: 40px;
  }

  .research-intro {
    font-size: 1.05rem;
  }

  .pub-table th:first-child {
    width: 100px;
  }

  .pub-table th:nth-child(2) {
    width: 110px;
  }

  footer {
    padding: 40px 24px;
  }

  .navbar {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: flex;
    order: 2;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    order: 3;
    padding: 8px 0;
    gap: 0;
    align-items: stretch;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links .nav-link {
    display: block;
    padding: 12px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-dropdown {
    position: static;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links .nav-labs-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-dropdown-panel {
    position: static;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    min-width: unset;
    transform: none;
    opacity: 1;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    display: block;
  }

  .nav-dropdown-panel.open,
  .nav-dropdown-panel.open.visible {
    max-height: 200px;
    opacity: 1;
    transform: none;
  }

  .nav-dropdown-item {
    padding: 10px 0 10px 24px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--color-border);
  }

  .bg-doodles svg {
    opacity: 0.12;
  }
}

@media (max-width: 480px) {
  header {
    padding-top: 32px;
  }

  .hero {
    padding: 32px 0 48px 0;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .block {
    padding: 32px 0;
  }

  .how-we-work {
    padding: 32px 0;
    margin: 16px 0;
  }

  .principle summary {
    padding: 16px 0;
  }

  .principle p {
    padding-left: 40px;
  }

  .content {
    padding-bottom: 32px;
  }

  footer {
    padding: 32px 20px;
  }

  header, main, footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .bg-doodles svg {
    opacity: 0.07;
  }
}

/* Apply Page */
.apply-cta {
  display: inline-block;
  margin-top: 24px;
  padding: 12px 32px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background: var(--color-accent);
  border-radius: 100px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.apply-cta:hover {
  background: #c4664a;
}

.apply-page .block a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.apply-page .block a:hover {
  border-bottom-color: var(--color-accent);
}

/* Apply Page – scannable job posting overrides */
.apply-page .hero {
  padding: 32px 0 40px 0;
}

.apply-page .hero h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.apply-page .research-intro {
  font-size: 1rem;
  margin-top: 8px;
}

.apply-page .block {
  padding: 32px 0;
}

.apply-page .block h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text);
  margin-bottom: 8px;
}

.apply-page .block p {
  font-size: 1rem;
  line-height: 1.6;
}

.apply-page .biz-list li {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 6px;
}

.apply-page .section-divider {
  margin: 0;
}

.apply-page .resp-heading {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin: 20px 0 4px 0;
}

.apply-page .apply-cta {
  margin-top: 16px;
  padding: 10px 28px;
  font-size: 0.9rem;
}
