/* Styles for the trip.expert personal pages: the homepage and /videos/.
   The homepage showcase has its own file (showcase.css). */

/* ── Tokens ──
   Shared with the demo website pages: same ink, same logo red. The back office
   keeps its own purple tokens. */
:root {
  --ink: #1B1B20;
  --body: #3B3B43;
  --muted: #6E6E78;
  --line: #E6E6EA;
  --panel: #F4F4F6;
  --paper: #FFFFFF;
  --red: #AB1F24;          /* the "Trip" in the logo */
  --red-hover: #8F181D;
  --red-soft: #FBEDEE;
  --guest-bubble: #D3E3FD; /* the real widget's guest bubble */
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --page: 1180px;
  --gutter: 24px;
  --font: "Figtree", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { color: var(--ink); font-weight: 500; margin: 0; }
h1 {
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
h3 { font-size: 21px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }
p { margin: 0; }
.lead { font-size: clamp(19px, 1.7vw, 22px); line-height: 1.5; color: var(--body); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  font: 600 17px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--red { background: var(--red); color: #FFFFFF; }
.btn--red:hover { background: var(--red-hover); }
.btn--line { border: 1.5px solid var(--ink); color: var(--ink); }
.btn--line:hover { background: var(--ink); color: #FFFFFF; }
.btn--small { min-height: 42px; padding: 0 18px; font-size: 15px; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.name-mark {
  white-space: nowrap;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.site-nav a:not(.btn):hover { color: var(--red); }

/* ── Hero ── */
.hero { padding: 56px 0 88px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero h1 { font-size: clamp(42px, 5.4vw, 66px); text-wrap: balance; }
.hero .lead { margin-top: 28px; max-width: 36ch; }
.hero-meta { margin-top: 18px; font-size: 16px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.portrait-wrap { position: relative; margin: 0; }
.portrait {
  position: relative;
  aspect-ratio: 1 / 1.02;
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
  isolation: isolate;
}
/* Concentric rings in the logo red, rising from behind the shoulders. */
.portrait::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -58%;
  width: 150%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: repeating-radial-gradient(circle,
    transparent 0 26px,
    rgba(171, 31, 36, 0.16) 26px 40px);
  -webkit-mask-image: radial-gradient(circle, transparent 26%, #000 27%, #000 58%, transparent 72%);
          mask-image: radial-gradient(circle, transparent 26%, #000 27%, #000 58%, transparent 72%);
  z-index: -1;
}
.portrait img {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
}
/* Isaac's two chat bubbles. They hang over the panel's left edge, where the
   photo is empty, so they never cover the face. */
.intro {
  position: absolute;
  top: 5%;
  left: -64px;
  width: min(250px, 52%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.intro-bubble {
  margin: 0;
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.4;
  box-shadow: 0 12px 32px -12px rgba(27, 27, 32, 0.3);
}
.intro-bubble a { color: var(--red); font-weight: 600; text-decoration: none; white-space: nowrap; }
.intro-bubble a:hover { text-decoration: underline; }
.intro-bubble.is-waiting { display: none; }
.intro-bubble.is-shown { animation: rise 0.35s ease-out both; }

/* ── Employers strip ── */
.strip { padding: 0 0 96px; }
.strip p { text-align: center; font-size: 18px; color: var(--body); }
.strip p strong { color: var(--ink); font-weight: 600; }
.employers {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 48px;
}
.employers li {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #A3A3AD;
}

/* ── Sections ── */
.section { padding: 88px 0; }
section[id] { scroll-margin-top: 72px; }
.section-head { max-width: 760px; }
.section-head p { margin-top: 20px; }

/* ── Project: heading, animated showcase (showcase.css), what I built ── */
.project-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: end;
  margin-bottom: 48px;
}
.project-head .lead { max-width: 40ch; }
.showcase-note { margin-top: 14px; text-align: center; font-size: 14px; color: var(--muted); }

.built {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.built li { padding-top: 20px; border-top: 2px solid var(--ink); font-size: 16px; line-height: 1.55; }
.built b { display: block; margin-bottom: 8px; color: var(--ink); font-size: 18px; font-weight: 600; }
.project-cta { justify-content: center; margin-top: 48px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

/* Typing dots in the hero bubbles. */
.dots { display: inline-flex; gap: 5px; padding: 6px 0; }
.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #B9B9C2;
  animation: blink 1.1s infinite ease-in-out;
}
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

/* ── Pipeline (a real sequence, so it is numbered) ── */
.pipeline .steps {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: 28px 24px 30px;
  border-radius: var(--radius-md);
  background: var(--panel);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
}
.steps li:last-child::before { background: var(--red); }
.steps p { margin-top: 10px; font-size: 16px; line-height: 1.55; }

/* ── About + career ── */
.about .wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 72px;
  align-items: start;
}
.about-copy { position: sticky; top: 112px; }
.about-copy p + p { margin-top: 18px; }
.facts {
  margin: 32px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 24px;
  font-size: 16px;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline time { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.timeline h3 { font-size: 19px; }
.timeline h3 span { color: var(--muted); font-weight: 500; }
.timeline p { margin-top: 6px; font-size: 16px; line-height: 1.55; }
.timeline .is-now time { color: var(--red); font-weight: 600; }

/* ── Stack ── */
.stack {
  margin: 48px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 48px;
}
.stack h3 { font-size: 17px; }
.stack p { margin-top: 8px; font-size: 16px; color: var(--body); }

/* ── Contact ── */
.contact { padding: 24px 0 96px; }
.contact-card {
  position: relative;
  padding: 72px 56px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: rgba(255, 255, 255, 0.78);
  overflow: hidden;
  isolation: isolate;
}
.contact-card::after {
  content: "";
  position: absolute;
  right: -180px;
  top: 50%;
  width: 560px;
  aspect-ratio: 1;
  transform: translateY(-50%);
  border-radius: 50%;
  background: repeating-radial-gradient(circle,
    transparent 0 26px,
    rgba(255, 255, 255, 0.07) 26px 40px);
  z-index: -1;
}
.contact-card h2 { color: #FFFFFF; max-width: 16ch; }
.contact-card p { margin-top: 18px; max-width: 46ch; font-size: 19px; }
.contact-card .btn--line { border-color: rgba(255, 255, 255, 0.6); color: #FFFFFF; }
.contact-card .btn--line:hover { background: #FFFFFF; color: var(--ink); }
.contact-card :focus-visible { outline-color: #FFFFFF; }

/* ── Footer ── */
.site-footer { padding: 0 0 40px; font-size: 15px; color: var(--muted); }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.site-footer img { height: 26px; width: auto; }
.site-footer a { color: var(--ink); }

/* ── Videos page (/videos/) ── */
.site-nav a[aria-current="page"] { color: var(--red); }

/* The homepage's way in: one line at the end of "How it works". */
.pipeline-more { margin-top: 40px; font-size: 18px; }
.pipeline-more a {
  color: var(--red);
  font-weight: 600;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
.pipeline-more a:hover { color: var(--red-hover); }

.videos-head { padding: 56px 0 48px; }
.videos-head .lead { margin-top: 24px; max-width: 46ch; }
.videos-list { padding-bottom: 96px; }

/* Two columns when each can be at least 420px wide, otherwise one. */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 56px 32px;
}
.video-card video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  background: var(--panel);
}
.video-title { margin-top: 20px; font-size: 21px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }
.video-meta { margin-top: 4px; font-size: 15px; color: var(--muted); }
.video-line { margin-top: 10px; font-size: 17px; }

.video-transcript { margin-top: 16px; border-top: 1px solid var(--line); }
.video-transcript summary {
  padding: 12px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.video-transcript summary:hover { color: var(--red); }
.video-transcript p { margin-top: 10px; font-size: 16px; line-height: 1.65; max-width: 68ch; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero .wrap, .about .wrap { grid-template-columns: 1fr; gap: 48px; }
  .project-head { grid-template-columns: 1fr; gap: 20px; }
  .built { grid-template-columns: 1fr 1fr; }
  .hero { padding: 32px 0 72px; }
  .portrait-wrap { max-width: 520px; width: 100%; }
  /* Stacked layout: no gap on the left, so the bubbles sit over the shirt. */
  .intro { top: auto; bottom: 4%; left: 4%; width: min(250px, 66%); }
  .pipeline .steps { grid-template-columns: 1fr 1fr; }
  .stack { grid-template-columns: 1fr 1fr; }
  .about-copy { position: static; }
  .section { padding: 72px 0; }
  /* Five nav items: a smaller gap keeps the header on one line down to 641px. */
  .site-nav { gap: 18px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 17px; }
  .site-nav a:not(.btn) { display: none; }
  .hero h1 { max-width: none; }
  .employers { gap: 8px 28px; }
  .strip { padding-bottom: 40px; }
  .built { grid-template-columns: 1fr; gap: 24px; }
  .pipeline .steps, .stack { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .contact-card { padding: 48px 24px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dots i, .intro-bubble.is-shown { animation: none; }
}
