@font-face {
  font-family: 'IBM Plex Serif';
  font-weight: 700;
  font-style: normal;
  src: url('fonts.gstatic.com/IBM_Plex_Serif/IBMPlexSerif-Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'IBM Plex Serif';
  font-weight: 600;
  font-style: normal;
  src: url('fonts.gstatic.com/IBM_Plex_Serif/IBMPlexSerif-SemiBold.ttf') format('truetype');
}

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

html, body {
  height: 100%;
  background: #ffffff;
  color: #111;
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

/* ── Page grid ──────────────────────────────────── */
.page {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Divider ─────────────────────────────────────── */
.divider {
  background: rgba(0, 0, 0, 0.12);
  height: 100%;
}

/* ── Left panel ──────────────────────────────────── */
.panel-left {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  padding: 0 4.2vw;
}

/* Content area */
.content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3vh 0;
  scrollbar-width: none;
}

.content::-webkit-scrollbar {
  display: none;
}

/* Letter header */
.letter-header {
  margin-bottom: clamp(18px, 2.2vh, 30px);
}

.letter-date {
  font-size: clamp(9px, 0.8vw, 12px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 7px;
}

.letter-from {
  font-size: clamp(20px, 2.2vw, 32px);
  font-weight: 700;
  color: #C95D0A;
  letter-spacing: 0.01em;
}

/* Signature block */
.signature-block {
  align-self: flex-end;
  text-align: right;
  margin-top: clamp(16px, 2vh, 28px);
}

.signature-img {
  display: block;
  height: clamp(38px, 4.8vh, 66px);
  width: auto;
  opacity: 0.82;
  margin-bottom: 6px;
}

.signature-name {
  font-size: clamp(9px, 0.75vw, 11px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888;
}

/* Prose */
.prose {
  font-size: clamp(13px, 1.35vw, 18px);
  line-height: 1.75;
  color: #111;
  max-width: 100%;
  margin-bottom: clamp(12px, 1.6vh, 22px);
}

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

/* Hover words */
.w {
  cursor: default;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.3);
  transition: border-color 0.15s, color 0.15s;
}

.w:hover {
  border-bottom-color: #C95D0A;
  color: #C95D0A;
}

a.w {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border-radius: 3px;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
}

a.w:hover {
  background: rgba(201, 93, 10, 0.1);
  box-shadow: 0 0 0 4px rgba(201, 93, 10, 0.1);
  border-bottom-color: transparent;
}

/* Bottombar */
.bottombar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 1.6vh, 22px) 0;
  margin-bottom: 6vh;
  flex-shrink: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.nav {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
}

.nav a {
  font-size: clamp(8px, 0.75vw, 11px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
  text-decoration: none;
  transition: color 0.15s;
}

.nav a:hover {
  color: #002D72;
}

/* ── Right panel ─────────────────────────────────── */
.panel-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
}

/* Photo */
.photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1vh, 14px);
  opacity: 1;
  transition: opacity 0.2s ease;
}

.panel-right.info-active .photo-wrap {
  opacity: 0;
  pointer-events: none;
}

.photo {
  width: clamp(120px, 18vw, 280px);
  height: auto;
  filter: grayscale(5%);
  display: block;
  border-radius: 12px;
}

.photo-caption {
  font-size: clamp(7px, 0.65vw, 10px);
  letter-spacing: 0.16em;
  color: #888;
  font-variant: small-caps;
  text-align: center;
}

/* ── Info panel (hover text) ─────────────────────── */
.info-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 4.2vw;
  text-align: left;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.info-panel.on {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.info-title {
  font-size: clamp(8px, 0.75vw, 11px);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 3px;
}

.info-body {
  font-size: clamp(13px, 1.35vw, 18px);
  line-height: 1.75;
  color: #111;
  white-space: pre-line;
}

/* ── Info extras (logos / links per popup) ───────── */
.info-extra {
  display: none;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  margin-top: 28px;
}

.logo-flashpoint {
  height: 75px;
  max-width: 220px;
  width: auto;
  object-fit: contain;
}


.popup-link {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #C95D0A;
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 93, 10, 0.35);
  transition: border-color 0.15s, color 0.15s;
}

.popup-link:hover {
  color: #a04808;
  border-bottom-color: #a04808;
}

.logo-group-stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo-group-horizontal {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 60px;
  width: 100%;
}

.logo-strategy {
  height: 40px;
  width: auto;
  object-fit: contain;
  position: relative;
  top: 6px;
}

.logo-pwc {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.logo-triana {
  top: 11px;
  height: 50px;
  width: auto;
  object-fit: contain;
  position: relative;
}

.logo-tandon {
  height: 35px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  position: relative;
  top: 10px
}

.logo-tcc {
  height: 125px;
  max-width: 220px;
  width: auto;
  object-fit: contain;
  bottom: 25px;
  position: relative;
}

.cs-partner-logos {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 28px;
  margin-top: 4px;
}

.logo-partner {
  height: 28px;
  width: auto;
}

.logo-partner--lg {
  height: 40px;
  width: auto;
  object-fit: contain;
}

/* ── Case study block ────────────────────────────── */
.case-study {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vh, 16px);
  width: 100%;
}

.cs-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cs-label {
  font-size: clamp(7px, 0.65vw, 10px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
}

.cs-text {
  font-size: clamp(12px, 1.2vw, 16px);
  line-height: 1.65;
  color: #111;
}

/* ── Skill tags ──────────────────────────────────── */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-size: clamp(10px, 0.95vw, 13px);
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 3px;
  line-height: 1;
}

.skill-tag--main {
  background: #111;
  color: #fff;
  border: 1.5px solid #111;
}

.skill-tag--secondary {
  background: transparent;
  color: #111;
  border: 1.5px solid #111;
}

.skill-tag--tool {
  background: transparent;
  color: #888;
  border: 1.5px solid #ccc;
}

/* ── Skills grid (horizontal label + tags rows) ─── */
.skills-grid {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 6px;
}

.skills-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.skills-row:first-child {
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.skills-row-label {
  font-size: clamp(7px, 0.65vw, 10px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #888;
  min-width: 72px;
  padding-top: 5px;
  flex-shrink: 0;
}

.cs-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: clamp(10px, 1.2vh, 18px);
}

/* ── Pipeline diagram ────────────────────────────── */
.pipeline-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.pipe-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #f4f4f4;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: clamp(9px, 0.85vw, 12px);
  font-weight: 600;
  color: #111;
  line-height: 1.3;
  white-space: nowrap;
}

.pipe-node--highlight {
  background: #fff4ed;
  border-color: rgba(201, 93, 10, 0.25);
  color: #C95D0A;
}

.pipe-sub {
  font-size: clamp(7px, 0.65vw, 9px);
  font-weight: 400;
  color: #888;
  letter-spacing: 0.04em;
}

.pipe-node--highlight .pipe-sub {
  color: rgba(201, 93, 10, 0.7);
}

.pipe-arrow {
  font-size: clamp(9px, 0.85vw, 12px);
  color: #bbb;
  line-height: 1;
}

/* ── Mobile popup sheet (hidden by default, shown only on mobile) ── */
.popup-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.popup-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.popup-sheet {
  display: none;
  position: fixed;
  inset: 10px;
  background: #fff;
  border-radius: 20px;
  z-index: 101;
  transform: translateY(calc(100% + 20px));
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.popup-sheet.open {
  transform: translateY(0);
}

.popup-sheet-handle {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 14px auto 10px;
}

.popup-sheet-content {
  padding: 18px 24px 48px;
}

.popup-sheet-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 10px;
}

.popup-sheet-body {
  font-size: 16px;
  line-height: 1.55;
  color: #111;
  padding-bottom: 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.popup-sheet-extras {
  padding-top: 4px;
}

.sheet-ext-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: #C95D0A;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.popup-sheet-extras .info-extra {
  display: flex !important;
  margin-top: 0;
}

.popup-sheet-extras .cs-logos {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 14px;
  margin-top: 6px;
}

/* ── Mobile ──────────────────────────────────────── */
@media (max-width: 768px) {
  /* Single column, photo on top then text */
  .page {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .divider {
    display: none;
  }

  /* Photo: compact strip at top */
  .panel-right {
    display: flex;
    order: -1;
    height: auto;
    justify-content: center;
    padding: 36px 24px 20px;
  }

  .info-panel {
    display: none;
  }

  .photo {
    width: clamp(90px, 30vw, 160px);
  }

  /* Left panel: natural height */
  .panel-left {
    height: auto;
    overflow: visible;
    padding: 0 28px;
    width: 100%;
  }

  .panel-right {
    width: 100%;
  }

  /* Content: top-aligned */
  .content {
    overflow-y: visible;
    justify-content: flex-start;
    padding: 20px 0 10px;
  }

  /* Bottombar */
  .bottombar {
    margin-bottom: clamp(24px, 6vh, 48px);
  }

  /* Nav: larger touch targets */
  .nav a {
    padding: 10px 6px;
  }

  /* Logo sizes: scale down */
  .logo-flashpoint  { height: 50px; }
  .logo-strategy    { max-height: 32px; }
  .logo-pwc         { max-height: 38px; }
  .logo-triana      { max-height: 36px; }
  .logo-tcc         { height: 110px; max-width: 200px; }

  /* Horizontal logo group: keep side by side, tighter gap */
  .logo-group-horizontal {
    gap: 20px;
    justify-content: center;
  }

  /* TCC partner logos: 2x2 grid */
  .cs-partner-logos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    align-items: center;
    justify-items: center;
    margin-top: 8px;
  }

  .logo-partner {
    height: 36px;
    max-width: 100%;
  }

  .logo-partner--lg {
    height: 44px;
    max-width: 100%;
  }

  /* Activate bottom sheet */
  .popup-backdrop,
  .popup-sheet {
    display: block;
  }

  /* Hover words: solid underline (more tap-friendly) */
  .w {
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  }

  /* Click-to-highlight on mobile */
  span.w.w--clicked {
    color: #C95D0A;
    border-bottom-color: #C95D0A;
  }

  a.w.w--clicked {
    color: #C95D0A;
    background: rgba(201, 93, 10, 0.1);
    box-shadow: 0 0 0 4px rgba(201, 93, 10, 0.1);
    border-bottom-color: transparent;
  }

  /* Trunkville & WeatherStyle: plain text on mobile (links live in popup) */
  a.w[data-popup="trunkville"],
  a.w[data-popup="weatherstyle"] {
    color: inherit;
    background: none !important;
    box-shadow: none !important;
    border-bottom-color: rgba(0, 0, 0, 0.25);
  }

  a.w[data-popup="trunkville"].w--clicked,
  a.w[data-popup="weatherstyle"].w--clicked {
    color: inherit;
    background: none !important;
    box-shadow: none !important;
  }
}
