/* =========================================================================
   Raphaelle Vasseux - portfolio
   Native CSS. Light theme, locked. One accent. One radius scale.
   ========================================================================= */

:root {
  --bg:          #fffcff;   /* pale lime, the page ground */
  --bg-2:        #f3f2fc;   /* the deeper lime, for tints behind images */
  --surface:     #f9f5ff;
  --card:        #ffffff;   /* cream, for the project cards */
  --ink:         #191922;
  --ink-2:       #52526a;
  --ink-3:       #6b6b85;
  --line:        #d1d0e0;
  --line-soft:   #e0dbeb;
  --accent:      #2c1186;   /* deep raspberry */
  --accent-ink:  #ffffff;
  --accent-soft: #f7f0ff;
  --accent-line: #cfcce8;

  --shadow-sm: 0 1px 2px rgba(25, 25, 34, .04), 0 8px 22px -12px rgba(25, 25, 34, .18);
  --shadow-lg: 0 2px 5px rgba(25, 25, 34, .05), 0 26px 50px -26px rgba(110, 20, 60, .28);

  --r:      16px;
  --r-sm:   10px;
  --r-pill: 999px;

  --pad:     clamp(18px, 4.5vw, 52px);
  --section: clamp(54px, 6.5vw, 92px);
  --ease:    cubic-bezier(.16, 1, .3, 1);
  /* the ring travels for over a second, so it needs to ease in as well as
     out; --ease starts at full speed, which reads as a snap at that length */
  --ease-ring: cubic-bezier(.45, 0, .25, 1);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 18px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- layout ---------- */
.wrap   { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--pad); }
.narrow { width: 100%; max-width: 700px; }
section { padding-block: var(--section); }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.03em; line-height: 1.06; text-wrap: balance; }
.d1 { font-size: clamp(2.4rem, 5.6vw, 4rem);    letter-spacing: -.042em; }
.d2 { font-size: clamp(1.65rem, 3.2vw, 2.4rem); letter-spacing: -.034em; }
.d3 { font-size: clamp(1.1rem, 1.6vw, 1.3rem);  letter-spacing: -.024em; line-height: 1.2; }

p { margin: 0; }
.lead  { font-size: clamp(1.02rem, 1.35vw, 1.16rem); line-height: 1.5; color: var(--ink-2); max-width: 50ch; }
.body  { font-size: 1rem; line-height: 1.62; color: var(--ink-2); max-width: 62ch; }
.body + .body { margin-top: .9em; }
.body strong { color: var(--ink); font-weight: 600; }
.small { font-size: .86rem; line-height: 1.55; color: var(--ink-3); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 22px; border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-size: .93rem; font-weight: 500;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .22s var(--ease), border-color .22s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #6b0d36; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.btn--sm { padding: 8px 17px; font-size: .86rem; }
.btn .arw { transition: transform .28s var(--ease); }
.btn:hover .arw { transform: translateX(3px); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: 62px;
  display: flex; align-items: center;
  background: rgba(249, 240, 250, 0.86);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav[data-stuck="true"] { border-bottom-color: var(--line-soft); }
@supports not (backdrop-filter: blur(4px)) { .nav { background: var(--bg); } }
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.nav__in { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; font-weight: 600; letter-spacing: -.02em; font-size: .98rem; white-space: nowrap;
}
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a:not(.btn) {
  text-decoration: none; color: var(--ink-2); font-size: .9rem;
  padding: 7px 11px; border-radius: var(--r-pill);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav__links a:not(.btn):hover { color: var(--accent); background: var(--bg-2); }
@media (max-width: 560px) { .nav__links .hide-sm { display: none; } }

/* reading progress on the case studies */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress { animation: grow linear both; animation-timeline: scroll(root); }
  }
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- home hero ---------- */
.hero { padding-block: clamp(48px, 8vw, 96px) clamp(40px, 5vw, 64px); }
.hero__name { margin-bottom: 18px; }
.hero__lead { margin-bottom: 26px; }

/* ---------- section heads ---------- */
.head { margin-bottom: clamp(26px, 3.5vw, 42px); }
.head .d2 { max-width: 22ch; }
.head .body { margin-top: 14px; }

/* ---------- work section sits on white to separate it from the hero ---------- */
.section--white { background: var(--surface); border-block: 1px solid var(--line-soft); }

/* ---------- project grid ---------- */
.grid { display: grid; gap: clamp(18px, 2.4vw, 28px); grid-template-columns: 1fr; }
/* three projects, three cells, no empty cell at any width */
@media (min-width: 860px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  display: flex; flex-direction: column;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: box-shadow .4s var(--ease), border-color .4s var(--ease), transform .4s var(--ease);
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--accent-line); transform: translateY(-3px); }
.card__media { aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: clamp(20px, 2.2vw, 26px); display: flex; flex-direction: column; flex: 1; }
.card__title { margin-bottom: 9px; transition: color .25s var(--ease); }
.card:hover .card__title { color: var(--accent); }
.card__go {
  margin-top: auto; padding-top: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .92rem; font-weight: 500; color: var(--accent);
}
.card__go .arw { transition: transform .3s var(--ease); }
.card:hover .card__go .arw { transform: translateX(5px); }

/* ---------- project hero: title sits on the image, bottom left ---------- */
.phero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(78svh, 610px);
  display: flex; align-items: flex-end;
  padding-block: clamp(72px, 10vw, 112px) clamp(34px, 5vw, 58px);
  background: var(--bg-2);
}
.phero__media { position: absolute; inset: 0; z-index: -1; }
.phero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
}
/* No gradient over the photo. The type sits in a light panel instead, so the
   image stays at full brightness everywhere outside that one block, and the
   text keeps normal dark-on-light contrast. */
.phero__body {
  position: relative;
  max-width: 540px;
  padding: clamp(22px, 2.8vw, 32px);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 20px 50px -26px rgba(60, 15, 35, .45);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
}
@supports not (backdrop-filter: blur(4px)) { .phero__body { background: #fff; } }
@media (prefers-reduced-transparency: reduce) {
  .phero__body { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.phero__title { margin-bottom: 12px; }
.phero__lead  { margin-bottom: 14px; max-width: 40ch; }
.phero__meta  { font-size: .92rem; color: var(--ink-2); max-width: 48ch; }
.phero__docs  { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(18px, 2.4vw, 24px); }

/* Panel on the right, for a hero whose subject sits on the left of the frame.
   Narrower than the default: the type has to clear the object rather than lie
   over open photograph, and it drops to full width sooner for the same reason. */
.phero--right .phero__body { margin-left: auto; max-width: min(420px, 40vw); }
@media (max-width: 860px) {
  .phero--right .phero__body { max-width: none; margin-left: 0; }
}

@media (max-width: 700px) {
  .phero { min-height: min(76svh, 500px); }
  .phero__body { max-width: none; }
}

/* ---------- figures ---------- */
.fig { margin: 0; }
.fig img { width: 100%; height: auto; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); }
.fig figcaption { margin-top: 11px; font-size: .85rem; line-height: 1.5; color: var(--ink-3); max-width: 56ch; }
.fig--plain img { box-shadow: none; border: 1px solid var(--line-soft); }

/* Arrow-led notes: each line points at the feature it explains, the way the
   annotations do on the slides they are taken from. */
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 15px; }
.notes li {
  position: relative; padding-left: 30px;
  font-size: 1rem; line-height: 1.62; color: var(--ink-2); max-width: 62ch;
}
.notes li::before {
  content: "\2192";
  position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 500;
}
@media (prefers-reduced-motion: no-preference) {
  .notes li::before { transition: transform .3s var(--ease); }
  .notes li:hover::before { transform: translateX(4px); }
}
.notes strong { color: var(--ink); font-weight: 600; }

/* three photographs across, one under the other on a phone */
.trio { display: grid; gap: clamp(16px, 2vw, 24px); grid-template-columns: 1fr; }
@media (min-width: 760px) { .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.split { display: grid; gap: clamp(24px, 3.5vw, 48px); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--flip > :first-child { order: 2; }
}

/* ---------- numbers ---------- */
.figures {
  display: grid; gap: clamp(20px, 3vw, 36px);
  grid-template-columns: 1fr;
  margin-top: clamp(28px, 3.5vw, 44px);
  padding-top: clamp(22px, 3vw, 32px);
  border-top: 1px solid var(--line);
}
@media (min-width: 700px) { .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.figure__n {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: -.05em; line-height: 1;
  color: var(--accent); margin-bottom: 9px;
}
.figure__t { font-size: .92rem; line-height: 1.5; color: var(--ink-2); max-width: 32ch; }

/* ---------- quotes ---------- */
.quote { margin: clamp(22px, 3vw, 34px) 0; padding-left: clamp(18px, 2.4vw, 26px); border-left: 2px solid var(--accent-line); }
.quote p {
  font-weight: 500;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem); line-height: 1.28; letter-spacing: -.025em;
  color: var(--ink); max-width: 28ch;
}
.quote cite { display: block; margin-top: 10px; font-style: normal; font-size: .84rem; color: var(--ink-3); }

/* ---------- the question: full width ---------- */
.band { background: var(--accent-soft); border-block: 1px solid var(--accent-line); }
.band__k { font-size: .92rem; color: var(--accent); margin-bottom: 16px; }
.band__q {
  font-weight: 600;
  font-size: clamp(1.5rem, 4.4vw, 3.2rem); line-height: 1.1; letter-spacing: -.036em;
  max-width: none; text-wrap: balance;
}

/* =========================================================================
   Needs ring: cards sit on a circle seen edge-on. One faces you, the rest
   recede to the sides. Rotating the ring brings the next one to the front.
   ========================================================================= */
.ring { position: relative; }
.ring__stage {
  position: relative;
  height: clamp(286px, 30vw, 324px);
  perspective: 1600px;
  perspective-origin: 50% 45%;
}
.ring__track {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform 1.5s var(--ease-ring);
}
.ring__card {
  position: absolute; top: 0; left: 50%;
  width: clamp(280px, 36vw, 452px);
  margin-left: calc(clamp(280px, 36vw, 452px) / -2);
  height: 100%;
  /* Block, not flex. A flex container turns every run of text and every
     inline tag inside it into a separate stacked item, which broke the
     paragraph into one line per keyword the moment <strong> appeared. */
  display: block;
  padding: clamp(20px, 2.2vw, 28px) clamp(22px, 2.4vw, 30px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  font-size: .95rem; line-height: 1.55; color: var(--ink-2);
  transition: opacity 1.5s var(--ease-ring), box-shadow 1.5s var(--ease-ring), border-color 1.5s var(--ease-ring);
  backface-visibility: hidden;
}
.ring__card b {
  display: block; margin-bottom: 9px;
  color: var(--accent); font-weight: 600; font-size: 1.04rem; letter-spacing: -.018em; line-height: 1.2;
}
/* keywords inside a card, matching what .body strong does in the paragraphs.
   Kept off the accent so it cannot be mistaken for the card heading above. */
.ring__card strong { color: var(--ink); font-weight: 600; }
/* depth cueing: the front card is fully present, the rest fall back */
.ring__card[data-d="0"] { opacity: 1; box-shadow: var(--shadow-lg); border-color: var(--accent-line); }
.ring__card[data-d="1"] { opacity: .62; cursor: pointer; }
.ring__card[data-d="2"] { opacity: .3;  cursor: pointer; }
.ring__card[data-d="3"] { opacity: .14; pointer-events: none; }
/* the 1.5s fade above is pacing the travel between cards; a hover has to
   answer straight away or the card feels unresponsive to the pointer */
.ring__card[data-d="1"]:hover, .ring__card[data-d="2"]:hover {
  opacity: .85;
  transition-duration: .25s;
}

.ring__controls {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: clamp(22px, 3vw, 34px);
}
.ring__btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink); font-size: 1.05rem; cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), background-color .2s var(--ease), transform .12s var(--ease);
}
.ring__btn:hover { border-color: var(--accent); color: var(--accent); }
.ring__btn:active { transform: scale(.94); }
.ring__count { font-family: var(--mono); font-size: .86rem; color: var(--ink-3); min-width: 4.5em; text-align: center; }
.ring__count b { color: var(--ink); font-weight: 500; }

/* below the ring breakpoint it becomes a plain readable stack */
@media (max-width: 759px) {
  .ring__stage { height: auto; perspective: none; }
  .ring__track { position: static; transform: none !important; transform-style: flat; display: grid; gap: 14px; }
  .ring__card {
    position: static; left: auto; margin-left: 0; width: 100%; height: auto;
    transform: none !important; opacity: 1 !important; pointer-events: auto !important;
  }
  .ring__controls { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ring__track { transition: none; }
  .ring__card { transition: none; }
}

/* ---------- next project ---------- */
.next { display: block; text-decoration: none; border-top: 1px solid var(--line); padding-block: clamp(32px, 4.5vw, 54px); }
.next__row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.next__k { font-size: .88rem; color: var(--ink-3); }
.next__t { margin-top: 8px; transition: color .25s var(--ease); }
.next:hover .next__t { color: var(--accent); }
.next__go { color: var(--accent); font-size: .92rem; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; }
.next .arw { transition: transform .3s var(--ease); }
.next:hover .arw { transform: translateX(5px); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line-soft); padding-block: clamp(30px, 4vw, 46px) 32px; }
.foot__row { display: flex; flex-wrap: wrap; gap: 10px 36px; justify-content: space-between; align-items: baseline; }
.foot a { text-decoration: none; border-bottom: 1px solid var(--accent-line); padding-bottom: 1px; }
.foot a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* only hide once JS is confirmed, so a script failure never blanks the page */
  .js .reveal { opacity: 0; transform: translateY(18px); }
  .js .reveal.is-in {
    opacity: 1; transform: none;
    transition: opacity .65s var(--ease), transform .65s var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  /* anything that lifts on hover AND carries .reveal needs to outrank the rule above */
  .js .card.reveal.is-in:hover { transform: translateY(-3px); transition-delay: 0s; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .card__media img, .btn, .arw { transition: none !important; }
  .progress { display: none; }
}

/* ---------- utilities ---------- */
.mt-s { margin-top: 14px; }
.mt-m { margin-top: clamp(20px, 2.6vw, 30px); }
.mt-l { margin-top: clamp(30px, 4vw, 50px); }
