/* ---- Base ---- */
:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --muted: #5a5a5a;
  --accent: #4e2a84;
  --accent-soft: #4e2a841a;
  --border: #e2e2e2;
  --max-width: 800px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* ---- Nav ---- */
nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--accent);
  max-width: var(--max-width);
  margin: 0 auto;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
}

nav a:hover { color: var(--accent); }

nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 3px;
  background: var(--accent);
  transform: skewX(-15deg);
  transition: width 0.15s ease;
}

nav a:hover::after { width: 100%; }

/* ---- Hero / headshot ---- */
.hero {
  display: flex;
  flex-wrap: wrap-reverse;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.hero-text { flex: 1 1 320px; }

.photo-frame {
  position: relative;
  width: 380px;
  max-width: 100%;
  flex-shrink: 0;
  margin: 0 auto;
}

/* offset accent block peeking out behind the photo */
.photo-frame::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 16px;
  right: -16px;
  bottom: -16px;
  background: var(--accent);
  opacity: 0.22;
  border-radius: 3px;
  z-index: 0;
}

.photo-inner {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  line-height: 0;
}

.headshot {
  display: block;
  width: 100%;
  height: auto;
}

/* ---- Headings ---- */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

h1 {
  font-size: 2.4rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.9rem;
}

.h1-underline {
  width: 56px;
  height: 4px;
  background: var(--accent);
  transform: skewX(-20deg);
  margin-bottom: 1.1rem;
}

h2 {
  font-size: 1.3rem;
  margin-top: 2.5rem;
}

.subtitle { color: var(--muted); font-size: 1.08rem; margin-top: 0; }

/* ---- Case study cards on home page ---- */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  align-items: start;
}

.case-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: 1.15rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  text-decoration: none;
  color: var(--text);
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.case-card:hover {
  transform: scale(1.09);
  box-shadow: 0 16px 34px rgba(0,0,0,0.16);
  z-index: 2;
}

/* diagonal ribbon carrying the case study number */
.case-card .ribbon {
  position: absolute;
  top: 14px;
  right: -38px;
  width: 130px;
  padding: 4px 0;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  transform: rotate(45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.case-card h3 { margin: 0 2.2rem 0.35rem 0; font-size: 1.05rem; }
.case-card p { margin: 0; color: var(--muted); font-size: 0.92rem; padding-right: 1rem; }

.case-card-thumb {
  display: block;
  width: calc(100% + 2.7rem);
  height: 140px;
  object-fit: cover;
  object-position: top;
  margin: -1.15rem -1.35rem 0.9rem;
  border-radius: 3px 3px 0 0;
  border-bottom: 1px solid var(--border);
}

/* ---- Case study page ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.tag::before {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--accent);
  transform: rotate(45deg);
  border-radius: 0px;
}

.hero-img-frame {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
}

img.hero-img {
  display: block;
  width: 100%;
}

.hero-img-frame .ribbon {
  position: absolute;
  top: 18px;
  right: -42px;
  width: 160px;
  padding: 6px 0;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.embed-frame {
  width: 100%;
  height: 600px;
  border: 1px solid var(--border);
  border-radius: 3px;
  margin: 1rem 0 0.5rem;
}

.file-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
}

.file-link:hover { opacity: 0.75; }

a.back { display: inline-block; margin-top: 2.5rem; font-size: 0.9rem; color: var(--muted); text-decoration: none; }
a.back:hover { color: var(--accent); }


footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem 1rem;
}

/* ---- Responsive ---- */
@media (max-width: 560px) {
  .hero { flex-direction: column; }
  .photo-frame { width: 280px; }
  h1 { font-size: 2rem; }
}

/* ---- Resume page ---- */
.resume-frame {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.resume-frame img {
  display: block;
  width: 100%;
}

.resume-download {
  display: inline-block;
  margin: 0.5rem 0 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 3px;
}

.resume-download:hover { opacity: 0.85; }

/* ---- Portfolio split columns ---- */
.split-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.split-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.split-heading {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--accent);
}

.split-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.5rem;
  padding-bottom: 0.25rem;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
}

.split-scroll::-webkit-scrollbar { width: 6px; }
.split-scroll::-webkit-scrollbar-track { background: transparent; }
.split-scroll::-webkit-scrollbar-thumb {
  background: var(--accent);
  opacity: 0.4;
  border-radius: 3px;
}
.split-scroll { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }

.split-scroll .case-card { flex-shrink: 0; }

@media (max-width: 700px) {
  .split-columns { grid-template-columns: 1fr; }
  .split-scroll { max-height: 360px; }
}

/* ---- Quick-facts list ---- */
.quick-facts {
  list-style: none;
  margin: 1.25rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quick-facts li {
  padding-left: 1.4rem;
  position: relative;
  color: var(--text);
}

.quick-facts li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
}

/* ---- Screenshot + caption blocks (image full-width, caption below) ---- */
.media-block {
  margin: 2.5rem 0;
}

.media-block img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  cursor: zoom-in;
}

.media-caption {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 1rem;
}

.media-caption .media-step {
  flex-shrink: 0;
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 3px;
}

.media-caption-text h4 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.media-caption-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---- Alternating side-by-side media rows (smaller image, text alongside) ---- */
.media-row-alt {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 2.25rem 0;
}

.media-row-alt.reverse { flex-direction: row-reverse; }

.media-row-alt .media-row-img {
  flex: 0 0 42%;
  max-width: 42%;
}

.media-row-alt img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  cursor: zoom-in;
}

.media-row-alt .media-row-text {
  flex: 1;
}

.media-row-alt .media-row-text h4 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.media-row-alt .media-row-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}

.photo-grid img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  cursor: zoom-in;
}

@media (max-width: 700px) {
  .media-row-alt, .media-row-alt.reverse {
    flex-direction: column;
    align-items: stretch;
  }
  .media-row-alt .media-row-img {
    max-width: 100%;
    flex-basis: auto;
  }
}

/* ---- Generic accent download button ---- */
.download-btn {
  display: inline-block;
  margin: 0.5rem 0 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 3px;
}

.download-btn:hover { opacity: 0.85; }

/* ---- Stat tiles ---- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 1.75rem 0;
}

.stat-tile {
  background: #fff;
  padding: 1.1rem 1rem;
  text-align: center;
}

.stat-tile .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-tile .stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.3rem;
}

/* ---- Chart blocks ---- */
.chart-block {
  margin: 2rem 0;
  padding: 1.25rem 1.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
}

.chart-block h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.chart-block svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- Statement tabs ---- */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--accent);
  margin: 2rem 0 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.65rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--accent); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; margin-top: 1.5rem; }
.tab-panel.active { display: block; }

/* ---- Data tables (statements) ---- */
.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 480px;
}

.data-table th, .data-table td {
  padding: 0.55rem 0.8rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th:first-child, .data-table td:first-child {
  text-align: left;
  font-weight: 500;
  white-space: normal;
}

.data-table thead th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--accent);
}

.data-table tr.subtotal td {
  font-weight: 700;
  border-top: 1px solid var(--muted);
}

.data-table tr.total td {
  font-weight: 700;
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
}

/* ---- Assumption cards ---- */
.assump-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.assump-card {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.7rem 0.85rem;
  background: #fff;
}

.assump-card h5 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.assump-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.18rem 0;
  font-size: 0.78rem;
  line-height: 1.3;
  border-bottom: 1px dashed var(--border);
}

.assump-row:last-child { border-bottom: none; }
.assump-row .a-label { color: var(--muted); }
.assump-row .a-value { font-weight: 600; text-align: right; flex-shrink: 0; }
