/* ============================================================
   additional_styles.css — shared styles for /questions/ and /team/
   Inherits and extends the original AFI project design
   ============================================================ */

/* --- Root variables (mirroring the main site) --- */
:root {
  --afi-bg: #F5FCFF;
  --afi-primary: oklch(43.8% .0427 218);
  --afi-primary-dark: oklch(29.6% .0269 220);
  --afi-primary-fg: #ffffff;
  --afi-secondary: oklch(90.5% .028 226);
  --afi-secondary-fg: oklch(43.8% .0427 218);
  --afi-muted: oklch(97.9% .00287 265);
  --afi-muted-fg: oklch(64.7% .00601 275);
  --afi-accent: oklch(97.9% .00287 265);
  --afi-border: oklch(94% .00289 265);
  --afi-input: oklch(94.1% .00948 222);
  --afi-success: oklch(59.2% .115 167);
  --afi-card-bg: rgba(255, 255, 255, 0.40);
  --afi-separator: #EFF9FD;
  --afi-shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.10), 0 1px 2px -1px rgba(0,0,0,0.10);
  --afi-radius: 0.625rem;
  --afi-radius-2xl: 1rem;
  --afi-radius-3xl: 1.5rem;
  --afi-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Base reset for sub-pages --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body.afi-subpage {
  background-color: var(--afi-bg);
  color: oklch(20.9% 0 0);
  font-family: var(--afi-font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* --- Decorative background blobs (matching main site) --- */
.afi-blob {
  position: fixed;
  border-radius: 9999px;
  pointer-events: none;
  z-index: -10;
}

.afi-blob-1 {
  width: 440px;
  height: 440px;
  background: #cde4ee;
  filter: blur(178.60px);
  top: -200px;
  left: 120px;
}

.afi-blob-2 {
  width: 446.94px;
  height: 324.69px;
  background: #8ab6ca;
  filter: blur(184.95px);
  top: -320px;
  right: -560px;
  transform: rotate(85.91deg);
}

.afi-blob-3 {
  width: 295px;
  height: 295px;
  background: #cde4ee;
  filter: blur(184.95px);
  left: 285px;
  top: 442px;
}

.afi-blob-4 {
  width: 295px;
  height: 295px;
  background: #cde4ee;
  filter: blur(184.95px);
  left: 1072px;
  top: 474px;
}

@media (max-width: 767px) {
  .afi-blob-1 {
    width: 263px;
    height: 263px;
    filter: blur(106.75px);
    top: -32px;
    left: 0;
  }
  .afi-blob-2 {
    width: 263px;
    height: 263px;
    filter: blur(106.75px);
    top: 347px;
    right: 0;
    transform: none;
  }
  .afi-blob-3 {
    width: 357px;
    height: 396px;
    filter: blur(106.75px);
    top: 681px;
    left: 0;
  }
  .afi-blob-4 {
    width: 295px;
    height: 295px;
    filter: blur(184.95px);
    top: 757px;
    right: 0;
    left: auto;
  }
}

/* --- Navigation (matches main site sticky nav) --- */
.afi-nav {
  background: rgba(255, 255, 255, 0.40);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--afi-separator);
}

.afi-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row;
  padding: 0.75rem 0;
  width: clamp(300px, 90%, 1100px);
  margin: 0 auto;
}

.afi-nav-logo img {
  height: 24px;
  width: auto;
  display: block;
}

.afi-nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.afi-nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--afi-muted-fg);
  transition: color 0.15s;
  padding: 1rem 0;
  border-bottom: 2px solid transparent;
}

.afi-nav-links a:hover {
  color: oklch(20.9% 0 0);
  border-bottom-color: var(--afi-primary);
}

.afi-nav-links a.active {
  color: oklch(20.9% 0 0);
  border-bottom-color: var(--afi-primary);
}

.afi-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--afi-primary-dark);
  color: var(--afi-primary-fg);
  font-size: 0.875rem;
  font-weight: 500;
  height: 36px;
  min-width: 120px;
  padding: 0 16px;
  border-radius: calc(var(--afi-radius) - 2px);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.afi-nav-btn:hover {
  opacity: 0.85;
}

@media (max-width: 640px) {
  .afi-nav-links {
    gap: 1rem;
  }

  .afi-nav-links a {
    font-size: 0.8125rem;
    padding: 0.5rem 0;
  }
}

/* --- Main content wrapper --- */
.afi-main {
  width: clamp(300px, 90%, 1100px);
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
  flex: 1;
  max-width: 100%;
}

/* --- Page header / hero area --- */
.afi-page-header {
  margin-bottom: 2.5rem;
}

.afi-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.5);
  border-radius: calc(var(--afi-radius) - 2px);
  padding: 0.125rem 0.5rem;
  margin-bottom: 1.25rem;
  color: var(--afi-muted-fg);
}

.afi-breadcrumb a {
  color: var(--afi-primary);
  transition: color 0.15s;
}

.afi-breadcrumb a:hover {
  color: var(--afi-primary-dark);
}

.afi-breadcrumb-sep {
  color: var(--afi-muted-fg);
}

.afi-page-title {
  font-size: 2.375rem;
  font-weight: 500;
  line-height: 1.25;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.afi-page-title-decor {
  width: 18px;
  height: 18px;
  margin-top: 0.5rem;
  flex-shrink: 0;
}

.afi-page-subtitle {
  font-size: 0.9375rem;
  color: var(--afi-muted-fg);
  max-width: 640px;
  line-height: 1.6;
}

@media (max-width: 767px) {
  .afi-page-title {
    font-size: 1.75rem;
  }
}

/* --- Separator (matches main site) --- */
.afi-sep {
  height: 1px;
  background-color: var(--afi-separator);
  width: 100%;
  border: none;
  margin: 2rem 0;
}

/* --- Card component (matches vault cards) --- */
.afi-card {
  background: var(--afi-card-bg);
  border-radius: var(--afi-radius-3xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: none;
}

.afi-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.afi-card-title {
  font-size: 1.125rem;
  font-weight: 500;
}

.afi-card-body {
  font-size: 0.9375rem;
  color: oklch(35% 0.01 220);
  line-height: 1.7;
}

.afi-card-body p + p {
  margin-top: 0.85rem;
}

/* --- Grid layouts --- */
.afi-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.afi-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .afi-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .afi-grid-2,
  .afi-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* --- Section spacing --- */
.afi-section {
  margin-bottom: 3rem;
}

.afi-section-title {
  font-size: 1.375rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  color: oklch(20.9% 0 0);
}

/* --- FAQ / Q&A list (questions page) --- */
.afi-qa-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.afi-qa-item {
  background: var(--afi-card-bg);
  border-radius: var(--afi-radius-3xl);
  overflow: hidden;
}

.afi-qa-question {
  font-size: 1rem;
  font-weight: 500;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: oklch(20.9% 0 0);
  user-select: none;
  transition: color 0.15s;
  list-style: none;
}

.afi-qa-question:hover {
  color: var(--afi-primary);
}

.afi-qa-question::marker,
.afi-qa-question::-webkit-details-marker {
  display: none;
}

.afi-qa-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--afi-secondary);
  border-radius: 9999px;
  color: var(--afi-primary);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.25s ease, background 0.2s;
}

details.afi-qa-item[open] .afi-qa-icon {
  transform: rotate(45deg);
  background: var(--afi-primary);
  color: #fff;
}

.afi-qa-sep {
  height: 1px;
  background: var(--afi-separator);
  margin: 0 1.5rem;
}

.afi-qa-answer {
  padding: 1.25rem 1.5rem;
  font-size: 0.9375rem;
  color: oklch(35% 0.01 220);
  line-height: 1.75;
}

.afi-qa-answer p + p {
  margin-top: 0.75rem;
}

.afi-qa-answer a {
  color: var(--afi-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.afi-qa-answer a:hover {
  color: var(--afi-primary-dark);
}

/* --- Team / About page specific --- */
.afi-team-intro {
  font-size: 1rem;
  color: oklch(35% 0.01 220);
  line-height: 1.75;
  max-width: 780px;
  margin-bottom: 2.5rem;
}

.afi-team-intro p + p {
  margin-top: 1rem;
}

.afi-team-section {
  margin-bottom: 2.75rem;
}

.afi-team-section h2 {
  font-size: 1.375rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: oklch(20.9% 0 0);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.afi-team-section h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.25em;
  background: var(--afi-primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.afi-team-section p {
  font-size: 0.9375rem;
  color: oklch(35% 0.01 220);
  line-height: 1.75;
  max-width: 760px;
}

.afi-team-section p + p {
  margin-top: 0.75rem;
}

/* --- Stat cards (for team/numbers blocks) --- */
.afi-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.afi-stat-card {
  background: var(--afi-card-bg);
  border-radius: var(--afi-radius-2xl);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.afi-stat-value {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--afi-primary);
}

.afi-stat-label {
  font-size: 0.8125rem;
  color: var(--afi-muted-fg);
}

@media (max-width: 900px) {
  .afi-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .afi-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Feature/pillar list cards --- */
.afi-feature-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.afi-feature-item {
  background: var(--afi-card-bg);
  border-radius: var(--afi-radius-2xl);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.afi-feature-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--afi-secondary);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--afi-primary);
  font-size: 1rem;
}

.afi-feature-text {
  flex: 1;
}

.afi-feature-text strong {
  display: block;
  font-weight: 500;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
  color: oklch(20.9% 0 0);
}

.afi-feature-text p {
  font-size: 0.875rem;
  color: var(--afi-muted-fg);
  line-height: 1.6;
}

/* --- Inline highlight badge (matches vault badges) --- */
.afi-badge {
  display: inline-flex;
  align-items: center;
  border-radius: calc(var(--afi-radius) - 2px);
  background: var(--afi-secondary);
  color: var(--afi-secondary-fg);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.625rem;
  white-space: nowrap;
}

.afi-badge-primary {
  background: var(--afi-primary-dark);
  color: #ffffff;
}

/* --- Inline text link (body copy) --- */
.afi-link {
  color: var(--afi-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.afi-link:hover {
  color: var(--afi-primary-dark);
}

/* --- Buttons --- */
.afi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  height: 36px;
  padding: 0 1rem;
  border-radius: calc(var(--afi-radius) - 2px);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.afi-btn-primary {
  background: var(--afi-primary-dark);
  color: #ffffff;
}

.afi-btn-primary:hover {
  opacity: 0.82;
}

.afi-btn-secondary {
  background: var(--afi-secondary);
  color: var(--afi-secondary-fg);
}

.afi-btn-secondary:hover {
  opacity: 0.80;
}

.afi-btn-full {
  width: 100%;
}

/* --- Return-to-home / CTA bar --- */
.afi-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--afi-card-bg);
  border-radius: var(--afi-radius-3xl);
  padding: 1.5rem;
  margin-top: 2.5rem;
}

.afi-cta-bar-text {
  font-size: 0.9375rem;
  color: var(--afi-muted-fg);
}

.afi-cta-bar-text strong {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: oklch(20.9% 0 0);
  margin-bottom: 0.2rem;
}

/* --- Network icon cluster (matches main site style) --- */
.afi-network-cluster {
  display: flex;
  align-items: center;
  gap: -8px;
}

.afi-network-cluster .afi-network-icon {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  border: 1px solid rgba(var(--afi-primary), 0.5);
  background: #fff;
  padding: 1px;
  margin-left: -8px;
  overflow: hidden;
}

.afi-network-cluster .afi-network-icon:first-child {
  margin-left: 0;
}

/* --- Footer (matches main site footer) --- */
.afi-footer {
  background: oklch(90.5% .028 226 / 0.25);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  width: 100%;
  margin-top: auto;
}

.afi-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem 0;
  width: clamp(300px, 90%, 1100px);
  margin: 0 auto;
  font-size: 0.875rem;
  color: oklch(20.9% 0 0);
}

.afi-footer-copy {
  color: oklch(35% 0.01 220);
}

.afi-footer-socials {
  display: flex;
  gap: 0.5rem;
}

.afi-footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--afi-accent);
  border-radius: var(--afi-radius);
  color: oklch(20.9% 0 0);
  transition: opacity 0.2s;
}

.afi-footer-social-link:hover {
  opacity: 0.75;
}

.afi-footer-social-link svg {
  width: 16px;
  height: 16px;
}

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

/* --- Announcement pill (matches main site pill) --- */
.afi-announcement {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  background: rgba(255,255,255,0.5);
  border-radius: calc(var(--afi-radius) - 2px);
  padding: 0.125rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.afi-announcement .afi-dot {
  color: var(--afi-primary);
  font-size: 0.625rem;
}

.afi-announcement .afi-highlight {
  color: var(--afi-success);
}

.afi-announcement a {
  color: #3b82f6;
  transition: color 0.15s;
}

.afi-announcement a:hover {
  text-decoration: underline;
}

/* --- Responsive nav toggle (mobile) --- */
@media (max-width: 640px) {
  .afi-nav-links {
    display: none;
  }

  .afi-nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.96);
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    border-top: 1px solid var(--afi-separator);
    z-index: 100;
  }

  .afi-nav-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .afi-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* --- Prose content (body copy blocks) --- */
.afi-prose {
  font-size: 0.9375rem;
  color: oklch(35% 0.01 220);
  line-height: 1.75;
  max-width: 760px;
}

.afi-prose p {
  margin-bottom: 0.875rem;
}

.afi-prose p:last-child {
  margin-bottom: 0;
}

.afi-prose a {
  color: var(--afi-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.afi-prose a:hover {
  color: var(--afi-primary-dark);
}

.afi-prose strong {
  font-weight: 600;
  color: oklch(20.9% 0 0);
}

/* --- Table (if needed for Q&A or team data) --- */
.afi-table-wrap {
  overflow-x: auto;
  border-radius: var(--afi-radius-2xl);
  background: var(--afi-card-bg);
}

.afi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.afi-table th {
  text-align: left;
  font-weight: 600;
  color: oklch(20.9% 0 0);
  padding: 0.875rem 1.25rem;
  background: var(--afi-separator);
  border-bottom: 1px solid var(--afi-border);
  white-space: nowrap;
}

.afi-table td {
  padding: 0.875rem 1.25rem;
  color: oklch(35% 0.01 220);
  border-bottom: 1px solid var(--afi-border);
  vertical-align: top;
}

.afi-table tr:last-child td {
  border-bottom: none;
}

/* --- Page-level max-width protection --- */
.afi-main,
.afi-nav-inner,
.afi-footer-inner {
  max-width: 100%;
}