@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=DM+Sans:wght@400;500&display=swap");

:root {
  --bg: #f7f6f3;
  --text: #151515;
  --muted: #6f6f6f;
  --accent: #151515;
  --border: #dcdad6;
  --card-bg: #ffffff;
  /* Graphic accents (not for body text): deep navy and burnt amber, lightened in dark mode */
  --blue: #1f3f94;
  --amber: #b45309;
  --radius: 0.5rem;
  --max-width: 1100px;
  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

h1, h2, h3 {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 2px;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1.25rem 0;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-header nav a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.site-header nav a:hover {
  opacity: 0.6;
}

/* Anchored sections clear the sticky header */

section[id] {
  scroll-margin-top: 4.5rem;
}

/* Hero */

.hero {
  padding: 4.5rem 1.5rem 4rem;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero h1 {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  line-height: 0.95;
}

.core-line {
  margin: 1.75rem 0 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.3;
}

.hero .lead {
  margin: 1.25rem 0 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.engagement {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.hero-actions {
  margin: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}

.text-link {
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 30%, transparent);
  padding-bottom: 2px;
}

.text-link:hover {
  border-color: var(--text);
}

/* Flow graphic: numbered path from amber (rule) to blue (outcome). Horizontal by default. */

.flow {
  list-style: none;
  margin: 3.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--n, 5), 1fr);
  gap: 0 1.25rem;
}

.flow li {
  /* Fallback: smooth blend. Browsers with round() get a crisp two-tone version below. */
  --c: color-mix(in srgb, var(--blue) calc(var(--t, 0) * 100%), var(--amber));
  --c-next: var(--c);
  --dir: to right;
  position: relative;
  padding-top: 2rem;
  animation: flow-in 0.6s ease-out both;
  animation-delay: calc(var(--t, 0) * 0.9s);
}

.flow li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--c);
  background: var(--bg);
}

.flow li:last-child::before {
  background: var(--c);
}

.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 14px;
  right: -1.25rem;
  height: 2px;
  background: linear-gradient(var(--dir), var(--c), var(--c-next));
  clip-path: inset(0 100% 0 0);
  animation: flow-line-x 0.7s ease-out forwards;
  animation-delay: calc(var(--t, 0) * 0.9s + 0.25s);
}

.flow strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
}

.flow span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted);
}

.flow abbr {
  text-decoration: none;
}

/* Two-tone: amber up to the midpoint, then blue. The line blends from a step's colour to the next one's. */

@supports (width: round(1.4px, 1px)) {
  .flow li {
    --c: color-mix(in srgb, var(--blue) calc(round(var(--t, 0), 1) * 100%), var(--amber));
    --c-next: color-mix(in srgb, var(--blue) calc(round(var(--t, 0) + 1 / (var(--n, 5) - 1), 1) * 100%), var(--amber));
  }

  .ai-week {
    --c: color-mix(in srgb, var(--blue) calc(round(var(--t, 0), 1) * 100%), var(--amber));
  }
}

@keyframes flow-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@keyframes flow-line-x {
  to { clip-path: inset(0); }
}

@keyframes flow-line-y {
  to { clip-path: inset(0); }
}

/* Hero path goes vertical on small screens */

@media (max-width: 759px) {
  .flow-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem 0;
    margin-top: 2.5rem;
  }

  .flow-hero li {
    padding-top: 0;
    padding-left: 2rem;
  }

  .flow-hero li::before {
    top: 0.25rem;
  }

  .flow-hero li:not(:last-child)::after {
    top: calc(0.25rem + 14px);
    bottom: calc(-1.5rem - 0.25rem);
    left: 6px;
    right: auto;
    width: 2px;
    height: auto;
    --dir: to bottom;
    clip-path: inset(0 0 100% 0);
    animation-name: flow-line-y;
  }
}

/* Sections */

.section {
  padding: 5rem 1.5rem;
  border-top: 1px solid var(--border);
}

.section h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 3rem;
}

/* Services */

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

.offer-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.offer-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.offer-card .problem {
  margin: 0 0 0.75rem;
  font-weight: 500;
}

.offer-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.offer-card .problem {
  color: var(--text);
}

.offer-card-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: center;
}

.offer-card-wide .flow-route {
  margin: 0;
}

@media (min-width: 860px) {
  .offer-card-wide {
    grid-template-columns: 1.3fr 1fr;
    gap: 3rem;
  }
}

.offer-card-wide p:not(.problem) {
  max-width: 48rem;
}

.hero .lead-bridge {
  margin-top: 0.75rem;
}

.entry-offer {
  margin: 2.5rem 0 0;
  max-width: 40rem;
  color: var(--muted);
}

.entry-offer strong {
  color: var(--text);
}

/* Selected work (clickable tiles) */

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

.project-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--blue));
}

/* Key figure on each tile */

.project-card p.project-figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin: 0 0 1.1rem;
}

.figure-number {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--blue);
}

.figure-label {
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--muted);
}

/* Optional illustration at the top of a tile: <img class="project-art"> */

.project-art {
  display: block;
  width: calc(100% + 3.5rem);
  max-width: none;
  margin: -1.75rem -1.75rem 1.25rem;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.project-card:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}

.project-meta {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.project-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.project-card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

.project-card p.project-meta {
  margin-bottom: 0.75rem;
}

.project-link {
  margin-top: auto;
  padding-top: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.project-card:hover .project-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* How I work */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.steps li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.steps h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

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

/* Applied AI */

#ai .ai-intro {
  margin: 0 0 1.5rem;
  max-width: 40rem;
  font-size: 1.05rem;
}

.ai-weeks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}

.ai-week {
  --c: color-mix(in srgb, var(--blue) calc(var(--t, 0) * 100%), var(--amber));
  position: relative;
  border-top: 3px solid var(--c);
  padding-top: 1.5rem;
}

.ai-week::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--c);
  border: 3px solid var(--bg);
}

.ai-week-label {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c);
}

.ai-week h3 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.ai-week p {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.ai-week .ai-get {
  color: var(--text);
}

.ai-note {
  margin: 2.5rem 0 0;
  max-width: 44rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.about-figure {
  margin: 0;
  max-width: 280px;
}

.about-photo {
  max-width: 280px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card-bg);
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-text {
  max-width: 40rem;
}

.about-text > p:first-child {
  margin-top: 0;
}

.credentials {
  margin: 1.5rem 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.credentials li {
  margin: 0.25rem 0;
}

.about-note {
  margin: 0 0 1.25rem;
  font-weight: 500;
}

.about-links {
  margin: 0;
  color: var(--muted);
}

.about-links a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-links span {
  margin: 0 0.35rem;
}

/* Buttons and contact */

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.75rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
  font-size: 1rem;
}

.cta-button:hover {
  opacity: 0.9;
}

#contact .cta-button {
  margin-top: 2rem;
}

/* Footer */

footer {
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

footer p {
  margin: 0;
}

footer .made-with {
  font-style: italic;
}

footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

footer a:hover {
  color: var(--text);
}

/* Larger screens */

@media (min-width: 760px) {
  .about-grid {
    grid-template-columns: 280px 1fr;
    gap: 4rem;
    align-items: start;
  }

  .hero {
    padding-top: 5.5rem;
  }
}

/* Dark mode */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151515;
    --text: #f7f6f3;
    --muted: #a3a3a3;
    --accent: #f7f6f3;
    --border: rgba(255, 255, 255, 0.1);
    --card-bg: #1f1f1f;
    --blue: #8fb0ff;
    --amber: #f5a54a;
  }
}

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

  .flow li,
  .flow li::after {
    animation: none;
    clip-path: none;
  }

  .project-card {
    transition: none;
  }

  .project-card:hover {
    transform: none;
  }
}
