/* ==========================================================================
   Malcolm Riley — Senior Data Analyst portfolio
   Design system: DESIGN.md (Airbnb-derived) — white canvas, Rausch accent,
   Inter (Cereal VF substitute), soft rounded shapes, single shadow tier.
   ========================================================================== */

:root {
  --primary: #ff385c;
  --primary-active: #e00b41;
  --primary-disabled: #ffd1da;

  --ink: #222222;
  --body: #3f3f3f;
  --muted: #6a6a6a;
  --muted-soft: #929292;

  --hairline: #dddddd;
  --hairline-soft: #ebebeb;
  --border-strong: #c1c1c1;

  --canvas: #ffffff;
  --surface-soft: #f7f7f7;
  --surface-strong: #f2f2f2;
  --on-primary: #ffffff;

  --error: #c13515;

  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 32px;
  --r-full: 9999px;

  --shadow: rgba(0, 0, 0, 0.02) 0 0 0 1px, rgba(0, 0, 0, 0.04) 0 2px 6px 0, rgba(0, 0, 0, 0.1) 0 4px 8px 0;

  --font: 'Inter', -apple-system, system-ui, Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;

  --section: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font);
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--on-primary);
  padding: 12px 20px;
  border-radius: 0 0 8px 0;
  z-index: 999;
}
.skip-link:focus { left: 0; }

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  padding: 14px 24px;
  height: 48px;
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-active); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-sm { padding: 10px 20px; height: 40px; font-size: 14px; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--ink);
  color: var(--on-primary);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand-word { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }

.nav-links { display: flex; align-items: center; gap: 32px; font-size: 16px; font-weight: 600; }
.nav-links a { color: var(--muted); transition: color 0.2s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--ink);
  margin: 0 auto;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 24px 20px;
  border-top: 1px solid var(--hairline);
}
.mobile-menu a { padding: 12px 4px; font-weight: 600; border-bottom: 1px solid var(--hairline-soft); }
.mobile-menu .btn { margin-top: 14px; align-self: flex-start; }
.mobile-menu.open { display: flex; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- section shell ---------- */
main > section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.stats, .cta-band { max-width: none; padding: 0; }

.section-head { max-width: 640px; margin: 0 0 40px; }
.section-head h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 16px; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  align-items: center;
  gap: 56px;
  padding-top: 56px;
  padding-bottom: 88px;
  min-height: 92dvh;
}

.hero-headline { font-size: clamp(36px, 4.6vw, 60px); font-weight: 700; max-width: 13ch; }

.hero-sub { margin-top: 20px; font-size: 18px; color: var(--body); max-width: 48ch; line-height: 1.55; }

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

/* dashboard mock panel */
.dash-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  background: var(--canvas);
  padding: 28px;
}
.dash-top { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
.dash-dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--primary); }
.dash-top span { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.dash-stat-num { font-size: 64px; font-weight: 700; line-height: 1.1; letter-spacing: -1px; }
.dash-stat-label { margin-top: 4px; font-size: 15px; color: var(--muted); }

.dash-bars { display: flex; align-items: flex-end; gap: 8px; height: 70px; margin: 28px 0; }
.dash-bars span { flex: 1; border-radius: 4px 4px 0 0; background: var(--surface-strong); }
.dash-bars span:last-child { background: var(--primary); }

.dash-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-chip {
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; padding-bottom: 56px; min-height: auto; }
}

/* ---------- about ---------- */
.about { padding-top: 88px; padding-bottom: 88px; }

.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: start; }

.about-copy h2 { font-size: clamp(24px, 2.8vw, 32px); margin-bottom: 18px; max-width: 20ch; }
.about-copy p { color: var(--body); font-size: 16.5px; max-width: 58ch; line-height: 1.6; }

.chip-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 10px 16px;
  border-radius: var(--r-full);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- experience ---------- */
.experience { padding-top: 88px; padding-bottom: 88px; }

.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--hairline-soft);
}
.timeline-item:last-child { border-bottom: 1px solid var(--hairline-soft); }

.timeline-when { font-size: 14px; font-weight: 600; color: var(--muted); padding-top: 2px; }

.timeline-role h3 { font-size: 19px; font-weight: 600; }
.timeline-role .company { font-size: 15px; color: var(--primary); font-weight: 600; margin-top: 2px; display: block; }
.timeline-role ul { margin: 14px 0 0; padding-left: 18px; color: var(--body); font-size: 15px; line-height: 1.6; }
.timeline-role li + li { margin-top: 6px; }

.timeline-earlier {
  padding: 22px 0 0;
  font-size: 14.5px;
  color: var(--muted);
}

@media (max-width: 700px) {
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- projects / bento ---------- */
.projects { padding-top: 88px; padding-bottom: 88px; }

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.bento-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--canvas);
  padding: 28px;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.bento-cell:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.bento-cell--wide { grid-column: span 3; flex-direction: row; align-items: center; gap: 40px; }
.bento-featured-media {
  flex: 0 0 320px;
}
.bento-featured-body { flex: 1; }

.project-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.project-tag {
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 600;
  color: var(--body);
}
.bento-cell--wide .project-tag { background: var(--primary-disabled); color: var(--primary-active); }

.bento-cell h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.bento-cell--wide h3 { font-size: 26px; }
.bento-cell p { color: var(--body); font-size: 15px; line-height: 1.55; }

.project-link {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}
.project-link i { transition: transform 0.2s var(--ease); }
.bento-cell:hover .project-link i { transform: translateX(3px); }

@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .bento-cell--wide { grid-column: span 1; flex-direction: column; }
  .bento-featured-media { flex: none; width: 100%; }
}

/* ---------- stats ---------- */
.stats { padding: 96px 24px; background: var(--surface-soft); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.stats-inner { max-width: 1280px; margin: 0 auto; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; text-align: center; }
.stat-num { font-size: 48px; font-weight: 700; letter-spacing: -1px; color: var(--ink); }
.stat-label { margin-top: 8px; font-size: 14.5px; color: var(--muted); }

@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 24px; }
}

/* ---------- contact ---------- */
.contact { padding-top: 88px; padding-bottom: 88px; }

.contact-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
}

.contact-info { padding: 56px 48px; background: var(--canvas); }
.contact-info h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 26px; }

.contact-details { display: grid; gap: 22px; margin: 0 0 32px; }
.contact-details dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 6px;
}
.contact-details dd { margin: 0; font-size: 15.5px; color: var(--body); line-height: 1.5; }
.contact-details a:hover { color: var(--primary); }

.contact-cta {
  position: relative;
  background: var(--ink);
  color: var(--on-primary);
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.contact-cta h3 { font-size: 22px; font-weight: 600; margin-bottom: 12px; }
.contact-cta p { color: rgba(255,255,255,0.72); font-size: 15px; margin-bottom: 26px; line-height: 1.55; }
.contact-cta .btn-primary { align-self: flex-start; }

@media (max-width: 800px) {
  .contact-panel { grid-template-columns: 1fr; }
  .contact-info, .contact-cta { padding: 40px 28px; }
}

/* ---------- cta band ---------- */
.cta-band { padding: 96px 24px; text-align: center; }
.cta-inner { max-width: 560px; margin: 0 auto; }
.cta-band h2 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 14px; }
.cta-band p { color: var(--muted); font-size: 16px; margin-bottom: 32px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- footer ---------- */
.site-footer { background: var(--surface-soft); border-top: 1px solid var(--hairline); padding: 64px 24px 28px; }
.footer-grid { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-brand p { margin-top: 16px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.footer-links h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; }
.footer-links a { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 14.5px; color: var(--body); transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--primary); }

.footer-bottom { max-width: 1280px; margin: 48px auto 0; padding-top: 22px; border-top: 1px solid var(--hairline); font-size: 13px; color: var(--muted); }

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: span 2; }
}

/* ==========================================================================
   Case study page (finance-project.html)
   ========================================================================== */

.case-hero { padding-top: 56px; padding-bottom: 56px; }
.case-hero h1 { font-size: clamp(32px, 4.4vw, 48px); font-weight: 700; max-width: 18ch; margin-top: 12px; }
.case-hero .hero-sub { margin-top: 18px; }

.case-meta { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--hairline); }
.case-meta div dt { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.case-meta div dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }

.case-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

.case-section { padding-top: 64px; padding-bottom: 64px; border-top: 1px solid var(--hairline-soft); }
.case-section:first-of-type { border-top: none; }
.case-section h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; margin-bottom: 18px; }
.case-section > p { color: var(--body); font-size: 16.5px; line-height: 1.65; max-width: 72ch; }

.case-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .case-columns { grid-template-columns: 1fr; } }

.arch-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--hairline); border-radius: var(--r-md); overflow: hidden; margin-top: 8px; }
.arch-step { background: var(--canvas); padding: 32px 28px; }
.arch-step i { font-size: 26px; color: var(--primary); }
.arch-step h3 { font-size: 17px; font-weight: 700; margin: 16px 0 8px; }
.arch-step p { color: var(--body); font-size: 14.5px; line-height: 1.55; }

@media (max-width: 760px) { .arch-steps { grid-template-columns: 1fr; } }

.code-block {
  background: var(--ink);
  color: #ebebeb;
  border-radius: var(--r-md);
  padding: 24px 26px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  box-shadow: var(--shadow);
}
.code-block .c-key { color: #ff8a9e; }
.code-block .c-str { color: #9ee4a0; }
.code-block .c-com { color: #8a8f94; }

.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
.result-card { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 28px; }
.result-num { font-size: 40px; font-weight: 700; letter-spacing: -0.5px; color: var(--primary-active); }
.result-label { margin-top: 8px; font-size: 14.5px; color: var(--muted); }

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

.case-cta { padding: 88px 24px; text-align: center; background: var(--surface-soft); border-top: 1px solid var(--hairline); }
.case-cta-inner { max-width: 520px; margin: 0 auto; }
.case-cta h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 14px; }
.case-cta p { color: var(--muted); font-size: 15.5px; margin-bottom: 28px; }
