/* Work Wingman design tokens */
:root {
  --bg: #f2efe9;
  --panel: #faf8f4;
  --card: #ffffff;
  --ink: #1c1a17;
  --mut: rgba(28, 26, 23, 0.72);
  --faint: rgba(28, 26, 23, 0.64);
  --line: rgba(28, 26, 23, 0.12);
  --ctrlline: rgba(28, 26, 23, 0.5);
  --acc: #2b6e58;
  --warn: #a05c2b;
  --btn: #1c1a17;
  --btntext: #fff;
  --brand: #e8a04d;
  --brandtext: #a05c2b;
  --logo-tile: #1c1a17;
  --logo-a: #e8a04d;
  --logo-b: #a05c2b;
  --logo-c: #63bd97;
  --nav-h: 70px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151310;
    --panel: #1b1915;
    --card: #232019;
    --ink: #ece7dd;
    --mut: rgba(236, 231, 221, 0.62);
    --faint: rgba(236, 231, 221, 0.52);
    --line: rgba(236, 231, 221, 0.14);
    --ctrlline: rgba(236, 231, 221, 0.42);
    --acc: #63bd97;
    --warn: #dba064;
    --btn: #ece7dd;
    --btntext: #1c1a17;
    --brand: #e8a04d;
    --brandtext: #e8a04d;
    --logo-tile: #ece7dd;
    --logo-a: #e8a04d;
    --logo-b: #c9762f;
    --logo-c: #63bd97;
  }
}

:root[data-theme="dark"] {
    --bg: #151310;
    --panel: #1b1915;
    --card: #232019;
    --ink: #ece7dd;
    --mut: rgba(236, 231, 221, 0.62);
    --faint: rgba(236, 231, 221, 0.52);
    --line: rgba(236, 231, 221, 0.14);
    --ctrlline: rgba(236, 231, 221, 0.42);
    --acc: #63bd97;
    --warn: #dba064;
    --btn: #ece7dd;
    --btntext: #1c1a17;
    --brand: #e8a04d;
    --brandtext: #e8a04d;
    --logo-tile: #ece7dd;
    --logo-a: #e8a04d;
    --logo-b: #c9762f;
    --logo-c: #63bd97;
  }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-top: var(--nav-h); /* Space for sticky nav */
  line-height: 1.6;
}

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

/* Nav Bar */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
}

.nav-brand svg {
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
  font-weight: 500;
  font-size: 15px;
}

.nav-item > a,
.nav-item > .nav-group-label {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-item > .nav-group-label {
  cursor: default;
}

/* Page behind the open mobile panel must not scroll. */
html.nav-scroll-lock,
html.nav-scroll-lock body {
  overflow: hidden;
}

.nav-item:hover .dropdown {
  display: flex;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 0;
  flex-direction: column;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dropdown a {
  padding: 8px 16px;
  font-size: 14px;
}
.dropdown a:hover {
  background: var(--panel);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 7px 10px;
}
.nav-toggle:hover { background: var(--panel); }

.btn-open-app {
  background: var(--brand);
  color: var(--btntext);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}
.btn-open-app:hover {
  opacity: 0.9;
}

/* Base elements */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px;
}

h1, h2, h3 {
  font-family: 'Source Serif 4', serif;
  margin-top: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}

/* Index Page specific */
.hero {
  text-align: center;
  padding: 60px 0;
}
.hero-mark svg {
  margin: 0 auto;
}
.wordmark {
  font-size: 48px;
  margin: 24px 0 16px;
  color: var(--ink);
}
.taglines-container {
  /* Grid-stacked rotator: every item shares one cell, so the container
     auto-sizes to the tallest tagline instead of clipping on narrow screens. */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 40px;
  align-items: center;
  overflow: hidden;
  font-family: 'Source Serif 4', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--brandtext);
  margin-bottom: 24px;
}
.tagline {
  grid-area: 1 / 1;
  width: 100%;
  text-align: center;
  opacity: 0;
  animation: rotateTaglines 5.2s infinite;
}
/* Pause-on-hover only where hover really exists. On a touch screen a tap applies :hover
   and it STICKS, so the rotation froze permanently the moment anyone tapped it. */
@media (hover: hover) and (pointer: fine) {
.taglines-container:hover .tagline {
  animation-play-state: paused;
}
}
.t1 { animation-delay: 0s; }
.t2 { animation-delay: 2.6s; }

/* Opacity-only: a vertical translate would crop inside the container's overflow:hidden. */
@keyframes rotateTaglines {
  0% { opacity: 0; }
  5% { opacity: 1; }
  45% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 0; }
}

.helper-subtitle {
  max-width: 600px;
  margin: 0 auto 32px;
  font-size: 18px;
  color: var(--mut);
}
.helper-abbr {
  text-decoration-style: dotted;
  text-decoration-line: underline;
  text-decoration-color: var(--brandline);
  cursor: help;
  font-weight: 600;
  color: var(--ink);
}
/* The title attribute renders NO tooltip on touch devices, so on mobile the dotted
   underline invited a tap that could never show anything. This is a real tooltip element
   revealed on hover AND on focus — a tap focuses it, which also makes it keyboard
   reachable, which the title-only version never was. title stays for desktop and for
   assistive tech. */
/* The tooltip is positioned against the PARAGRAPH, not the word. Centring it on the term
   pushed it off the viewport on a phone, because the term sits right of centre and the tip is
   wider than the space beside it — the first render clipped both edges. Spanning the
   paragraph cannot overflow, since the paragraph is already inside the viewport. Desktop
   restores the centred-on-the-word version, where there is room for it. */
.helper-subtitle {
  position: relative;
}
.helper-term {
  display: inline-block;
}
/* MOBILE: the tip flows INLINE and pushes the CTAs down, rather than floating over them.
   An absolutely-positioned tip covered the buttons underneath, which on a phone meant the
   page looked broken until you tapped away. Flowing keeps everything reachable. */
.helper-tip {
  display: none;
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
}
/* Driven by a class, not :focus — a second tap on an already-focused element does not blur
   it, so :focus alone could open the tip but never close it. See helper-tip.js. */
.helper-term.is-open .helper-tip {
  display: block;
}
.helper-abbr:focus { outline: 2px solid var(--brandline); outline-offset: 2px; }
/* Wide screens: enough room to centre it under the word itself. */
/* DESKTOP: room to float it centred under the word without hiding anything, and hover
   works as well as tapping. */
@media (min-width: 701px) {
  .helper-term { position: relative; }
  .helper-tip {
    position: absolute;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    top: calc(100% + 10px);
    margin-top: 0;
    width: max-content;
    max-width: 420px;
    z-index: 1200;
  }
  .helper-term:hover .helper-tip {
    display: block;
  }
}

.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover {
  background: var(--panel);
}

.big-3 {
  display: flex;
  gap: 24px;
  margin: 60px 0;
}
.pillar-card {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.2s;
  cursor: default;
}
.pillar-card:hover {
  border-color: var(--brandline);
  box-shadow: 0 4px 12px rgba(232, 160, 77, 0.1);
}
.pillar-content {
  margin-bottom: 12px;
}
.pillar-content .lead {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
}
.pillar-content .sub {
  color: var(--mut);
  font-size: 15px;
}
.pillar-detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s, opacity 0.3s;
  color: var(--faint);
  font-size: 14px;
}
.pillar-card:hover .pillar-detail {
  max-height: 100px;
  opacity: 1;
}

.editions {
  display: flex;
  gap: 24px;
  margin: 60px 0;
}
.edition-card {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  position: relative;
  transition: all 0.2s;
}
.edition-card:hover {
  border-color: var(--brandline);
  box-shadow: 0 4px 12px rgba(232, 160, 77, 0.1);
}
.edition-badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--brandline);
  color: var(--brand);
  margin-bottom: 14px;
}
.edition-cloud .edition-badge {
  border-color: var(--acc);
  color: var(--acc);
}
.edition-name {
  font-size: 20px;
  margin: 0 0 4px;
}
.edition-price {
  color: var(--mut);
  font-size: 14px;
  margin-bottom: 12px;
}
.edition-blurb {
  color: var(--mut);
  font-size: 15px;
  margin-bottom: 14px;
}
.edition-points {
  margin: 0;
  padding-left: 18px;
  color: var(--faint);
  font-size: 14px;
}
.edition-points li {
  margin-bottom: 6px;
}

.mission-vision-container {
  display: flex;
  gap: 24px;
  margin: 60px 0;
}
.mv-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.mv-header {
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 16px;
  font-family: system-ui;
}
.mv-header.teal { color: var(--acc); }
.mv-header.amber { color: var(--brand); }

.mv-body {
  color: var(--mut);
  font-size: 16px;
}
.mv-full {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s, opacity 0.3s;
  margin-top: 12px;
}
.mv-card:hover .mv-full {
  max-height: 150px;
  opacity: 1;
}

.spotlights {
  margin: 60px 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.statement-spotlight, .team-spotlight {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
}

.stmt-cycle, .team-cycle {
  /* Grid-stacked rotator (see .taglines-container): sizes to the tallest item. */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 120px;
  align-items: center;
  justify-items: center;
}
/* Hover-expanded member detail grows into reserved space instead of reflowing the page. */
.team-cycle {
  min-height: 190px;
}
.stmt, .t-stmt {
  grid-area: 1 / 1;
  width: 100%;
  opacity: 0;
  animation-duration: 9s; /* 3 items, 3s each */
  animation-iteration-count: infinite;
}
/* Same sticky-:hover trap as the taglines: this froze the mission/vision helper and the
   team spotlight on mobile as soon as they were tapped. */
@media (hover: hover) and (pointer: fine) {
.statement-spotlight:hover .stmt, .team-spotlight:hover .t-stmt {
  animation-play-state: paused;
}
}
/* Stmt animations - 3 items */
.stmt1 { animation-name: rot3; animation-delay: 0s; }
.stmt2 { animation-name: rot3; animation-delay: 3s; }
.stmt3 { animation-name: rot3; animation-delay: 6s; }

@keyframes rot3 {
  0% { opacity: 0; }
  5% { opacity: 1; }
  28% { opacity: 1; }
  33% { opacity: 0; }
  100% { opacity: 0; }
}

.stmt h3 {
  margin-bottom: 12px;
  color: var(--ink);
}
.stmt p {
  color: var(--mut);
  margin: 0;
  max-width: 600px;
  margin: 0 auto;
}

/* Team animations - 2 items for MVP */
.t-stmt1 { animation-name: rot2; animation-delay: 0s; }
.t-stmt2 { animation-name: rot2; animation-delay: 4s; }

@keyframes rot2 {
  0% { opacity: 0; }
  5% { opacity: 1; }
  45% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 0; }
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}
.team-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brandline);
}
.team-teaser {
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
}
.team-detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s;
  color: var(--faint);
  margin-top: 8px;
}
.team-spotlight:hover .team-detail {
  max-height: 60px;
  opacity: 1;
}

.badges {
  text-align: center;
  color: var(--faint);
  font-size: 14px;
  margin: 60px 0 20px;
}

/* Team Page */
.team-page {
  padding: 24px 0;
}
.mission-sentence {
  font-size: 18px;
  color: var(--mut);
  margin-bottom: 40px;
  max-width: 700px;
}
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.roster-member {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.roster-member .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.roster-member .ai-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--brand);
}
.member-info h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-family: system-ui;
}
.member-info .title {
  font-size: 13px;
  color: var(--faint);
  line-height: 1.4;
}
.mut { color: var(--mut); }

/* Docs Page */
.docs-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.doc-cat {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.doc-cat.locked {
  cursor: not-allowed;
  opacity: 0.8;
}
.doc-cat .icon {
  font-size: 24px;
}

@media (max-width: 768px) {
  .big-3, .editions, .mission-vision-container {
    flex-direction: column;
  }
  .cta-actions {
    flex-wrap: wrap;
  }
  .wordmark {
    font-size: 36px;
  }
}

/* Mobile nav: covers single-screen phones and foldables (folded + unfolded). */
@media (max-width: 900px) {
  .top-nav {
    padding: 0 16px;
    gap: 10px;
  }
  .nav-brand {
    font-size: 18px;
    gap: 8px;
    margin-right: auto;
  }
  .nav-toggle {
    display: inline-flex;
    order: 3;
  }
  .btn-open-app {
    order: 2;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  }
  .top-nav.nav-open .nav-menu {
    display: flex;
  }
  .nav-item > a {
    padding: 12px 0;
  }
  /* Touch has no hover: parent entries become headings, dropdown links always visible. */
  .nav-item > .nav-group-label {
    color: var(--faint);
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }
  .dropdown {
    display: flex;
    position: static;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 8px 12px;
    min-width: 0;
  }
  .dropdown a {
    padding: 10px 0;
    font-size: 15px;
  }
  .dropdown a:hover {
    background: transparent;
  }
}

/* Rotators depend on animation to become visible: with animations disabled,
   pin the first item on instead of showing an empty box. */
@media (prefers-reduced-motion: reduce) {
  .tagline, .stmt, .t-stmt {
    animation: none !important;
    opacity: 0;
  }
  .tagline.t1, .stmt.stmt1, .t-stmt.t-stmt1 {
    opacity: 1;
  }
}

/* Ultra-narrow (320px-class): logo only, the wordmark does not fit beside the buttons. */
@media (max-width: 359px) {
  .nav-brand-name {
    display: none;
  }
}
/* AI teammates show their platform's mark; the letter tile is the fallback. */
.ai-logo {
  object-fit: contain;
  padding: 8px;
  background: var(--panel);
}

/* Light/dark switch in the nav. */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 7px 10px;
}
.theme-toggle:hover { background: var(--panel); }
.theme-icon-dark { display: none; }
.theme-icon-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-light { display: none; }
  :root:not([data-theme="light"]) .theme-icon-dark { display: inline; }
}
:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: inline; }
:root[data-theme="light"] .theme-icon-light { display: inline; }
:root[data-theme="light"] .theme-icon-dark { display: none; }

/* ---- Team bios: Skim / Peek / Peruse / Deep Dive ---- */
.density-control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 26px;
}
.density-label { font-size: 13px; color: var(--mut); letter-spacing: 0.5px; }
.density-tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--panel);
}
.density-tab {
  border: none;
  background: transparent;
  color: var(--mut);
  font: inherit;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.density-tab.is-active {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}
.density-hint { font-size: 12px; color: var(--faint); }

.roster-member { align-items: stretch; flex-direction: column; }
.member-head { display: flex; align-items: center; gap: 16px; width: 100%; }
.member-expand {
  margin-left: auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mut);
  border-radius: 8px;
  width: 32px; height: 32px;
  cursor: pointer;
  flex-shrink: 0;
}
.member-expand .chev { display: inline-block; transition: transform 0.2s; }
.roster-member.is-open .member-expand .chev { transform: rotate(180deg); }

.bio { display: none; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.bio-headline { font-size: 13px; color: var(--brandtext); margin-top: 2px; }
.bio-summary { color: var(--mut); font-size: 14px; margin: 0 0 10px; }
.bio-block { margin-top: 12px; }
.bio-block h4 {
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 6px;
  font-family: system-ui;
}
.bio-block p { margin: 0; font-size: 14px; color: var(--mut); }
.bio-why { border-left: 3px solid var(--brand); padding-left: 12px; }
.bio-list { margin: 0; padding-left: 18px; font-size: 14px; color: var(--mut); }
.bio-list li { margin-bottom: 6px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; padding: 0; }
.chips li {
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--mut);
  background: var(--panel);
}

/* Global density levels. Per-member .is-open overrides everything below. */
.team-page[data-density="skim"] .bio-headline { display: none; }
.team-page[data-density="skim"] .bio { display: none; }
.team-page[data-density="peek"] .bio { display: none; }
.team-page[data-density="peruse"] .roster-member.has-bio .bio { display: block; }
.team-page[data-density="peruse"] .bio .bio-block { display: none; }
.team-page[data-density="peruse"] .bio .bio-why { display: block; }
.team-page[data-density="deep"] .roster-member.has-bio .bio { display: block; }

.team-page .roster-member.is-open .bio { display: block !important; }
.team-page .roster-member.is-open .bio .bio-block { display: block !important; }
.team-page .roster-member.is-open .bio-headline { display: block !important; }
