/* ============================================================
   Miguel Silva — Scientific Illustration
   Design system: "Warm Scientific Editorial"
   Signature element: the phospholipid-bilayer liposome
   ============================================================ */

/* ---- Design tokens ---------------------------------------- */
:root {
  /* Color — white paper, navy ink, vibrant orange CTA, vibrant blue accent */
  --paper:        #FFFFFF;   /* white background                 */
  --paper-raised: #F5F8FE;   /* cards / raised surfaces (cool)   */
  --ink:          #0E1A2B;   /* primary text (deep navy)         */
  --ink-muted:    #50607A;   /* secondary text (slate)           */
  --line:         #E3E9F3;   /* hairline borders / dividers      */
  --line-strong:  #C6D2E4;

  --cta:          #FFCE1F;   /* vibrant yellow — CTAs ONLY       */
  --cta-hover:    #F4BC00;
  --on-cta:       #1A1206;   /* near-black: AA contrast on yellow */

  --accent:       #1A5BFF;   /* vibrant blue — eyebrows, links   */
  --accent-soft:  rgba(26, 91, 255, 0.09);

  --star:         #F2B705;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Poppins", system-ui, -apple-system, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  /* Type scale (fluid) */
  --fs-eyebrow: 0.78rem;
  --fs-small:   0.875rem;
  --fs-body:    1.0625rem;
  --fs-lead:    clamp(1.15rem, 1rem + 0.7vw, 1.4rem);
  --fs-h3:      clamp(1.25rem, 1.05rem + 0.9vw, 1.6rem);
  --fs-h2:      clamp(1.9rem, 1.3rem + 2.6vw, 3rem);
  --fs-h1:      clamp(2.7rem, 1.6rem + 4.8vw, 5rem);

  /* Spacing rhythm (8pt) */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
  --space-7: 6rem;
  --section-y: clamp(3.5rem, 2rem + 7vw, 7rem);

  --container: 1180px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(27, 26, 23, 0.04), 0 2px 8px rgba(27, 26, 23, 0.05);
  --shadow-md: 0 8px 30px rgba(27, 26, 23, 0.09);
  --shadow-cta: 0 8px 20px rgba(244, 188, 0, 0.40);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 280ms;

  --z-header: 100;
  --z-totop: 80;
}

/* ---- Reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Layout helpers --------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}
.section { padding-block: var(--section-y); }
.section--tint { background: linear-gradient(180deg, var(--paper) 0%, #EDF3FC 100%); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---- Typography primitives -------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1.04;
  letter-spacing: -0.01em;
  font-optical-sizing: auto;
  margin-top: var(--space-2);
  max-width: 18ch;
}
.lead {
  font-size: var(--fs-lead);
  color: var(--ink-muted);
  font-weight: 300;
  max-width: 56ch;
}

/* ---- Buttons ---------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-small);
  letter-spacing: 0.01em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1.5px solid transparent;
  transition: transform var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; }
.btn--cta {
  --btn-bg: var(--cta);
  --btn-fg: var(--on-cta);
  box-shadow: var(--shadow-cta);
  font-weight: 600;
}
.btn--cta:hover { background: var(--cta-hover); transform: translateY(-2px); }
.btn--cta:active { transform: translateY(0); }
.btn--ghost { border-color: var(--line-strong); --btn-fg: var(--ink); }
.btn--ghost:hover { background: var(--ink); --btn-fg: var(--paper); transform: translateY(-2px); }
.btn--ink { --btn-bg: var(--ink); --btn-fg: var(--paper); }
.btn--ink:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--lg { min-height: 56px; padding: 1rem 2rem; font-size: var(--fs-body); }

/* Attention animation for the "Start a project" CTA */
.cta-animated { animation: cta-ring 2.8s ease-out infinite; }
.cta-animated svg { transition: transform var(--dur) var(--ease); }
.cta-animated:hover { animation-play-state: paused; }
.cta-animated:hover svg { transform: translateX(4px); }
@keyframes cta-ring {
  0%   { box-shadow: 0 0 0 0 rgba(26, 91, 255, 0.45); }
  60%  { box-shadow: 0 0 0 14px rgba(26, 91, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 91, 255, 0); }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(27,26,23,0.02), 0 8px 24px -16px rgba(27,26,23,0.4);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 74px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.brand__mark { width: 30px; height: 52px; flex: none; object-fit: contain; }
.brand__mark .lipid-head { fill: var(--cta); }
.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  line-height: 1;
  margin-top: 2px;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
}
.nav__link {
  position: relative;
  padding: 0.5rem 0.9rem;
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--ink);
  border-radius: var(--radius-pill);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0.9rem; right: 0.9rem; bottom: 0.34rem;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }
/* Active link stays ink — the blue underline alone marks the location */

/* Header CTA: a touch more compact than the page CTAs, mostly vertically */
.nav__cta {
  min-height: 40px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-inline: 1.3rem;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px; height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper-raised);
}
.nav__toggle span {
  width: 20px; height: 2px; background: var(--ink);
  margin-inline: auto;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-block: clamp(3rem, 2rem + 6vw, 6rem) clamp(1.5rem, 1rem + 2vw, 2.75rem); }
/* Tighten the gap on the process side of the dotted divider too */
#process { padding-top: clamp(1.5rem, 1rem + 2vw, 2.75rem); padding-bottom: clamp(2.75rem, 1.8rem + 4vw, 5.25rem); }
/* …and a slightly shorter gap into pricing */
#pricing { padding-top: clamp(2.75rem, 1.8rem + 4vw, 5.25rem); }
/* Tighten the gap between Kind words and About me */
#reviews { padding-bottom: clamp(2.5rem, 1.7rem + 3vw, 4.5rem); }
#about { padding-top: clamp(2.5rem, 1.7rem + 3vw, 4.5rem); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h1);
  line-height: 0.98;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
}
.hero__title em {
  font-style: italic;
  font-variation-settings: "SOFT" 60, "WONK" 1;
}
.hero__lead {
  margin-top: var(--space-3);
  font-size: var(--fs-lead);
  color: var(--ink-muted);
  font-weight: 300;
  max-width: 40ch;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: var(--space-3);
  padding: 0;
  list-style: none;
  max-width: 34rem;   /* keeps the cluster centered under the lead text */
}
/* Forces "Presentations / Others" onto a centered second line */
.tag-break { flex-basis: 100%; height: 0; margin: 0; padding: 0; border: 0; }
.tag {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.5rem 1.05rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: #2E3C52;   /* ink, lightened a touch */
  background: var(--paper-raised);
  box-shadow: var(--shadow-sm);
}

/* Yellow highlight tying the hero phrase to the options below */
.hl {
  background-image: linear-gradient(transparent 80%, rgba(255, 206, 31, 0.7) 80%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 0.05em;
  color: var(--ink);
  font-weight: 400;
}
.hero__prompt {
  margin-top: var(--space-4);
  font-size: var(--fs-body);
  font-weight: 400;
}
.hero__cta { margin-top: var(--space-3); display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* Liposome signature */
.hero__art {
  position: relative;
  display: grid;
  place-items: center;
}
.liposome {
  width: min(440px, 88%);
  aspect-ratio: 1;
  filter: drop-shadow(0 24px 50px rgba(26, 91, 255, 0.14));
}
.liposome__rotor { transform-origin: 50% 50%; animation: lipo-rotate 90s linear infinite; }
/* Miguel's hero liposome image: slow, gentle full rotation */
.liposome--img { animation: lipo-rotate 90s linear infinite; will-change: transform; }
.liposome__core { transform-origin: 50% 50%; animation: lipo-breathe 7s var(--ease) infinite; }
@keyframes lipo-rotate { to { transform: rotate(360deg); } }
@keyframes lipo-breathe {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.015); opacity: 1; }
}
.lipid-head { fill: var(--cta); }
.lipid-head--inner { fill: #FFE08A; }
.lipid-tail { stroke: var(--accent); stroke-width: 1.4; opacity: 0.45; stroke-linecap: round; }
.liposome__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  fill: var(--ink-muted);
  text-transform: uppercase;
}

/* ============================================================
   SECTION HEADER (shared)
   ============================================================ */
.section-head { margin-bottom: var(--space-5); max-width: 60ch; }
.section-head--split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  max-width: none;
  flex-wrap: wrap;
}

/* Bilayer divider (quiet recurrence of the signature) */
.bilayer-divider {
  height: 14px;
  width: 100%;
  background-image:
    radial-gradient(circle at center, var(--line-strong) 2px, transparent 2.6px);
  background-size: 16px 14px;
  background-position: top center;
  opacity: 0.6;
  margin-block: var(--space-2);
}

/* ============================================================
   PROCESS
   ============================================================ */
.process__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0;
}
.step {
  position: relative;
  padding: var(--space-3);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.step__num {
  display: block;
  text-align: left;   /* keep the number on the left; rest of the card stays centered */
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.step__icon {
  width: 48px; height: 48px;
  margin: var(--space-2) 0;
  color: var(--ink);
  stroke: currentColor;
}
/* Miguel's process illustrations (landscape) */
.step__illus {
  display: block;
  width: 100%;
  max-width: 190px;
  height: auto;
  margin: var(--space-1) auto var(--space-2);
}
.step__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h3);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}
.step__text { font-size: var(--fs-small); color: #44526B; }
.step__text b { font-weight: 400; color: var(--ink); }

/* ============================================================
   PRICING
   ============================================================ */
.pricing__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.price-scale { list-style: none; padding: 0; margin: 0; }
.price-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}
.price-row:first-child { border-top: 1px solid var(--line); }
.price-row__label {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 500;
}
.price-row__hint { font-size: var(--fs-small); color: var(--ink-muted); display: block; font-family: var(--font-body); }
.price-row__value {
  font-family: var(--font-body);   /* Poppins — plain zero, no dot */
  font-size: 1.5rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.price-row--other .price-row__value { color: var(--ink-muted); }
.price-note {
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 1.2rem;   /* large, but a touch under the price rows above */
  line-height: 1.4;
  color: var(--ink-muted);
}
.price-note .btn { min-height: 54px; padding: 0.95rem 1.9rem; font-size: var(--fs-body); }
.included {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.included__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-h3);
  margin-bottom: var(--space-3);
}
.included__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.included__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: var(--fs-small);
  color: #EDE7D8;
}
.included__list svg { width: 20px; height: 20px; flex: none; color: var(--cta); margin-top: 2px; }
.included__list b { color: #fff; font-weight: 500; }

/* ============================================================
   REVIEWS (carousel)
   ============================================================ */
.reviews__viewport { overflow: hidden; }
.reviews__track {
  display: flex;
  gap: var(--space-3);
  transition: transform 450ms var(--ease);
  will-change: transform;
}
.review-card {
  flex: 0 0 100%;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  display: grid;
  gap: var(--space-2);
  align-content: start;   /* pack content to the top so cards align row-by-row */
}
@media (min-width: 760px) {
  .review-card { flex-basis: calc(50% - (var(--space-3) / 2)); }
}
.review-card__head {
  display: grid;
  gap: 0.15rem;
}
.review-card__name { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); }
.review-card__role { font-size: var(--fs-small); color: var(--ink-muted); }
.stars { display: inline-flex; gap: 2px; color: var(--star); }
.stars svg { width: 18px; height: 18px; }
.review-card__quote { font-size: var(--fs-body); font-weight: 300; }
.review-card__quote::before,
.review-card__quote::after {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 3rem;
  line-height: 0;
  color: rgba(26, 91, 255, 0.32);   /* soft blue */
}
.review-card__quote::before { content: "\201C"; margin-right: 0.16em; vertical-align: -0.5em; }
.review-card__quote::after  { content: "\201D"; margin-left: 0.14em; vertical-align: -0.62em; }
.review-card--add {
  display: grid;
  place-content: center;
  text-align: center;
  border-style: dashed;
  color: var(--ink-muted);
  background: transparent;
}
.reviews__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.carousel-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--paper-raised);
  display: grid;
  place-items: center;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.carousel-btn:hover { background: var(--ink); color: var(--paper); }
.carousel-btn svg { width: 20px; height: 20px; }
.carousel-dots { display: flex; gap: 0.5rem; margin-left: auto; }
.carousel-dots button {
  width: 9px; height: 9px; padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--line-strong);
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.carousel-dots button.is-active { background: var(--accent); transform: scale(1.25); }
.reviews__more { margin-top: var(--space-3); font-size: var(--fs-small); color: var(--ink-muted); }
.reviews__more a { color: var(--accent); border-bottom: 1px solid currentColor; }

/* ============================================================
   ABOUT
   ============================================================ */
.about__grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about__portrait {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, #E6EEFC, #FCEFC9);
  border: 1px solid var(--line);
}
.about__portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait-fallback {
  position: absolute; inset: 0;
  display: grid; place-content: center; gap: 0.5rem; text-align: center;
  color: var(--ink-muted); font-family: var(--font-mono); font-size: var(--fs-small);
  padding: var(--space-3);
}
.portrait-fallback svg { width: 54px; height: 54px; margin-inline: auto; opacity: 0.5; }
.about__body { font-size: var(--fs-body); font-weight: 300; display: grid; gap: var(--space-2); }
.about__body .section-title { margin-bottom: var(--space-1); }
.about__hi { font-family: var(--font-display); font-style: italic; font-size: var(--fs-lead); }

/* ============================================================
   PORTFOLIO
   ============================================================ */
/* Horizontal scroll-snap carousel */
.portfolio__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-2);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.portfolio__viewport::-webkit-scrollbar { height: 8px; }
.portfolio__viewport::-webkit-scrollbar-track { background: var(--line); border-radius: 99px; }
.portfolio__viewport::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.portfolio__viewport::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }
.portfolio__track {
  display: flex;
  gap: var(--space-3);
  padding: 4px 4px var(--space-1);  /* room for card shadow/focus ring */
}
.work {
  flex: 0 0 clamp(260px, 80vw, 340px);
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.work:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.work__thumb {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: #FFFFFF;
  position: relative;
  overflow: hidden;
}
.work__thumb svg { width: 62%; height: 62%; }
/* Real work media: absolute + object-fit centers reliably inside the aspect-ratio frame */
.work__thumb .work__thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4%;
}
.work__meta { padding: var(--space-3); display: grid; gap: 0.5rem; }
.work__title { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); line-height: 1.1; }
.work__desc { font-size: var(--fs-small); color: #44526B; font-weight: 300; }
.work__tag {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.15rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding-block: var(--section-y) var(--space-4);
  margin-top: clamp(2rem, 1.5rem + 3vw, 4rem);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-5);
  align-items: center;
}
.footer__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: 1.05;
  max-width: 16ch;
}
.footer__contacts { display: grid; gap: 0.8rem; margin-top: var(--space-3); }
.footer__contact {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #E7E1D2;
  font-size: var(--fs-small);
  width: fit-content;
}
.footer__contact svg { width: 20px; height: 20px; color: var(--cta); flex: none; }
.footer__contact a { border-bottom: 1px solid transparent; transition: border-color var(--dur) var(--ease); }
.footer__contact a:hover { border-bottom-color: var(--cta); }
.footer__note { font-size: var(--fs-small); color: #B9B3A4; max-width: 50ch; margin-top: var(--space-4); }
.footer__rule { height: 1px; background: rgba(255,255,255,0.12); margin-block: var(--space-4); }
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.footer__tagline { font-family: var(--font-display); font-style: italic; font-size: var(--fs-lead); }
.footer__legal { font-family: var(--font-mono); font-size: var(--fs-eyebrow); color: #8E897C; letter-spacing: 0.04em; }

/* ============================================================
   PORTFOLIO LIGHTBOX
   ============================================================ */
.work--zoom { cursor: pointer; }
.work--zoom:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
/* Subtle "click to enlarge" hint, bottom-right of the image area */
.work--zoom .work__thumb::after {
  content: "";
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background-color: rgba(255, 255, 255, 0.85);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2344526B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M16 21h3a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 15px;
  box-shadow: var(--shadow-sm);
  opacity: 0.55;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.work--zoom:hover .work__thumb::after,
.work--zoom:focus-visible .work__thumb::after { opacity: 1; transform: scale(1.06); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}
.lightbox[hidden] { display: none; }
.lightbox__scrim {
  position: absolute;
  inset: 0;
  background: rgba(14, 26, 43, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.lightbox.is-open .lightbox__scrim { opacity: 1; }
.lightbox__panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: min(1000px, 94vw);
  max-height: 92vh;
  overflow: auto;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: 0 24px 60px rgba(14, 26, 43, 0.35);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.lightbox.is-open .lightbox__panel { opacity: 1; transform: none; }
.lightbox__media { display: grid; place-items: center; }
.lightbox__media > img,
.lightbox__media > svg {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 70vh;
}
.lightbox__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--paper-raised);
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.lightbox__close:hover { background: var(--ink); color: var(--paper); transform: rotate(90deg); }
.lightbox__close svg { width: 20px; height: 20px; }
.lightbox__caption { margin-top: var(--space-3); max-width: 60ch; }
.lightbox__title { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); }
.lightbox__desc { margin-top: 0.35rem; font-size: var(--fs-small); color: var(--ink-muted); font-weight: 300; }
@media (prefers-reduced-motion: reduce) {
  .lightbox__scrim, .lightbox__panel { transition: none; }
}

/* ============================================================
   SCROLL-TO-TOP (vesicle)
   ============================================================ */
.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--paper-raised);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  z-index: var(--z-totop);
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.to-top.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.to-top:hover { background: var(--cta); transform: translateY(-3px); }
.to-top svg { width: 22px; height: 22px; }

/* ============================================================
   FORM PAGE
   ============================================================ */
.form-page { padding-block: clamp(2.5rem, 2rem + 5vw, 5rem); }
.form-intro { max-width: 60ch; margin-bottom: var(--space-5); }
.form-intro .hero__title { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem); }
.idea-form { max-width: 760px; display: grid; gap: var(--space-4); }
.field { display: grid; gap: 0.55rem; }
.field__label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-body);
}
.field__hint { font-size: var(--fs-small); color: var(--ink-muted); font-weight: 300; }
.field__req { color: var(--accent); }
.input, .select, .textarea {
  width: 100%;
  font: inherit;
  font-weight: 300;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  min-height: 52px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: #9C968A; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2356524A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
  padding-right: 2.8rem;
}

/* File dropzone */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone__icon { width: 34px; height: 34px; margin: 0 auto 0.6rem; color: var(--accent); }
.dropzone__main { font-weight: 500; }
.dropzone__formats { font-family: var(--font-mono); font-size: var(--fs-eyebrow); color: var(--ink-muted); letter-spacing: 0.06em; margin-top: 0.4rem; }
.dropzone__files { margin-top: var(--space-2); font-size: var(--fs-small); color: var(--accent); font-weight: 500; min-height: 1.2em; }

.field__error {
  font-size: var(--fs-small);
  color: #B5341B;
  font-weight: 400;
  display: none;
}
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea { border-color: #C53B1E; }
.field.has-error .field__error { display: block; }

.form-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.form-feedback { font-size: var(--fs-small); }
.form-feedback[data-state="success"] { color: var(--accent); font-weight: 500; }
.form-feedback[data-state="error"] { color: #B5341B; font-weight: 500; }

.form-aside {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--cta);
  background: var(--paper-raised);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--fs-small);
  color: var(--ink-muted);
}
.form-aside b { color: var(--ink); }
.form-aside a { color: var(--accent); border-bottom: 1px solid currentColor; }

.btn[aria-busy="true"] { pointer-events: none; opacity: 0.75; }
.btn .spinner { display: none; width: 18px; height: 18px; animation: spin 0.7s linear infinite; }
.btn[aria-busy="true"] .spinner { display: inline-block; }
.btn[aria-busy="true"] .btn__label { opacity: 0.6; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .process__grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: var(--space-2);
    background: var(--paper-raised);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  }
  .nav.is-open .nav__links { opacity: 1; transform: none; pointer-events: auto; }
  .nav__link { padding: 0.85rem 1rem; }
  .nav__link::after { display: none; }
  .nav__cta { margin-top: 0.25rem; min-height: 46px; padding-top: 0.7rem; padding-bottom: 0.7rem; }

  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .liposome { width: min(320px, 70%); }
  .pricing__grid { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { max-width: 320px; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .process__grid { grid-template-columns: 1fr; }
  .portfolio__grid { grid-template-columns: 1fr; }
  .section-head--split { align-items: flex-start; }
}
