:root {
  --sophia-green: #acd084;
  --sophia-yellow: #fed272;
  --sophia-blue: #88c1f7;
  --sophia-navy: #2a3b71;
  --sophia-coral: #ed5e44;
  --sophia-pink: #f7b1cf;
  --sophia-cream: #ece9e6;
  --sophia-white: #ffffff;
  --sophia-ink: #212121;
  --section-hero-bg: #f3f7ec;
  --section-projects-bg: #f7fbff;
  --section-about-bg: #fed272;
  --section-skills-bg: #f8d9e8;
  --section-contact-bg: #ffffff;
  --font-heading: "Fredoka", sans-serif;
  --font-body: "Nunito", sans-serif;
  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --radius-xl: 44px;
  --radius-pill: 999px;
  --shadow-soft: 0 16px 35px rgba(42, 59, 113, 0.1);
  --container: 1180px;
  --page-gutter: clamp(1rem, 3vw, 2rem);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sophia-white);
  color: var(--sophia-navy);
  font-family: var(--font-body);
  line-height: 1.55;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--sophia-coral);
  outline-offset: 4px;
}

.sr-only,
.skip-link {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.skip-link:focus {
  clip: auto;
  background: var(--sophia-navy);
  border-radius: var(--radius-pill);
  color: var(--sophia-white);
  height: auto;
  left: 1rem;
  padding: 0.75rem 1rem;
  top: 1rem;
  width: auto;
  z-index: 100;
}

.site-header {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr auto 1fr;
  left: auto;
  margin: 0 auto;
  max-width: var(--container);
  padding: 1.25rem clamp(1rem, 3vw, 2rem);
  position: sticky;
  top: 0;
  transform: none;
  width: min(100%, var(--container));
  z-index: 20;
}

.wordmark {
  justify-self: start;
}

.wordmark {
  color: var(--sophia-navy);
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

.wordmark span {
  color: var(--sophia-coral);
  display: inline-block;
  font-size: 0.65em;
  transform: rotate(18deg) translateY(-0.2rem);
}

.site-nav {
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(42, 59, 113, 0.06);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 0.25rem;
  justify-self: center;
  padding: 0.5rem;
}

.site-nav a {
  border-radius: var(--radius-pill);
  font-weight: 800;
  padding: 0.74rem 1.15rem;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: var(--sophia-green);
  transform: translateY(-1px);
}

.button {
  align-items: center;
  border-radius: var(--radius-pill);
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 3rem;
  padding: 0.9rem 1.35rem;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.button-primary {
  background: var(--sophia-navy);
  color: var(--sophia-white);
}

.button-secondary {
  background: var(--sophia-white);
  border: 1px solid rgba(42, 59, 113, 0.12);
  color: var(--sophia-navy);
}

.button:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.menu-toggle {
  background: var(--sophia-white);
  border: 1px solid rgba(42, 59, 113, 0.12);
  border-radius: var(--radius-pill);
  display: none;
  height: 3rem;
  justify-content: center;
  padding: 0;
  width: 3rem;
}

.menu-toggle span:not(.sr-only) {
  background: var(--sophia-navy);
  border-radius: var(--radius-pill);
  display: block;
  height: 2px;
  margin: 3px auto;
  width: 1.25rem;
}

.section-shell {
  isolation: isolate;
  margin: 0;
  max-width: none;
  padding: clamp(2.4rem, 6vw, 5rem)
    max(var(--page-gutter), calc((100vw - var(--container)) / 2 + var(--page-gutter)));
  position: relative;
  width: 100%;
}

.hero,
.projects,
.about,
.playgrounds {
  padding-bottom: clamp(7rem, 10vw, 9rem);
}

.eyebrow {
  color: var(--sophia-coral);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.7rem;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--sophia-navy);
  font-family: var(--font-heading);
  line-height: 0.98;
}

h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  letter-spacing: 0;
  margin-bottom: 1.25rem;
  max-width: 760px;
}

h2 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.text-blue {
  color: var(--sophia-blue);
}

.hero {
  align-items: center;
  background: var(--section-hero-bg);
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.95fr);
  min-height: 700px;
  overflow: hidden;
  padding-bottom: 7rem;
  padding-top: clamp(1rem, 3vw, 2.2rem);
  z-index: 1;
}

.hero-text {
  color: #24345f;
  font-size: clamp(1.1rem, 2vw, 1.32rem);
  font-weight: 700;
  max-width: 610px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-visual {
  min-height: 590px;
  position: relative;
}

.portrait-card {
  aspect-ratio: 1;
  display: grid;
  margin-left: auto;
  max-width: 650px;
  place-items: center;
  position: relative;
}

.portrait-blob {
  background:
    radial-gradient(circle at 80% 20%, rgba(254, 210, 114, 0.95), transparent 32%),
    var(--sophia-blue);
  border-radius: 54% 46% 48% 52% / 44% 54% 46% 56%;
  height: 86%;
  position: absolute;
  width: 86%;
}

.portrait-img {
  filter: drop-shadow(0 22px 24px rgba(42, 59, 113, 0.16));
  position: relative;
  animation: soft-bob 5.8s ease-in-out infinite;
  width: min(92%, 570px);
  z-index: 2;
}

.decor {
  pointer-events: none;
  position: absolute;
  user-select: none;
  z-index: 3;
}

.decor-cloud {
  animation: float-left 8s ease-in-out infinite;
  left: -3%;
  top: 7%;
  width: 13rem;
}

.decor-flower {
  animation: wiggle 6s ease-in-out infinite;
  right: -4%;
  top: 43%;
  width: 9.5rem;
}

.decor-leaf {
  animation: soft-bob 7s ease-in-out infinite;
  bottom: 6%;
  left: 1%;
  width: 10rem;
}

.decor-star {
  animation: twinkle 3.6s ease-in-out infinite;
  right: 4%;
  top: 7%;
  width: 6rem;
}

.inline-decor {
  pointer-events: none;
  position: absolute;
}

.hero-spark {
  animation: twinkle 4s ease-in-out infinite;
  left: min(58vw, 760px);
  top: clamp(8rem, 17vw, 15rem);
  width: clamp(3rem, 5vw, 4.6rem);
  z-index: 2;
}

.shape-divider {
  bottom: -1px;
  height: clamp(90px, 9vw, 145px);
  left: 0;
  line-height: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 4;
}

.shape-divider svg {
  display: block;
  height: 100%;
  width: 100%;
}

.shape-divider-projects path {
  fill: var(--section-projects-bg);
}

.shape-divider-about path {
  fill: var(--section-about-bg);
}

.shape-divider-skills path {
  fill: var(--section-skills-bg);
}

.projects {
  background: var(--section-projects-bg);
  z-index: 2;
}

.about {
  background: var(--section-about-bg);
  z-index: 3;
}

.playgrounds {
  background: var(--section-skills-bg);
  z-index: 4;
}

.contact {
  background: var(--section-contact-bg);
  z-index: 5;
}

.section-sticker {
  opacity: 0.62;
  pointer-events: none;
  position: absolute;
  user-select: none;
  z-index: 0;
}

.projects-sticker {
  animation: twinkle 4.4s ease-in-out infinite;
  bottom: 2.2rem;
  right: 2.5rem;
  top: auto;
  width: 4.2rem;
}

.about-sticker {
  animation: float-left 7s ease-in-out infinite;
  right: 2rem;
  top: -3.5rem;
  width: clamp(7rem, 12vw, 11rem);
  z-index: 5;
}

.skills-sticker {
  animation: soft-bob 7s ease-in-out infinite;
  bottom: 2.5rem;
  right: 3rem;
  width: 7rem;
}

.section-heading {
  align-items: end;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 0.8fr) minmax(260px, 0.55fr);
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.project-grid,
.about-visual,
.about-copy,
.quality-panel,
.skill-cloud,
.contact-panel {
  position: relative;
  z-index: 1;
}

.section-heading p:not(.eyebrow) {
  color: #34426c;
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.projects .section-heading {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
}

.projects-pointer {
  animation: soft-bob 4.4s ease-in-out infinite;
  filter: drop-shadow(0 14px 16px rgba(42, 59, 113, 0.1));
  justify-self: end;
  max-width: 250px;
  width: min(24vw, 250px);
}

.project-grid {
  display: grid;
  align-items: stretch;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(42, 59, 113, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  padding: 0.75rem;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 430px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.project-feature {
  grid-column: auto;
  grid-row: auto;
}

.project-wide {
  grid-column: auto;
}

.project-full {
  grid-column: 1 / -1;
  min-height: 380px;
}

.project-card:not(.project-feature):not(.project-wide) {
  grid-column: auto;
}

.project-card:hover {
  box-shadow: 0 20px 38px rgba(42, 59, 113, 0.14);
  transform: translateY(-5px);
}

.project-card.is-interactive {
  cursor: pointer;
}

.project-card.is-interactive::after {
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-pill);
  bottom: 1rem;
  color: var(--sophia-navy);
  content: "Cliquer pour ouvrir";
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 1;
  padding: 0.45rem 0.7rem;
  pointer-events: none;
  position: absolute;
  right: 1rem;
  top: auto;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  z-index: 5;
}

.project-card.is-interactive:hover::after,
.project-card.is-interactive:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}

.project-card-trigger {
  background: transparent;
  border: 0;
  border-radius: var(--radius-lg);
  cursor: pointer;
  inset: 0;
  padding: 0;
  position: absolute;
  z-index: 4;
}

.project-card-trigger:focus-visible {
  outline: 4px solid var(--sophia-coral);
  outline-offset: -8px;
}

.project-visual {
  align-items: center;
  border-radius: calc(var(--radius-lg) - 8px);
  display: flex;
  flex: 1;
  justify-content: center;
  min-height: 285px;
  overflow: hidden;
  padding: 1.1rem;
  position: relative;
}

.project-feature .project-visual {
  min-height: 285px;
}

.project-feature h3 {
  font-size: 1.75rem;
}

.project-visual > span {
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-pill);
  color: var(--sophia-navy);
  font-size: 0.88rem;
  font-weight: 900;
  padding: 0.55rem 0.8rem;
  position: relative;
  z-index: 3;
}

.project-visual.has-cover {
  background: var(--sophia-cream);
}

.project-cover-img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  transform: scale(1.01);
  transition: transform 260ms ease;
  width: 100%;
  z-index: 1;
}

.project-visual.has-cover::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(42, 59, 113, 0.18)),
    radial-gradient(circle at 18% 12%, rgba(247, 177, 207, 0.38), transparent 28%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.project-card:hover .project-cover-img {
  transform: scale(1.055);
}

.shophia-visual .project-cover-img,
.web-visual .project-cover-img,
.photo-visual .project-cover-img {
  object-position: top center;
}

.project-cover-companion {
  object-position: 50% 18%;
}

.project-cover-photo-series {
  object-position: center center;
}

.project-visual.has-cover > .project-cover-img {
  bottom: auto;
  height: 100%;
  left: 0;
  opacity: 1;
  right: auto;
  top: 0;
  width: 100%;
}

.photo-visual {
  background:
    radial-gradient(circle at 18% 12%, var(--sophia-pink) 0 22%, transparent 23%),
    linear-gradient(145deg, #f8b5d3, #88c1f7);
}

.photo-visual img:not(.project-cover-img) {
  bottom: -2rem;
  opacity: 0.95;
  position: absolute;
  right: -2.4rem;
  width: 13rem;
}

.web-visual {
  background: linear-gradient(145deg, var(--sophia-green), #dceeba);
}

.mock-browser {
  background: var(--sophia-navy);
  border-radius: var(--radius-md);
  color: var(--sophia-white);
  display: grid;
  gap: 0.2rem;
  padding: 1.4rem;
  position: absolute;
  font-size: clamp(1.15rem, 2.1vw, 1.8rem);
  width: 82%;
}

.mock-browser b:nth-child(2) {
  color: var(--sophia-green);
}

.app-visual {
  background: linear-gradient(145deg, #ffd2e4, #fff1f7);
}

.phone-mockup {
  background:
    linear-gradient(var(--sophia-white), var(--sophia-white)) padding-box,
    linear-gradient(150deg, var(--sophia-pink), var(--sophia-blue)) border-box;
  border: 6px solid transparent;
  border-radius: 26px;
  height: 72%;
  position: absolute;
  right: 28%;
  width: 30%;
}

.phone-mockup.small {
  height: 62%;
  right: 11%;
  top: 26%;
  width: 26%;
}

.campus-visual {
  background: linear-gradient(145deg, var(--sophia-yellow), #fff3c9);
}

.campus-visual img:not(.project-cover-img) {
  bottom: -1.8rem;
  position: absolute;
  right: -1rem;
  width: 13rem;
}

.project-meta {
  align-items: start;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: auto 1fr;
  padding: 1rem 0.35rem 0.55rem;
}

.project-number {
  align-items: center;
  border-radius: 50%;
  display: inline-flex;
  font-family: var(--font-heading);
  font-weight: 700;
  height: 2.55rem;
  justify-content: center;
  width: 2.55rem;
}

.accent-green .project-number,
.accent-green .tag-row span {
  background: var(--sophia-green);
}

.accent-blue .project-number,
.accent-blue .tag-row span {
  background: var(--sophia-blue);
}

.accent-pink .project-number,
.accent-pink .tag-row span {
  background: var(--sophia-pink);
}

.accent-yellow .project-number,
.accent-yellow .tag-row span {
  background: var(--sophia-yellow);
}

.project-meta p {
  color: #38476f;
  font-weight: 800;
  margin-bottom: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 0.35rem 0.4rem 3.7rem;
}

.tag-row span,
.skill-cloud span {
  border-radius: var(--radius-pill);
  color: var(--sophia-navy);
  font-size: 0.9rem;
  font-weight: 900;
  padding: 0.5rem 0.82rem;
}

.project-modal-shell {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  opacity: 0;
  padding: clamp(1rem, 3vw, 2rem);
  pointer-events: none;
  position: fixed;
  transition: opacity 220ms ease;
  z-index: 80;
}

.project-modal-shell.is-open {
  opacity: 1;
  pointer-events: auto;
}

.project-modal-backdrop {
  backdrop-filter: blur(12px);
  background: rgba(42, 59, 113, 0.34);
  inset: 0;
  position: absolute;
}

.flower-bloom {
  height: min(56vw, 620px);
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(56vw, 620px);
  z-index: 1;
}

.petal {
  background: var(--petal-color, var(--sophia-pink));
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 58% 42% 60% 40% / 54% 46% 54% 46%;
  box-shadow: 0 18px 40px rgba(42, 59, 113, 0.12);
  height: 42%;
  left: 50%;
  opacity: 0;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(var(--petal-angle)) translateY(0) scale(0.25);
  transform-origin: 50% 86%;
  width: 26%;
}

.project-modal-shell.is-open .petal {
  animation: bloom-petal 820ms cubic-bezier(0.2, 0.9, 0.25, 1) forwards;
  animation-delay: var(--petal-delay, 0ms);
}

.petal-1 {
  --petal-angle: 0deg;
  --petal-color: rgba(247, 177, 207, 0.8);
}

.petal-2 {
  --petal-angle: 45deg;
  --petal-color: rgba(254, 210, 114, 0.78);
  --petal-delay: 40ms;
}

.petal-3 {
  --petal-angle: 90deg;
  --petal-color: rgba(172, 208, 132, 0.78);
  --petal-delay: 80ms;
}

.petal-4 {
  --petal-angle: 135deg;
  --petal-color: rgba(136, 193, 247, 0.78);
  --petal-delay: 120ms;
}

.petal-5 {
  --petal-angle: 180deg;
  --petal-color: rgba(247, 177, 207, 0.72);
  --petal-delay: 160ms;
}

.petal-6 {
  --petal-angle: 225deg;
  --petal-color: rgba(254, 210, 114, 0.72);
  --petal-delay: 200ms;
}

.petal-7 {
  --petal-angle: 270deg;
  --petal-color: rgba(172, 208, 132, 0.72);
  --petal-delay: 240ms;
}

.petal-8 {
  --petal-angle: 315deg;
  --petal-color: rgba(136, 193, 247, 0.72);
  --petal-delay: 280ms;
}

.project-modal {
  background: #fffaf3;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 90px rgba(24, 36, 78, 0.26);
  display: grid;
  gap: clamp(1.2rem, 3vw, 2rem);
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1fr);
  max-height: min(780px, calc(100vh - 2rem));
  max-width: 980px;
  opacity: 0;
  overflow: auto;
  padding: clamp(1rem, 3vw, 1.5rem);
  position: relative;
  transform: translateY(1.25rem) scale(0.92);
  transition:
    opacity 260ms ease 360ms,
    transform 380ms cubic-bezier(0.2, 0.9, 0.25, 1) 360ms;
  width: min(100%, 980px);
  z-index: 2;
}

.project-modal-shell.is-open .project-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-close {
  align-items: center;
  background: var(--sophia-white);
  border: 1px solid rgba(42, 59, 113, 0.1);
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(42, 59, 113, 0.12);
  color: var(--sophia-navy);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  height: 2.8rem;
  justify-content: center;
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 2.8rem;
  z-index: 3;
}

.modal-visual {
  align-self: stretch;
  min-height: 380px;
}

.modal-visual-card {
  align-items: center;
  background:
    radial-gradient(circle at 22% 16%, rgba(247, 177, 207, 0.96) 0 25%, transparent 26%),
    linear-gradient(145deg, #f8b5d3, #88c1f7);
  border-radius: calc(var(--radius-xl) - 12px);
  display: grid;
  height: 100%;
  justify-items: center;
  min-height: 380px;
  overflow: hidden;
  padding: 1.2rem;
  position: relative;
}

.modal-visual-card span {
  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 0.6rem 0.9rem;
  position: relative;
  z-index: 2;
}

.modal-visual-card img {
  bottom: -2rem;
  position: absolute;
  right: -2rem;
  width: min(65%, 260px);
}

.modal-content {
  align-self: center;
  padding: clamp(1rem, 3vw, 2rem) clamp(0.4rem, 2vw, 1rem);
}

.modal-content h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

.modal-content p:not(.eyebrow) {
  color: #34426c;
  font-size: 1.05rem;
  font-weight: 800;
}

.project-detail-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.3rem 0;
}

.project-detail-list div {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(42, 59, 113, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.project-detail-list dt {
  color: var(--sophia-coral);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.project-detail-list dd {
  color: var(--sophia-navy);
  font-weight: 800;
  margin: 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.project-modal {
  display: block;
  max-height: min(840px, calc(100vh - 2rem));
  max-width: 1080px;
  overflow-y: auto;
  padding: 0;
}

.modal-hero {
  display: grid;
  gap: clamp(1.2rem, 3vw, 2rem);
  grid-template-columns: minmax(300px, 0.85fr) minmax(320px, 1fr);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.modal-visual {
  align-self: stretch;
  border-radius: calc(var(--radius-xl) - 12px);
  min-height: 360px;
  overflow: hidden;
  position: relative;
}

.modal-visual img {
  height: 100%;
  object-fit: cover;
  object-position: top center;
  width: 100%;
}

.modal-scroll-content {
  border-top: 1px solid rgba(42, 59, 113, 0.08);
  padding: clamp(1.1rem, 3vw, 1.8rem);
}

.modal-section {
  margin-bottom: 1.2rem;
}

.modal-section h3 {
  font-size: 1.45rem;
  margin-bottom: 0.45rem;
}

.modal-section p {
  color: #34426c;
  font-weight: 800;
  margin-bottom: 0;
}

.modal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.modal-chip-row span {
  background: var(--sophia-green);
  border-radius: var(--radius-pill);
  color: var(--sophia-navy);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
}

.modal-chip-row span:nth-child(2n) {
  background: var(--sophia-blue);
}

.modal-chip-row span:nth-child(3n) {
  background: var(--sophia-yellow);
}

.modal-gallery {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal-gallery figure {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(42, 59, 113, 0.08);
  border-radius: var(--radius-md);
  margin: 0;
  overflow: hidden;
}

.gallery-image-button {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.modal-gallery img {
  aspect-ratio: 4 / 3;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 220ms ease;
  width: 100%;
}

.gallery-image-button:hover img,
.gallery-image-button:focus-visible img {
  transform: scale(1.04);
}

.modal-gallery figcaption {
  color: #34426c;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 0.65rem 0.75rem 0.75rem;
}

.project-modal-link-hidden {
  display: none;
}

.image-lightbox {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  opacity: 0;
  padding: clamp(1rem, 3vw, 2rem);
  pointer-events: none;
  position: fixed;
  transition: opacity 180ms ease;
  z-index: 120;
}

.image-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.image-lightbox-backdrop {
  backdrop-filter: blur(10px);
  background: rgba(42, 59, 113, 0.58);
  border: 0;
  cursor: zoom-out;
  inset: 0;
  position: absolute;
}

.image-lightbox-panel {
  background: #fffaf3;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 90px rgba(24, 36, 78, 0.34);
  margin: 0;
  max-height: calc(100vh - 2rem);
  max-width: min(1120px, calc(100vw - 2rem));
  overflow: hidden;
  padding: 0.75rem;
  position: relative;
  transform: scale(0.96);
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.25, 1);
  z-index: 1;
}

.image-lightbox.is-open .image-lightbox-panel {
  transform: scale(1);
}

.image-lightbox-panel img {
  border-radius: calc(var(--radius-lg) - 10px);
  display: block;
  max-height: calc(100vh - 7rem);
  max-width: 100%;
  object-fit: contain;
}

.image-lightbox-panel figcaption {
  color: var(--sophia-navy);
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 0.75rem 0.4rem 0.2rem;
  text-align: center;
}

.image-lightbox-close {
  align-items: center;
  background: var(--sophia-white);
  border: 1px solid rgba(42, 59, 113, 0.1);
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(42, 59, 113, 0.12);
  color: var(--sophia-navy);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  height: 2.75rem;
  justify-content: center;
  position: absolute;
  right: 1.1rem;
  top: 1.1rem;
  width: 2.75rem;
  z-index: 2;
}

.about {
  align-items: center;
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: minmax(340px, 0.75fr) minmax(280px, 0.9fr);
  min-height: 720px;
}

.about-visual {
  align-self: end;
}

.about-visual img {
  filter: drop-shadow(0 18px 20px rgba(42, 59, 113, 0.1));
  animation: about-float 4.5s ease-in-out infinite;
  margin-left: -1rem;
  width: min(560px, 112%);
}

.about-copy {
  max-width: 520px;
}

.about-copy p:not(.eyebrow) {
  color: #34426c;
  font-size: 1.05rem;
  font-weight: 700;
}

.note-line {
  color: var(--sophia-coral) !important;
  font-family: var(--font-heading);
  font-size: 1.3rem !important;
  transform: rotate(-2deg);
}

.quality-panel {
  background: var(--sophia-yellow);
  border-radius: 30% 70% 50% 50% / 46% 35% 65% 54%;
  display: grid;
  gap: 1rem;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: clamp(1.6rem, 4vw, 3rem);
}

.quality-panel article {
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.quality-panel span {
  background: var(--sophia-white);
  border-radius: 50%;
  display: inline-grid;
  font-family: var(--font-heading);
  font-weight: 700;
  height: 2.3rem;
  margin-bottom: 0.85rem;
  place-items: center;
  width: 2.3rem;
}

.quality-panel h3 {
  font-size: 1.1rem;
}

.quality-panel p {
  color: #34426c;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0;
}

.playgrounds {
  min-height: 430px;
  padding-top: 4rem;
}

.section-heading.compact {
  grid-template-columns: minmax(0, 0.78fr) minmax(320px, 0.7fr);
}

.skill-cloud {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.skill-cloud span {
  box-shadow: 0 10px 20px rgba(42, 59, 113, 0.08);
  font-size: 1.05rem;
  padding: 0.75rem 1.1rem;
  transition:
    transform 180ms ease,
    rotate 180ms ease;
}

.skill-cloud span:hover {
  rotate: -2deg;
  transform: translateY(-4px) scale(1.03);
}

.skill-cloud span:nth-child(1),
.skill-cloud span:nth-child(5) {
  background: var(--sophia-green);
}

.skill-cloud span:nth-child(2) {
  background: var(--sophia-blue);
}

.skill-cloud span:nth-child(3) {
  background: var(--sophia-yellow);
}

.skill-cloud span:nth-child(4) {
  background: var(--sophia-pink);
}

.tools-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  max-width: min(100%, 980px);
  position: relative;
  z-index: 1;
}

.tool-item {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(42, 59, 113, 0.08);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 20px rgba(42, 59, 113, 0.06);
  color: var(--sophia-navy);
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  min-height: 112px;
  padding: 0.9rem 0.65rem;
}

.tool-item svg {
  fill: rgba(255, 255, 255, 0.45);
  height: 42px;
  stroke: var(--sophia-navy);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  width: 42px;
}

.tool-item:nth-child(1) svg {
  stroke: #8e61d4;
}

.tool-item:nth-child(2) svg {
  stroke: var(--sophia-coral);
}

.tool-item:nth-child(3) svg {
  stroke: var(--sophia-blue);
}

.tool-item:nth-child(4) svg {
  stroke: #78b64b;
}

.tool-item:nth-child(5) svg {
  stroke: var(--sophia-pink);
}

.tool-item:nth-child(6) svg {
  stroke: var(--sophia-yellow);
}

.tool-item span {
  font-family: var(--font-heading);
  font-weight: 700;
}

.contact {
  padding-bottom: 1rem;
}

.contact-panel {
  align-items: center;
  background:
    radial-gradient(circle at 95% 20%, rgba(254, 210, 114, 0.95), transparent 14rem),
    var(--sophia-blue);
  border-radius: var(--radius-xl);
  display: grid;
  gap: 1.4rem 2rem;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: auto auto;
  min-height: 430px;
  overflow: hidden;
  padding: clamp(1.8rem, 5vw, 3.5rem);
  position: relative;
}

.contact-panel > div:first-child {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 3;
}

.contact-panel h2 {
  font-size: clamp(3rem, 5vw, 4.7rem);
  line-height: 0.95;
  margin-bottom: 0.8rem;
  max-width: 760px;
}

.contact-panel p:not(.eyebrow) {
  color: #273968;
  font-size: 1.1rem;
  font-weight: 800;
  max-width: 620px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  grid-column: 1;
  grid-row: 2;
  justify-content: flex-start;
  position: relative;
  z-index: 3;
}

.contact-illu {
  animation: soft-bob 5.8s ease-in-out infinite;
  bottom: -4.2rem;
  max-width: 315px;
  opacity: 0.98;
  position: absolute;
  right: 2rem;
  z-index: 2;
}

.contact-star {
  animation: twinkle 4.4s ease-in-out infinite;
  position: absolute;
  right: 17rem;
  top: 2.3rem;
  width: 4.8rem;
  z-index: 1;
}

.contact-flower {
  animation: wiggle 6.8s ease-in-out infinite;
  bottom: 2.2rem;
  left: auto;
  position: absolute;
  right: 4rem;
  width: 3.7rem;
  z-index: 3;
}

.site-footer {
  color: #3c4870;
  font-weight: 800;
  padding: 1.1rem 1rem 2rem;
  text-align: center;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  transition:
    opacity 620ms ease,
    transform 620ms cubic-bezier(0.2, 0.9, 0.25, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.project-card[data-reveal],
.tool-item[data-reveal],
.quality-panel article[data-reveal] {
  transform: translateY(26px) rotate(-0.7deg) scale(0.985);
}

.project-card[data-reveal].is-visible,
.tool-item[data-reveal].is-visible,
.quality-panel article[data-reveal].is-visible {
  transform: translateY(0) rotate(0deg) scale(1);
}

.skill-cloud span[data-reveal] {
  transform: translateY(18px) scale(0.92);
}

.skill-cloud span[data-reveal].is-visible {
  transform: translateY(0) scale(1);
}

.project-card[data-reveal].is-visible:hover {
  transform: translateY(-5px) rotate(0deg) scale(1);
}

.skill-cloud span[data-reveal].is-visible:hover {
  rotate: -2deg;
  transform: translateY(-4px) scale(1.03);
}

@keyframes soft-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes float-left {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(18px, -10px) rotate(4deg);
  }
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(-4deg) scale(1);
  }
  50% {
    transform: rotate(5deg) scale(1.04);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.72;
    transform: rotate(0deg) scale(1);
  }
  50% {
    opacity: 1;
    transform: rotate(12deg) scale(1.12);
  }
}

@keyframes about-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes bloom-petal {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--petal-angle)) translateY(0) scale(0.25);
  }
  52% {
    opacity: 0.95;
  }
  100% {
    opacity: 0.86;
    transform: translate(-50%, -50%) rotate(calc(var(--petal-angle) + 12deg)) translateY(-45%) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .project-modal {
    transition-delay: 0ms;
  }

  .flower-bloom {
    display: none;
  }
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-visual {
    min-height: 440px;
  }

  .hero-spark {
    left: auto;
    right: 2rem;
    top: 31rem;
  }

  .portrait-card {
    margin: 0 auto;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-feature,
  .project-wide,
  .project-full,
  .project-card:not(.project-feature):not(.project-wide) {
    grid-column: span 1;
    grid-row: span 1;
  }

  .about {
    grid-template-columns: 0.45fr 0.55fr;
    min-height: 0;
  }

  .quality-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 760px) {
  .site-header {
    gap: 0.75rem;
    grid-template-columns: 1fr auto;
    padding-top: 0.75rem;
  }

  .wordmark {
    font-size: 2.1rem;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
    justify-self: stretch;
    padding: 0.6rem;
  }

  .site-nav.is-open {
    display: grid;
    gap: 0.25rem;
  }

  .site-nav a {
    text-align: center;
  }

  .hero {
    padding-top: 1.4rem;
  }

  h1 {
    font-size: clamp(2.7rem, 13vw, 4.1rem);
  }

  .hero-actions,
  .contact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-visual {
    min-height: 360px;
  }

  .decor-cloud {
    left: -0.5rem;
    width: 7.4rem;
  }

  .decor-flower {
    right: 0;
    width: 5.5rem;
  }

  .decor-leaf {
    width: 6rem;
  }

  .section-heading,
  .section-heading.compact {
    grid-template-columns: 1fr;
  }

  .projects .section-heading {
    grid-template-columns: 1fr;
  }

  .projects-pointer {
    justify-self: center;
    max-width: 220px;
    width: 58vw;
  }

  .project-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .project-visual {
    min-height: 250px;
  }

  .project-feature .project-visual {
    min-height: 250px;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .about-visual {
    margin: 0 auto;
    max-width: 380px;
  }

  .about-visual img {
    margin-left: 0;
    width: 100%;
  }

  .quality-panel {
    border-radius: var(--radius-xl);
    grid-template-columns: 1fr;
  }

  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-panel {
    grid-template-columns: 1fr;
    padding-bottom: 11rem;
  }

  .contact-illu {
    max-width: 245px;
  }

  .contact-star {
    right: 1.2rem;
    top: auto;
    bottom: 9rem;
    width: 4.4rem;
  }

  .hero-spark {
    left: auto;
    right: 1.1rem;
    top: 40rem;
    width: 3.1rem;
  }

  .project-modal-shell {
    padding: 0.85rem;
  }

  .flower-bloom {
    height: 88vw;
    width: 88vw;
  }

  .project-modal {
    border-radius: var(--radius-lg);
    max-height: calc(100vh - 1.5rem);
  }

  .modal-hero {
    grid-template-columns: 1fr;
  }

  .modal-visual,
  .modal-visual-card {
    min-height: 245px;
  }

  .modal-gallery {
    grid-template-columns: 1fr;
  }

  .image-lightbox {
    padding: 0.75rem;
  }

  .image-lightbox-panel {
    max-width: calc(100vw - 1.5rem);
  }

  .image-lightbox-panel img {
    max-height: calc(100vh - 6.5rem);
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

}

@media (max-width: 420px) {
  .section-shell {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .project-meta {
    grid-template-columns: 1fr;
  }

  .tag-row {
    padding-left: 0.35rem;
  }
}
