:root {
  --bg: #FBF6EF;
  --bg-alt: #F3E8DA;
  --surface: #FFFFFF;
  --text: #2E2620;
  --text-muted: #6B5F55;
  --accent: #B8674F;
  --accent-dark: #98503C;
  --accent-soft: #EFD9CC;
  --border: #E7D9C6;
  --shadow: 0 20px 40px -24px rgba(46, 38, 32, 0.25);
  --radius-lg: 20px;
  --radius-md: 14px;
  --container: 1120px;
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Thank-you page */
.thank-you-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.thank-you-main {
  display: grid;
  place-items: center;
  padding: 72px 0;
}

.thank-you-card {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(36px, 7vw, 72px);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.thank-you-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.thank-you-icon svg { width: 36px; height: 36px; }
.thank-you-card h1 { font-size: clamp(2.2rem, 7vw, 4.6rem); }
.thank-you-card .section-text { max-width: 540px; margin: 0 auto 28px; }
.thank-you-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.thank-you-footer { padding: 24px; text-align: center; color: var(--text-muted); }

.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #d89a7d);
  z-index: 1000;
  pointer-events: none;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 .5em;
  color: var(--text);
}

p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 1000;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 246, 239, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.logo span { color: var(--accent); }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 32px;
}

.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--accent);
}

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 999px;
}
.nav-cta:hover { background: var(--accent-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Hero */
.hero {
  padding: 96px 0 80px;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
}

.eyebrow, .section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
}

.availability {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 7px 13px;
  border: 1px solid rgba(61, 133, 88, 0.25);
  border-radius: 999px;
  background: rgba(88, 163, 111, 0.09);
  color: #376f4b;
  font-size: 0.78rem;
  font-weight: 700;
}
.availability span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4c9b67;
  box-shadow: 0 0 0 0 rgba(76, 155, 103, 0.38);
  animation: availability-pulse 2.2s ease-out infinite;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
}
.hero-accent {
  position: relative;
  white-space: nowrap;
  color: var(--accent-dark);
}
.hero-accent::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.08em;
  width: 100%;
  height: 0.14em;
  border-radius: 999px;
  background: var(--accent-soft);
  transform: scaleX(0);
  transform-origin: left;
  animation: accent-draw 0.8s 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: -1;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 46ch;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow .2s ease;
  cursor: pointer;
  min-height: 44px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.magnetic-btn span { transition: transform 0.2s ease; }
.magnetic-btn:hover span { transform: translate(2px, -2px); }

.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-media {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-blob {
  position: absolute;
  width: 340px;
  height: 340px;
  background: var(--accent-soft);
  border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%;
  z-index: 0;
}

.hero-photo {
  position: relative;
  z-index: 1;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid var(--surface);
  box-shadow: var(--shadow);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

/* Moving expertise ribbon */
.expertise-strip {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 15px 0;
}
.expertise-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: expertise-scroll 28s linear infinite;
}
.expertise-track span {
  padding: 0 28px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}
.expertise-track i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.expertise-strip:hover .expertise-track { animation-play-state: paused; }

/* Brand proof */
.brand-strip {
  padding: 42px 0 46px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand-strip-label {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-align: center;
  text-transform: uppercase;
}
.brand-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
}
.brand-list span {
  min-height: 68px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: clamp(0.88rem, 1.3vw, 1rem);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  filter: grayscale(1);
  opacity: 0.72;
  transition: opacity 0.25s ease, filter 0.25s ease, color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.brand-list span:hover {
  opacity: 1;
  filter: none;
  color: var(--accent-dark);
  background: var(--surface);
  border-color: var(--border);
  transform: translateY(-3px);
}

/* Sections */
.section {
  padding: 88px 0;
}
.section-alt {
  background: var(--bg-alt);
}
.section h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin-bottom: 24px;
}
.section-text {
  color: var(--text-muted);
  max-width: 68ch;
  font-size: 1.05rem;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}

.education-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}
.card-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}
.education-card h3 { margin-bottom: 6px; }
.muted { color: var(--text-muted); margin: 0; }

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 40px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline-date {
  font-weight: 700;
  color: var(--accent);
}
.timeline-location {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.timeline-content h3 { margin-bottom: 4px; }
.timeline-company {
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.timeline-content ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-content li {
  position: relative;
  padding-left: 22px;
  color: var(--text);
}
.timeline-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.skill-card h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-soft);
}
.skill-card ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill-card li {
  font-size: 0.92rem;
  color: var(--text-muted);
  position: relative;
  padding-left: 16px;
}
.skill-card li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.soft-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.soft-skills span {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: 999px;
}

/* Case studies */
.case-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-top: 32px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.case-block:hover { border-color: rgba(184, 103, 79, 0.45); }
.case-block:first-of-type {
  margin-top: 40px;
}
.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.case-head h3 {
  margin: 0;
}
.case-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.case-title-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.case-title-group h3 { line-height: 1.28; }
.case-toggle-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font: 600 1.25rem/1 var(--font-body);
  transition: transform 0.25s ease, background 0.25s ease;
}
.case-block.is-open .case-toggle-icon {
  transform: rotate(45deg);
  background: var(--accent);
  color: #fff;
}
.case-collapsible {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.case-collapsible-inner { overflow: hidden; }
.case-block.is-open .case-collapsible {
  grid-template-rows: 1fr;
  opacity: 1;
}
.case-tag {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.case-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.case-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-muted);
}
.case-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}
.case-gallery figure {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.case-gallery figure:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 32px -20px rgba(46, 38, 32, 0.5);
}
.case-gallery img {
  width: 100%;
  aspect-ratio: 9 / 12;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.case-gallery figure:hover img { transform: scale(1.035); }
.case-gallery figcaption {
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.mini-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 20px 0;
}
.mini-table-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 12px 16px;
  font-size: 0.9rem;
}
.mini-table-row:nth-child(even) {
  background: var(--bg-alt);
}
.mini-table-head {
  background: var(--accent) !important;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mini-table-row .down {
  color: var(--accent-dark);
  font-weight: 700;
}

/* Stats / case study */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.stat-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  color: var(--accent);
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}
.stat-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  font-weight: 600;
  font-size: 0.95rem;
}
.stat-row small {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Contact */
.contact-section {
  text-align: center;
}
.contact-inner {
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 24px;
  margin-bottom: 0;
}
.contact-note a {
  color: var(--accent);
  font-weight: 600;
}

.contact-methods {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}
.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.contact-pill svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent);
}
.contact-pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.contact-form {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
  margin-top: 8px;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-row label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.form-row input,
.form-row textarea {
  font: inherit;
  font-size: 1rem;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
  resize: vertical;
}
.form-row input:focus-visible,
.form-row textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
.contact-form .btn {
  align-self: flex-start;
  border: none;
}
.contact-form .btn:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}
.form-status {
  display: none;
  margin: -4px 0 0;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
}
.form-status.is-visible { display: block; }
.form-status.is-success {
  background: rgba(88, 163, 111, 0.12);
  color: #2e6642;
  border: 1px solid rgba(61, 133, 88, 0.22);
}
.form-status.is-error {
  background: rgba(184, 103, 79, 0.1);
  color: var(--accent-dark);
  border: 1px solid rgba(184, 103, 79, 0.22);
}

/* Footer */
.site-footer {
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: grid;
  place-items: center;
  padding: 32px;
  border: 0;
  background: rgba(31, 24, 20, 0.88);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.image-lightbox.is-open { opacity: 1; visibility: visible; }
.image-lightbox img {
  max-width: min(920px, 92vw);
  max-height: 84vh;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.timeline .reveal:nth-child(2) { transition-delay: 0.1s; }

.skills-grid .reveal:nth-child(1) { transition-delay: 0s; }
.skills-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.skills-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.skills-grid .reveal:nth-child(4) { transition-delay: 0.24s; }

.stats-grid .reveal:nth-child(1) { transition-delay: 0s; }
.stats-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.stats-grid .reveal:nth-child(3) { transition-delay: 0.2s; }

/* Hero entrance */
.hero-anim {
  opacity: 0;
  animation: hero-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-anim-1 { animation-delay: 0.05s; }
.hero-anim-2 { animation-delay: 0.2s; }

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

@keyframes accent-draw { to { transform: scaleX(1); } }
@keyframes expertise-scroll { to { transform: translateX(-50%); } }
@keyframes availability-pulse {
  70% { box-shadow: 0 0 0 7px rgba(76, 155, 103, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 155, 103, 0); }
}

.hero-blob {
  animation: blob-float 7s ease-in-out infinite;
}
@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(0, -14px) scale(1.03); }
}

.hero-photo {
  transition: transform 0.4s ease;
}
.hero-media:hover .hero-photo {
  transform: translateY(-4px);
}

/* Card hover lift */
.skill-card,
.stat-card,
.timeline-item,
.education-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.skill-card:hover,
.stat-card:hover,
.timeline-item:hover,
.education-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 48px -24px rgba(46, 38, 32, 0.32);
}

.soft-skills span {
  transition: transform 0.2s ease, background 0.2s ease;
}
.soft-skills span:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* Nav underline */
.main-nav ul li a:not(.nav-cta) {
  position: relative;
}
.main-nav ul li a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.main-nav ul li a:not(.nav-cta):hover::after,
.main-nav ul li a:not(.nav-cta):focus-visible::after,
.main-nav ul li a.active::after {
  width: 100%;
}
.main-nav ul li a.active { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-anim {
    opacity: 1;
    animation: none;
  }
  .hero-blob {
    animation: none;
  }
  .hero-accent::after { animation: none; transform: scaleX(1); }
  .expertise-track { animation: none; }
  .availability span { animation: none; }
  .case-collapsible { transition: none; }
}

/* Chat widget */
.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 90px;
  z-index: 200;
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.chat-toggle:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}
.chat-toggle svg {
  width: 26px;
  height: 26px;
}
.chat-icon-close { display: none; }
.chat-toggle.is-open .chat-icon-open { display: none; }
.chat-toggle.is-open .chat-icon-close { display: block; }

.chat-panel[hidden] {
  display: none;
}
.chat-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: min(360px, calc(100vw - 48px));
  height: min(480px, calc(100vh - 160px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--accent);
  color: #fff;
}
.chat-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.98rem;
}
.chat-subtitle {
  margin: 2px 0 0;
  font-size: 0.78rem;
  opacity: 0.85;
}
.chat-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  display: flex;
}
.chat-close svg { width: 20px; height: 20px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.chat-msg-bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg-user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 14px;
}
.chat-msg-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: chat-bounce 1.2s infinite ease-in-out;
}
.chat-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input-row input {
  flex: 1;
  font: inherit;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  min-height: 40px;
}
.chat-input-row input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chat-input-row button {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.chat-input-row button:hover {
  background: var(--accent-dark);
}
.chat-input-row button svg {
  width: 18px;
  height: 18px;
}

.chat-whatsapp-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease;
}
.chat-whatsapp-link svg {
  width: 16px;
  height: 16px;
  color: #25d366;
  flex-shrink: 0;
}
.chat-whatsapp-link:hover {
  color: var(--text);
  background: var(--accent-soft);
}

@media (max-width: 480px) {
  .chat-widget { right: 16px; bottom: 76px; }
  .chat-panel {
    width: calc(100vw - 32px);
    height: min(70vh, 520px);
    bottom: 72px;
  }
}

/* Enhanced portfolio interactions */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1714;
  --bg-alt: #261e1a;
  --surface: #302620;
  --text: #f8eee5;
  --text-muted: #c8b8aa;
  --accent: #d4876d;
  --accent-dark: #efa088;
  --accent-soft: #4a3028;
  --border: #4b3a31;
  --shadow: 0 22px 46px -25px rgba(0, 0, 0, 0.72);
}
html[data-theme="dark"] .site-header { background: rgba(28, 23, 20, 0.9); }
html[data-theme="dark"] .hero-photo img { filter: brightness(.92) saturate(.9); }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.main-nav { display: flex; align-items: center; gap: 18px; }
.theme-toggle,
.back-to-top {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.theme-toggle svg { width: 19px; height: 19px; }
.theme-sun { display: none; }
html[data-theme="dark"] .theme-sun { display: block; }
html[data-theme="dark"] .theme-moon { display: none; }

.timeline { position: relative; z-index: 0; isolation: isolate; padding-left: 28px; --timeline-progress: 0%; }
.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  width: 2px;
  height: var(--timeline-progress);
  max-height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: height .12s linear;
}
.timeline::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 2px;
  z-index: -1;
  background: var(--border);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 36px;
  width: 10px;
  height: 10px;
  border: 3px solid var(--bg-alt);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.timeline-item { position: relative; }

.case-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}
.case-filters button {
  min-height: 44px;
  padding: 9px 17px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font: 600 .86rem/1 var(--font-body);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.case-filters button:hover { transform: translateY(-2px); border-color: var(--accent); }
.case-filters button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.case-block.is-filtered-out { display: none; }
.comparison-label { margin: 20px 0 -6px; color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }

.back-to-top {
  position: fixed;
  right: 31px;
  bottom: 164px;
  z-index: 190;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease, background .2s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--accent-soft); }
.back-to-top svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
  .main-nav { gap: 10px; }
  .theme-toggle { width: 40px; height: 40px; }
}
@media (max-width: 480px) {
  .timeline { padding-left: 20px; }
  .timeline-item::before { left: -24px; }
  .case-filters { gap: 8px; }
  .case-filters button { flex: 1 1 auto; }
  .back-to-top { right: 23px; bottom: 142px; }
}
@media (prefers-reduced-motion: reduce) {
  .timeline::before, .back-to-top { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-msg-typing span { animation: none; }
}

/* Focus states */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Responsive */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .about-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; }
  .brand-list { grid-template-columns: repeat(3, 1fr); }

  .nav-toggle { display: flex; }
  .main-nav ul {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .main-nav ul.open { display: flex; }
  .nav-cta { align-self: flex-start; }
}

@media (max-width: 480px) {
  .hero { padding: 64px 0 56px; }
  .section { padding: 64px 0; }
  .hero-photo { width: 220px; height: 220px; }
  .hero-blob { width: 260px; height: 260px; }
  .brand-list { grid-template-columns: repeat(2, 1fr); }
  .brand-list span { min-height: 60px; }

  .case-block { padding: 24px 20px; }
  .case-head { align-items: flex-start; }
  .case-tag { white-space: normal; }
  .case-gallery { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mini-table-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 4px;
  }
  .mini-table-row span:first-child {
    grid-column: 1 / -1;
    font-weight: 700;
  }
}
