/* ============================================================================
   Larda — site theme + depth layer design system.
   Palette: Larda Teal #146C63 · Clay Cream #F6F1E7 · Deep Ink #22312F
            Scan Blue #6FA8C9 · Pulse Coral #E4826B · Sage #9DBE8D
   One family (Outfit variable), weights carry hierarchy. Single light theme:
   the generated clay scenes are cream-lit; the chrome stays quiet around them.
   ========================================================================== */

@font-face {
  font-family: 'Outfit';
  src: url('../assets/fonts/outfit-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root, .sw-root {
  --teal: #146C63;
  --cream: #F6F1E7;
  --ink: #22312F;
  --ink-soft: #57635F;
  --scan: #6FA8C9;
  --coral: #E4826B;
  --sage: #9DBE8D;

  --sw-bg: var(--cream);
  --sw-ink: var(--ink);
  --sw-accent: var(--teal);
  --sw-font-display: 'Outfit', system-ui, sans-serif;
  --sw-font-body: 'Outfit', system-ui, sans-serif;

  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.4rem + 1vw, 2.1rem);
  --step-3: clamp(2.2rem, 1.8rem + 2vw, 3.2rem);
}

* { box-sizing: border-box; }

/* World hand-off: engine's fixed layers dissolve when the depth layer arrives. */
#world { transition: opacity 0.45s ease, visibility 0s; }
#world.world-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 400;
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--teal); color: var(--cream); }

h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

/* One-shot fade-up entrances (class added by IntersectionObserver). */
@media (prefers-reduced-motion: no-preference) {
  #depth .eyebrow, #depth h2, #depth .section-intro, .pillar, .person, .pub-list li, .pub-more, .eng-card, .footer-inner {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .person:nth-child(2) { transition-delay: 90ms; }
  #depth .in, .footer-inner.in { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- depth -- */

#depth {
  max-width: 1200px;
  /* Pull depth up into the engine's exit tail so the world-done dissolve
     fires while the finale scene is still mid-fade (the engine fades the
     last scene to atmosphere over the final ~15% of its range) — one
     continuous dissolve into "Research that ships.", no dead cream zone. */
  margin: -90vh auto 0;
  padding: clamp(4rem, 8vw, 8rem) clamp(1.25rem, 4vw, 3rem) 0;
}

#depth section + section {
  margin-top: clamp(5rem, 10vw, 9rem);
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.75rem;
}

#depth h2 {
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.022em;
  margin: 0 0 1rem;
  max-width: 18ch;
}

.section-intro {
  color: var(--ink-soft);
  font-size: var(--step-1);
  font-weight: 400;
  line-height: 1.45;
  margin: 0 0 3.5rem;
  max-width: 44ch;
}

/* Pillars: label column left, projects right; mirrors the world's journey. */

.pillar {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2.2fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.pillar + .pillar {
  border-top: 1px solid rgba(34, 49, 47, 0.12);
}

.pillar-head h3 {
  font-size: var(--step-2);
  font-weight: 650;
  line-height: 1.1;
  margin: 0 0 0.5rem;
}

.pillar[data-accent="imaging"] .pillar-head h3 { color: #3E7799; }
.pillar[data-accent="language"] .pillar-head h3 { color: #C05A42; }
.pillar[data-accent="prediction"] .pillar-head h3 { color: #4E7A44; }

.pillar-head p {
  color: var(--ink-soft);
  margin: 0;
  max-width: 26ch;
}

.pillar-projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2rem;
}

.pillar-projects h4 {
  font-size: var(--step-1);
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.pillar-projects li > p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 55ch;
}

.tags {
  margin-top: 0.6rem !important;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tags span,
.tags a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--teal);
  border: 1px solid rgba(20, 108, 99, 0.35);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
}

/* Paper / Code chips: filled, clickable variants of the tag pill. */
.tags a {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--cream);
  text-decoration: none;
  transition: background 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.tags a:hover {
  background: #0F5A52;
  transform: translateY(-1px);
}

/* ---------------------------------------------------------------- pubs --- */

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  max-width: 78ch;
}

.pub-list li {
  padding: 1.35rem 0;
}

.pub-list li + li {
  border-top: 1px solid rgba(34, 49, 47, 0.1);
}

.pub-title {
  display: inline-block;
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  transition: color 160ms ease;
}

.pub-title:hover { color: var(--teal); }

.pub-authors {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.pub-meta {
  margin: 0.3rem 0 0;
  color: var(--teal);
  font-weight: 550;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.pub-code {
  margin-left: 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cream);
  background: var(--teal);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  text-decoration: none;
  transition: background 160ms ease;
}

.pub-code:hover { background: #0F5A52; }

.pub-more {
  margin: 2.25rem 0 0;
  color: var(--ink-soft);
}

.pub-more a {
  color: var(--teal);
  font-weight: 600;
  text-decoration-color: rgba(20, 108, 99, 0.35);
  text-underline-offset: 3px;
}

/* --------------------------------------------------------- engineering --- */

.eng-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.eng-card {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(34, 49, 47, 0.08);
  border-radius: 16px;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  box-shadow: 0 14px 34px -18px rgba(20, 108, 99, 0.22);
}

.eng-card h3 {
  font-size: var(--step-1);
  font-weight: 650;
  line-height: 1.2;
  margin: 0 0 0.4rem;
}

.eng-card > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.eng-card .tags {
  margin-top: 0.9rem !important;
}

/* ---------------------------------------------------------------- team --- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
}

.person {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(34, 49, 47, 0.08);
  border-radius: 16px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: 0 14px 34px -18px rgba(20, 108, 99, 0.22);
}

.avatar {
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.1rem;
  box-shadow: 0 0 0 3px rgba(20, 108, 99, 0.22), 0 10px 22px -12px rgba(20, 108, 99, 0.4);
}

.avatar--coral {
  box-shadow: 0 0 0 3px rgba(228, 130, 107, 0.3), 0 10px 22px -12px rgba(192, 90, 66, 0.4);
}

.person h3 {
  font-size: var(--step-1);
  font-weight: 650;
  margin: 0 0 0.25rem;
}

.person .role {
  color: var(--teal);
  font-weight: 550;
  margin: 0 0 1rem;
}

.person p {
  margin: 0;
  color: var(--ink-soft);
}

.person-links {
  margin-top: 1.15rem !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.person-links a {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--teal);
  border: 1px solid rgba(20, 108, 99, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.person-links a:hover {
  background: var(--teal);
  color: var(--cream);
}

/* ---------------------------------------------------------------- footer - */

#contact {
  margin-top: clamp(5rem, 10vw, 9rem);
  background: var(--teal);
  color: var(--cream);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) clamp(1.25rem, 4vw, 3rem);
  padding-bottom: calc(clamp(2rem, 4vw, 3rem) + env(safe-area-inset-bottom));
  text-align: center;
}

#contact h2 {
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 0.75rem;
}

#contact p {
  color: rgba(246, 241, 231, 0.94);
  margin: 0 0 2.25rem;
}

.cta {
  display: inline-block;
  background: var(--coral);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.9rem 2.2rem;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.cta:hover { transform: translateY(-2px); }
.cta:active { transform: scale(0.97); }

.cta:focus-visible,
a:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.wordmark {
  margin: 4rem 0 0 !important;
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(246, 241, 231, 0.68) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.wordmark .mark { opacity: 0.9; }

/* Larda mark replaces the engine's default gradient box in the topbar. */
.sw-root .sw-brand__mark {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='2' y='2' width='28' height='28' rx='10' fill='%23146C63'/%3E%3Cpath d='M7 17.5h4.5l2.5-6 4 9 2.5-5h1.5' fill='none' stroke='%23F6F1E7' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='24.5' cy='15.5' r='2.2' fill='%23E4826B'/%3E%3C/svg%3E") center / contain no-repeat;
  width: 26px;
  height: 26px;
  border-radius: 0;
  box-shadow: 0 6px 14px rgba(20, 108, 99, 0.28);
}

/* ------------------------------------------------------------ responsive - */

/* 860px matches the engine's own mobile breakpoint (scrub-engine.js) */
@media (max-width: 860px) {
  .pillar { grid-template-columns: 1fr; gap: 1.25rem; }
  .team-grid { grid-template-columns: 1fr; }
  .eng-grid { grid-template-columns: 1fr; }
}

@media (min-width: 861px) and (max-width: 1100px) {
  .eng-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .cta, .tags a { transition: none; }
  .cta:hover, .cta:active, .tags a:hover { transform: none; }
}
