/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --bg: #F8FAFC;
  --text: #0F172A;
  --muted: #64748B;
  --accent: #0D9488;         /* brand teal — large display text, icons, decorative fills */
  --accent-dark: #0B7C72;    /* AA-safe teal — small text, labels, primary button (>=4.5:1 on light) */
  --accent-deep: #0A6155;    /* primary button hover */
  --accent-soft: rgba(13, 148, 136, 0.08);
  --surface: #FFFFFF;
  --border: #E2E8F0;

  --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, 0.12);
  --shadow-lift: 0 18px 40px -16px rgba(15, 23, 42, 0.14),
    0 10px 28px -14px rgba(13, 148, 136, 0.22);

  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1080px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: #fff;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 44px 0;
}

/* ============================================================
   Typography
   ============================================================ */
h1,
h2,
h3,
h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dark);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 10px;
}

.section-lede {
  color: var(--muted);
  max-width: none;
  margin-bottom: 28px;
}

/* Section header with an action link pinned to the top-right */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 10px;
}

.section-head .section-title {
  margin-bottom: 0;
}

.section-head-link {
  flex: none;
  font-size: 15px;
  font-weight: 600;
  padding-bottom: 4px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

.muted {
  color: var(--muted);
}

/* Inline teal highlight — the ==text== syntax from the portal. Always the
   AA-safe accent, so highlighted copy stays on-brand and readable. */
em.accent {
  font-style: normal;
  font-weight: 600;
  color: var(--accent-dark);
}

/* Inline links — underline reveal */
.link {
  color: var(--text);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease-smooth), color 0.25s ease;
}

.link:hover {
  color: var(--accent-dark);
  background-size: 100% 2px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.3s var(--ease-smooth),
    box-shadow 0.3s var(--ease-smooth), background-color 0.25s ease,
    color 0.25s ease, border-color 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent-dark);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(11, 124, 114, 0.45);
}

.btn-primary:hover {
  background: var(--accent-deep);
  box-shadow: 0 12px 26px -8px rgba(11, 124, 114, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 100;
  pointer-events: none;
}

.nav-inner {
  pointer-events: auto;
  max-width: var(--container);
  margin: 0 auto;
  padding: 10px 12px 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background-color 0.3s ease, border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.nav.scrolled .nav-inner {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

.nav-logo {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  display: inline-grid;
  align-items: center;
}

/* Both variants share one grid cell so they crossfade in place. */
.nav-logo .logo-full,
.nav-logo .logo-short {
  grid-area: 1 / 1;
  transition: opacity 0.3s ease;
}

/* At the top of the page: full name shown, short logo hidden. */
.nav-logo .logo-short {
  opacity: 0;
  pointer-events: none;
}

/* Once scrolled past the top, swap to the short "CM." logo. */
.nav.scrolled .nav-logo .logo-full {
  opacity: 0;
  pointer-events: none;
}

.nav.scrolled .nav-logo .logo-short {
  opacity: 1;
  pointer-events: auto;
}

.nav-logo .logo-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a:not(.btn) {
  display: block;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.nav-links a:not(.btn):hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.nav-links .btn {
  padding: 10px 20px;
  font-size: 14px;
  margin-left: 8px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

@media (max-width: 820px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: 24px;
    right: 24px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s var(--ease-smooth);
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links .btn {
    margin: 8px 0 0;
    justify-content: center;
  }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding: 112px 0 40px;
  overflow-x: clip; /* contain the portrait glow so it never triggers a horizontal scrollbar */
}

/* Faint dot grid, strongest behind the visual, fading toward the copy */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(100, 116, 139, 0.22) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 65% 60% at 78% 40%, black 25%, transparent 72%);
  mask-image: radial-gradient(ellipse 65% 60% at 78% 40%, black 25%, transparent 72%);
  pointer-events: none;
}

/* Soft teal wash in the top-right corner */
.hero::after {
  content: "";
  position: absolute;
  top: -18%;
  right: -8%;
  width: 46%;
  height: 65%;
  background: radial-gradient(closest-side, rgba(13, 148, 136, 0.09), transparent);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 48px;
  align-items: center;
}

/* ── Hero visual: portrait with an even ring of logo chips ── */
.hero-visual {
  position: relative;
  width: 360px;
  height: 380px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.hv-glow {
  position: absolute;
  inset: -10% -15%;
  background: radial-gradient(closest-side, rgba(13, 148, 136, 0.14), transparent 70%);
  border-radius: 50%;
}

.portrait {
  position: relative;
  width: 270px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #E4F2F0, #F1F5F9);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md), 0 0 0 10px rgba(13, 148, 136, 0.06);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Frames a portrait-orientation photo on the face (upper third)
     without editing the file itself. */
  object-position: 50% 22%;
}

.portrait-fallback {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  opacity: 0.35;
}

.orbit-chip {
  position: absolute;
  width: 54px;
  height: 54px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  animation: hv-float 6s ease-in-out infinite;
}

.orbit-chip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Pentagon ring: chip centers sit 170px from the portrait center,
   evenly spaced 72 degrees apart, starting from the top. */
.oc-1 { left: 153px; top: -7px; animation-delay: 0.2s; }
.oc-2 { left: 315px; top: 111px; animation-delay: 1s; animation-duration: 7s; }
.oc-3 { left: 253px; top: 301px; animation-delay: 0.6s; animation-duration: 6.4s; }
.oc-4 { left: 53px; top: 301px; animation-delay: 1.5s; }
.oc-5 { left: -9px; top: 111px; animation-delay: 0.4s; animation-duration: 7.2s; }

@keyframes hv-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }
}

.hero h1 {
  font-size: clamp(32px, 4.5vw, 50px);
  font-weight: 650;
  max-width: 720px;
  margin-bottom: 18px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero p {
  font-size: 16.5px;
  color: var(--muted);
  max-width: 600px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* On small phones the two CTAs stack; full-width reads cleaner and
   gives bigger tap targets than two unequal pills. */
@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    justify-content: center;
  }
}

/* ============================================================
   Currently Exploring
   ============================================================ */
.exploring-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.exploring-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-smooth),
    box-shadow 0.35s var(--ease-smooth), border-color 0.3s ease;
}

.exploring-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(13, 148, 136, 0.35);
}

.exploring-card .card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.exploring-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.exploring-card p {
  font-size: 15px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .exploring-grid {
    grid-template-columns: 1fr;
  }

  /* Single-column cards: the icon moves beside the title so a 44px
     glyph doesn't cost a whole row; the text gets the full width. */
  .exploring-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
    padding: 20px;
  }

  .exploring-card .card-icon {
    margin-bottom: 0;
  }

  .exploring-card h3 {
    grid-column: 2;
    margin-bottom: 0;
  }

  .exploring-card p {
    grid-column: 1 / -1;
    margin-top: 12px;
  }
}

/* ============================================================
   Featured Work
   ============================================================ */
.featured-card {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-smooth),
    box-shadow 0.35s var(--ease-smooth), border-color 0.3s ease;
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(13, 148, 136, 0.35);
}

.featured-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dark);
  margin-bottom: 12px;
}

.featured-card h3 {
  font-size: clamp(20px, 2.4vw, 26px);
  margin-bottom: 14px;
}

.featured-card > div > p {
  color: var(--muted);
  margin-bottom: 28px;
}

.metrics-list {
  list-style: none;
  display: grid;
  gap: 12px;
  align-content: center;
  border-left: 1px solid var(--border);
  padding-left: 36px;
}

.metrics-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
}

.metrics-list li strong {
  color: var(--accent-dark);
  font-weight: 650;
  white-space: nowrap;
}

.metrics-list .metric-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 820px) {
  .featured-card {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    gap: 32px;
  }

  .metrics-list {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 28px;
  }
}

/* ============================================================
   Logo chips (companies & schools)
   ============================================================ */
.logo-chip {
  flex: none;
  width: 48px;
  height: 48px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  object-fit: contain;
  transition: transform 0.3s var(--ease-smooth);
}

.timeline-card:hover .logo-chip {
  transform: scale(1.06);
}

.featured-label .logo-chip {
  width: 28px;
  height: 28px;
  padding: 4px;
  border-radius: 8px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
}

/* Detail-page header: org logo on the left, text beside it. */
.detail-head {
  display: flex;
  align-items: center;
  gap: 28px;
}

.detail-head-text {
  flex: 1;
  min-width: 0;
}

.detail-logo {
  flex: none;
  width: 96px;
  height: 96px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  object-fit: contain;
  box-shadow: var(--shadow-sm);
}

/* On phones the header stacks again, logo above the text. */
@media (max-width: 640px) {
  .detail-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .detail-logo {
    width: 64px;
    height: 64px;
    padding: 11px;
  }
}

/* ============================================================
   Journey timeline
   ============================================================ */
.timeline {
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--border));
  border-radius: 2px;
}

.timeline-group-label {
  position: relative;
  padding-left: 44px;
  margin: 24px 0 14px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.timeline-group-label:first-child {
  margin-top: 0;
}

.timeline-item {
  position: relative;
  padding-left: 44px;
  margin-bottom: 14px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 24px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--accent);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Education milestones use a hollow dot to set them apart from experience. */
.timeline-item.edu::before {
  background: var(--bg);
}

.timeline-item:hover::before {
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.timeline-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-smooth),
    box-shadow 0.35s var(--ease-smooth), border-color 0.3s ease;
}

.timeline-card:hover {
  transform: translateY(-4px) translateX(4px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(13, 148, 136, 0.35);
}

.timeline-card-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.timeline-card h3 {
  font-size: 17px;
  margin-bottom: 4px;
  transition: color 0.25s ease;
}

.timeline-card:hover h3 {
  color: var(--accent-dark);
}

.timeline-card .org {
  font-size: 14px;
  color: var(--muted);
}

.timeline-card .blurb {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 6px;
  max-width: 620px;
  line-height: 1.5;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
}

.date-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.timeline-card .arrow {
  color: var(--muted);
  transition: transform 0.3s var(--ease-smooth), color 0.25s ease;
}

.timeline-card:hover .arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* An empty blurb should not leave a stray gap in the card. */
.timeline-card .blurb:empty {
  display: none;
}

@media (max-width: 640px) {
  /* Tighter rail so the cards get more of the screen. */
  .timeline-group-label,
  .timeline-item {
    padding-left: 30px;
  }

  .timeline-item::before {
    top: 30px;
  }

  .timeline-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }

  /* Logo + title/org form a compact header row; the blurb breaks out
     below at full card width so the text is never squeezed beside the
     logo. display:contents lifts h3/org/blurb into this grid. */
  .timeline-card-main {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0 14px; /* the desktop 16px flex gap must not become a row gap */
    align-items: center;
  }

  .timeline-card-main > div {
    display: contents;
  }

  .timeline-card-main .logo-chip {
    width: 44px;
    height: 44px;
    grid-row: 1 / span 2;
  }

  .timeline-card h3,
  .timeline-card .org {
    grid-column: 2;
  }

  .timeline-card .blurb {
    grid-column: 1 / -1;
    margin-top: 10px;
  }

  .timeline-card .arrow {
    display: none;
  }
}

/* ============================================================
   Connect
   ============================================================ */
.connect-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) 1.8fr;
  gap: 20px;
  align-items: stretch;
}

.connect-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.connect-panel h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.connect-panel > p {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 28px;
}

.connect-panel form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-field {
  margin-bottom: 20px;
}

/* The message field absorbs spare height so the form panel
   matches the scheduler panel. */
.form-field.grow {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-field.grow textarea {
  flex: 1;
}

.form-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #94A3B8;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Inline validation, styled like the site (replaces browser bubbles) */
.form-field input.invalid,
.form-field textarea.invalid {
  border-color: #DC2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.form-status {
  display: none;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-dark);
}

.form-status.err {
  color: #DC2626;
}

.form-status.visible {
  display: block;
}

/* Scheduler placeholder — swap the inner div for a Calendly /
   Google Calendar appointment-scheduling iframe. */
.scheduler-embed {
  flex: 1;
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
}

.scheduler-embed iframe {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
}

@media (max-width: 820px) {
  .connect-grid {
    grid-template-columns: 1fr;
  }

  .connect-panel {
    padding: 28px 24px;
  }
}

/* At phone widths Google's scheduling widget stacks vertically and
   needs more height, otherwise the month grid gets clipped. */
@media (max-width: 640px) {
  .scheduler-embed,
  .scheduler-embed iframe {
    min-height: 680px;
  }
}

/* ============================================================
   Sign-off
   ============================================================ */
.signoff {
  position: relative;
  overflow: hidden;
  padding: 76px 0 88px;
  text-align: center;
}

/* Soft teal glow behind the line */
.signoff::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 760px;
  max-width: 120%;
  height: 360px;
  background: radial-gradient(closest-side, rgba(13, 148, 136, 0.1), transparent 72%);
  pointer-events: none;
}

.signoff .container {
  position: relative;
  z-index: 1;
}

/* Oversized quotation mark as a faint watermark behind the text */
.signoff-mark {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(200px, 30vw, 320px);
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

.signoff-line {
  position: relative;
  z-index: 1;
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 550;
  letter-spacing: -0.01em;
  line-height: 1.5;
  max-width: 640px;
  margin: 0 auto;
}

.signoff-line em {
  font-style: normal;
  color: var(--accent);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--text);
  padding: 36px 0;
  margin-top: 24px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 14px;
  color: #94A3B8;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-link {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #94A3B8;
  border: 1px solid #334155;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.3s var(--ease-smooth), color 0.25s ease,
    border-color 0.25s ease, box-shadow 0.3s ease;
}

.social-link:hover {
  transform: translateY(-3px);
  color: #2DD4BF;
  border-color: #2DD4BF;
}

.footer .btn-ghost {
  color: #E2E8F0;
  border-color: #334155;
}

.footer .btn-ghost:hover {
  color: #2DD4BF;
  border-color: #2DD4BF;
  background: rgba(13, 148, 136, 0.12);
}

/* ============================================================
   Detail page (second-level template)
   ============================================================ */
.detail-header {
  padding: 32px 0 26px;
  border-bottom: 1px solid var(--border);
}

.detail-header .detail-type {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dark);
  margin-bottom: 16px;
}

.detail-header h1 {
  font-size: clamp(28px, 3.8vw, 40px);
  max-width: 760px;
  margin-bottom: 14px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  color: var(--muted);
  font-size: 15px;
}

.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.detail-meta svg {
  color: var(--accent);
}

.detail-body {
  padding: 0 0 48px;
}

.detail-section {
  padding: 0;
  margin-top: 26px;
  margin-bottom: 0;
}

.detail-section h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.detail-section p {
  color: #334155;
  margin-bottom: 10px;
}

.detail-section p:last-child {
  margin-bottom: 0;
}

.deliverables-list {
  list-style: none;
  display: grid;
  gap: 9px;
}

.deliverables-list li {
  position: relative;
  padding-left: 24px;
  color: #334155;
}

.deliverables-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Images inside case-study sections */
.detail-figure {
  margin: 4px 0;
}

.detail-figure img {
  display: block;
  max-width: 100%;   /* fill the column at most — never upscale a small image */
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* Optional per-image sizing, centered in the column */
.detail-figure.size-medium img {
  max-width: 620px;
  margin: 0 auto;
}
.detail-figure.size-small img {
  max-width: 360px;
  margin: 0 auto;
}

.detail-figure figcaption {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}

.impact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.impact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-smooth),
    box-shadow 0.35s var(--ease-smooth);
}

.impact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.impact-card strong {
  display: block;
  font-size: 18px;
  font-weight: 650;
  color: var(--accent-dark);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.impact-card span {
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .impact-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Detail-page top bar: back link + career timeline
   ============================================================ */
.detail-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
}

.topbar-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 16px 0;
  transition: color 0.25s ease;
}

.topbar-back:hover {
  color: var(--accent-dark);
}

.page-timeline {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.page-timeline::-webkit-scrollbar {
  display: none;
}

/* When more stops than fit, fade both edges as a "scroll for more" hint. */
.page-timeline.has-overflow {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}

.pt-track {
  list-style: none;
  display: flex;
  align-items: flex-start;
  /* Keep the strip right-aligned when it fits (mirrors the main nav:
     back link left, timeline right). width:max-content + margin-left:auto
     (not justify-content) so the start edge stays reachable when the
     strip overflows and scrolls on small screens. */
  width: max-content;
  margin: 0 0 0 auto;
  padding: 12px 0;
}

.pt-node {
  position: relative;
  /* Every stop gets the same fixed slot so the dots sit at even
     intervals regardless of label width, and the strip stays a compact
     group instead of stretching across the whole bar. */
  flex: none;
  width: 112px;
  text-align: center;
}

/* Connector line between adjacent dots (dot center sits 7px from top). */
.pt-node:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 7px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.pt-link {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.pt-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);          /* Experience: filled */
  box-shadow: 0 0 0 4px var(--bg);    /* mask the connector behind the dot */
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pt-edu .pt-dot {
  background: #fff;                    /* Education: hollow ring */
  border: 2px solid var(--accent);
}

.pt-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.25s ease;
}

.pt-meta {
  font-size: 11.5px;
  color: var(--muted);
}

.pt-link:hover .pt-label {
  color: var(--accent-dark);
}

.pt-link:hover .pt-dot {
  transform: scale(1.15);
}

.pt-node.is-current .pt-dot {
  background: var(--accent);
  border: none;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--accent-soft);
}

.pt-node.is-current .pt-label {
  color: var(--accent-dark);
  font-weight: 650;
}

.pt-node.is-current .pt-meta {
  color: var(--accent-dark);
  font-weight: 600;
}

@media (max-width: 760px) {
  .topbar-inner {
    gap: 14px;
  }

  .pt-node {
    width: 92px;
  }
}

/* ============================================================
   Scroll-reveal animations
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-smooth),
    transform 0.7s var(--ease-smooth);
  transition-delay: var(--reveal-delay, 0s);
}

[data-reveal].revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .timeline-card,
  .exploring-card,
  .featured-card,
  .impact-card,
  .social-link {
    transition: none;
  }

  .orbit-chip {
    animation: none;
  }
}

/* ============================================================
   Projects listing page
   ============================================================ */
.subpage-section {
  padding: 120px 0 80px;
  min-height: calc(100vh - 210px);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 360px));
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-smooth),
    box-shadow 0.35s var(--ease-smooth), border-color 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(13, 148, 136, 0.35);
}

.pc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.pc-logo {
  width: 40px;
  height: 40px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  object-fit: contain;
}

.pc-tag {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-dark);
}

/* "Draft" banner shown only to the owner on a draft's own detail page */
.draft-banner {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #B45309;
  background: rgba(180, 83, 9, 0.1);
  border: 1px solid rgba(180, 83, 9, 0.25);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.draft-banner {
  display: inline-block;
  font-size: 12.5px;
  padding: 6px 14px;
  margin-bottom: 18px;
}

.project-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.project-card p {
  font-size: 14.5px;
  color: var(--muted);
  margin-bottom: 20px;
  flex: 1;
}

.pc-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-dark);
}

.pc-cta::after {
  content: "→";
  transition: transform 0.3s var(--ease-smooth);
}

.project-card:hover .pc-cta::after {
  transform: translateX(4px);
}

/* Prev / next projects at the foot of a project detail page.
   Cards hug their content instead of stretching half the page. */
.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.pn-item {
  flex: 0 1 auto;
  max-width: 46%;
  display: flex;
  flex-direction: column;
  justify-content: center; /* keep short titles vertically balanced next to tall neighbors */
  gap: 3px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-smooth),
    box-shadow 0.35s var(--ease-smooth), border-color 0.3s ease;
}

.pn-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(13, 148, 136, 0.35);
}

.pn-next {
  text-align: right;
  /* Balance the ragged edge of wrapped right-aligned titles */
  text-wrap: balance;
}

.pn-spacer {
  flex: 1;
}

.pn-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.pn-title {
  font-size: 14.5px;
  font-weight: 600;
}

.section-more {
  margin-top: 24px;
  font-size: 15px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .project-nav {
    flex-direction: column;
  }

  .pn-next {
    text-align: left;
  }

  .pn-spacer {
    display: none;
  }
}

/* ============================================================
   Error page (404)
   ============================================================ */
.error-page {
  min-height: calc(100vh - 116px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 120px 24px 64px;
  position: relative;
  overflow: hidden;
}

.error-page::after {
  content: "";
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 55%;
  background: radial-gradient(closest-side, rgba(13, 148, 136, 0.1), transparent);
  pointer-events: none;
}

.error-inner {
  position: relative;
  z-index: 1;
}

.error-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent-dark);
}

.error-page h1 {
  font-size: clamp(24px, 4vw, 34px);
  margin: 0 0 10px;
}

.error-page p {
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto 28px;
}

.error-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.error-links {
  margin-top: 24px;
  font-size: 14px;
}

/* Fallback link shown beneath the scheduling embed */
.scheduler-fallback {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  text-align: center;
}

/* Message shown only when the visitor has JavaScript disabled */
.noscript-note {
  max-width: 480px;
  margin: 140px auto 0;
  padding: 0 24px;
  text-align: center;
  color: var(--muted);
}
