:root {
  --ink: #111111;
  --paper: #ffffff;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --accent: #111111;
  --max: 1240px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo, .hero-title, .status, .info-num {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

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

ul { list-style: none; margin: 0; padding: 0; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2.5rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  gap: 2rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a {
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.nav a:hover { opacity: 1; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
}

/* ---------- HERO ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 2.5rem 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1fr;
  gap: 3rem;
}

.hero-title {
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 0.95;
  font-weight: 700;
  margin: 0 0 2.5rem;
  letter-spacing: -0.02em;
}

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

.type-cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  margin-left: 4px;
  background: var(--ink);
  vertical-align: -0.1em;
  animation: cursor-blink 0.9s steps(1) infinite;
}

@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.socials {
  display: flex;
  gap: 1.1rem;
  margin-bottom: 3rem;
}

.socials svg {
  width: 20px;
  height: 20px;
}

.socials a {
  opacity: 0.7;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.socials a:hover { opacity: 1; transform: translateY(-2px); }

.tags {
  border-top: 1px solid var(--line);
}

.tags li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--muted);
  cursor: default;
  transition: color 0.15s ease, font-weight 0.15s ease;
}

.tags li:hover {
  color: var(--ink);
  font-weight: 600;
}

.eyebrow {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1rem;
}

.info-block { margin-bottom: 1.8rem; }

.info-num {
  font-weight: 600;
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.info-block ul li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  color: #333;
}

.info-block ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

.hero-photo {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 1.5rem;
  filter: grayscale(15%);
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 1.4rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2fbf6e;
  display: inline-block;
  position: relative;
}

.dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #2fbf6e;
  animation: pulse-ring 1.8s ease-out infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.8); opacity: 0; }
}

.based {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-primary {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

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

/* ---------- SECTIONS ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 2.5rem;
  border-top: 1px solid var(--line);
}

.section-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 2.5rem;
}

.about-text {
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 60ch;
  margin: 0 0 2.5rem;
}

.marquee-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 1rem;
}

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 22s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  padding-right: 2rem;
}

.marquee-group span:not(.marquee-dot) {
  margin-right: 2rem;
}

.marquee-dot {
  color: var(--muted);
  margin-right: 2rem;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

.job { margin-bottom: 3rem; }

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.job-head h3 {
  font-size: 1.3rem;
  margin: 0;
}

.job-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.job ul li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.5rem;
  max-width: 70ch;
}

.job ul li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: var(--muted);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2rem;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.project-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1.15rem;
}

.project-card p {
  color: #333;
  font-size: 0.95rem;
  margin: 0 0 1.2rem;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stack span {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #f2f2f2;
  color: var(--muted);
}

/* ---------- FOOTER ---------- */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 5rem 2.5rem 3rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 1rem;
}

.footer p {
  color: var(--muted);
  margin: 0 0 2rem;
}

.footer-bottom {
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-right {
    align-items: flex-start;
    text-align: left;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ---------- CONFETTI (say hi button) ---------- */
.confetti-piece {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 999;
  animation: confetti-burst 0.7s ease-out forwards;
}

@keyframes confetti-burst {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(0.5);
    opacity: 0;
  }
}

/* ---------- SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.projects-grid .project-card.reveal:nth-child(2) { transition-delay: 0.08s; }
.projects-grid .project-card.reveal:nth-child(3) { transition-delay: 0.16s; }

@media (max-width: 640px) {
  .site-header { padding: 1.2rem 1.5rem; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.7rem 0; }
  .nav-toggle { display: flex; }
  .hero { padding: 2rem 1.5rem 3rem; }
  .section { padding: 3rem 1.5rem; }
  .footer { padding: 3rem 1.5rem 2rem; }
  .job-head { flex-direction: column; }
}

/* ---------- PROJECT CASE-STUDY PAGES ---------- */
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2rem;
  transition: color 0.15s ease;
}

.case-back:hover { color: var(--ink); }

.case-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 2.5rem 2rem;
}

.case-eyebrow {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.8rem;
}

.case-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.2rem;
  max-width: 20ch;
}

.case-pitch {
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 65ch;
  margin: 0 0 1.5rem;
}

.case-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.case-stack span {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #f2f2f2;
  color: var(--muted);
}

.case-body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 2.5rem 4rem;
}

.case-section {
  margin-bottom: 3rem;
}

.case-section h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.case-results li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.7rem;
  max-width: 70ch;
  font-size: 1.02rem;
}

.case-results li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: var(--muted);
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.case-gallery figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.case-gallery img {
  display: block;
  width: 100%;
  height: auto;
}

.case-gallery figcaption {
  padding: 0.9rem 1.2rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.case-cta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.case-cta p {
  color: var(--muted);
  margin: 0;
}

/* Static recreation of the finance-tracker dashboard for its case-study page */
.mini-dashboard {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2rem;
  background: #fafafa;
}

.mini-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mini-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.2rem;
}

.mini-card .mini-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.3rem;
}

.mini-card .mini-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.mini-value.positive { color: #2fbf6e; }
.mini-value.negative { color: #ff5c39; }

.mini-budgets {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.mini-budget-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.mini-budget-head .mini-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mini-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.mini-track {
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  border-radius: 999px;
}

.mini-over {
  color: #ff5c39;
  font-weight: 600;
}

.over-badge {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  background: #ff5c39;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  vertical-align: middle;
}

@media (max-width: 640px) {
  .case-hero { padding: 2rem 1.5rem 1.5rem; }
  .case-body { padding: 1rem 1.5rem 3rem; }
  .mini-summary { grid-template-columns: 1fr; }
}
