/* Carolina Teper — portfolio
   Palette: paper white, ink, two greys, and one soft panel colour per project. */

:root {
  --paper: #fafbfc;
  --ink: #222222;
  --ink-soft: #666666;
  --line: #e4e6eb;
  --panel: #f1f2f4;

  --qa: #f4ebfa;        /* Custom Criteria — lilac */
  --qa-deep: #7a4f99;
  --ma: #ddf1e7;        /* Multi-Attribution — mint */
  --ma-deep: #1e7a50;
  --lc: #fdeccf;        /* Live CSAT — apricot */
  --lc-deep: #a2620b;

  --display: "Source Serif Pro", Georgia, serif;
  --text: "Inter", "Helvetica Neue", Arial, sans-serif;
  --reading: "Inter", "Helvetica Neue", Arial, sans-serif; /* long text */

  --measure: 36rem;
  --wide: calc(75rem + 2 * var(--gutter));
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
}

* { 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(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* Inter everywhere at -1% tracking. Set on each element (not inherited from body) so it scales with every font size;
   text inside the serif titles keeps the title's own tracking. */
:where(body, body *) { letter-spacing: -0.01em; }
:where(.job-head strong, .hero h1, .case-hero h1, .contact h2, .chapter h2, .section-title, .project-info h3, .next a, .results b) * { letter-spacing: inherit; }

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

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--qa-deep); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 0.75rem; background: var(--ink); color: var(--paper); padding: 0.5rem 0.75rem; z-index: 10; }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding: 1.5rem 0;
  background: var(--paper);
  /* slides back in gently, leaves quickly, like the previous portfolio */
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.site-header.is-hidden { transform: translate3d(0, -100%, 0); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { .site-header, .site-header.is-hidden { transition: none; } }
.site-header .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: 1.0625rem; line-height: 1.6; }
.brand { text-decoration: none; }
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a { text-decoration: none; color: var(--ink); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Home hero */
.hero .wrap {
  min-height: min(calc(100svh - 4.6rem), 41rem);
  padding-top: clamp(3.5rem, 9vw, 5.5rem);
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
  padding-left: var(--gutter);
}
.hero { --hero-title: clamp(2.75rem, 5.3vw, 5rem); }
/* Optical alignment from the Figma frame: the title's letters start further in than their box, so the smaller lines shift to meet them. */
.hero-hello { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0 calc(var(--hero-title) * 0.05); font-weight: 300; font-size: 1.25rem; line-height: 1.44; letter-spacing: -0.01em; color: #5c5c5c; }
.hero-hello img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.hero-name { font-size: 1.25rem; }
.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--hero-title);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #000;
  margin: 0.5rem 0 0;
  max-width: 10em;
}
.hero-now { margin: 0.5rem 0 0 calc(var(--hero-title) * 0.075); font-weight: 300; font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.01em; color: #5c5c5c; }

/* Work list */
.work { padding-bottom: clamp(4rem, 9vw, 8rem); }
.section-title { font-family: var(--display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.02em; margin: 0 0 2rem; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1.5rem, 3vw, 2.4rem); row-gap: clamp(3rem, 6vw, 5rem); align-items: start; }
/* Cards side by side, 581 x 486 at 1512 wide (Figma) */
.project-grid .project-panel { aspect-ratio: 581 / 486; border-radius: 10px; }
.project { display: block; text-decoration: none; }
.project-panel {
  border-radius: 24px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: transform 0.4s ease;
}
.project-panel.has-shot { place-items: start center; padding-top: 6%; }
.project-panel.has-shot img { width: 88%; border-radius: 12px; }
.project-panel.has-shot.full { padding-top: 0; }
.project-panel picture { display: contents; }
.project-panel.has-shot.full img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
/* Hover, like the previous portfolio: the screen inside zooms in a little and a round arrow button appears */
.project-panel { position: relative; }
.project-panel img { transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.project:hover .project-panel img, .project:focus-visible .project-panel img { transform: scale(1.05); }
.project-arrow {
  position: absolute; left: 1.5rem; bottom: 1.5rem; z-index: 1;
  width: 3.5rem; height: 3.5rem; border-radius: 50%;
  display: grid; place-items: center;
  /* a frosted, half-transparent circle, like the previous portfolio */
  background: rgba(242, 241, 246, 0.7);
  box-shadow: 0 2px 14px rgba(30, 20, 60, 0.05);
  -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%);
  opacity: 0; transform: scale(0.85);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
/* the arrow starts white and pointing up-right, then turns to point right as it darkens */
.project-arrow svg {
  color: #fff; transform: rotate(-45deg);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.project:hover .project-arrow, .project:focus-visible .project-arrow { opacity: 1; transform: scale(1); }
.project:hover .project-arrow svg, .project:focus-visible .project-arrow svg { color: #111; transform: rotate(0); }
@media (prefers-reduced-motion: reduce) { .project-panel, .project-panel img, .project-arrow, .project-arrow svg { transition: none; } }
.project-info { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.25rem; padding: 0 0.75rem; }
.project-info h3 { font-family: var(--display); font-weight: 600; font-size: 1.5rem; line-height: 1.3; letter-spacing: -0.02em; margin: 0; color: #222; }
.project-info p { margin: 0; color: var(--ink-soft); max-width: 44rem; }
.project-info .when { order: -1; color: #666; font-size: 1rem; }
.project.is-soon { cursor: default; }
.project.is-soon .project-panel { opacity: 0.7; }
.project.is-soon:hover .project-panel { transform: none; }
.soon { display: block; margin-top: 0.35rem; font-size: 0.9rem; color: var(--ink-soft); }

.qa { background: var(--qa); color: var(--qa-deep); }
.ma { background: var(--ma); color: var(--ma-deep); }
.lc { background: var(--lc); color: var(--lc-deep); }

/* Image placeholders: replaced by real screens later */
.ph { font-size: 0.95rem; text-align: center; padding: 2rem; max-width: 26rem; }

/* About and Experience (Figma 20888:52419): two rows, photo and text side by side */
.about { padding: clamp(4rem, 8vw, 7rem) 0; }
.about .wrap { display: grid; gap: clamp(4rem, 7vw, 6.25rem); }
.about-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1.5rem, 3vw, 2.4rem); align-items: center; }
.about-photo { display: block; width: 100%; aspect-ratio: 581 / 486; object-fit: cover; object-position: 50% 59%; border-radius: 10px; }
/* Cursor chat over the About photo (cursor-chat.js runs it), like Figma's cursor chat */
.about-media { position: relative; }
.about { overflow-x: clip; }  /* the cursor starts off to the side; never let it widen the page */
.cursor-chat {
  --x: 59%; --y: 22%;
  position: absolute; left: var(--x); top: var(--y); z-index: 2;
  pointer-events: none;
  opacity: 0; transform: translate3d(120px, 70px, 0);
  transition: opacity 0.9s cubic-bezier(0.33, 1, 0.68, 1), transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cursor-chat.is-on { opacity: 1; }
.cursor-chat.is-here { transform: translate3d(0, 0, 0); }
.cursor-chat.is-drift { transform: translate3d(14px, 10px, 0); transition: opacity 0.9s cubic-bezier(0.33, 1, 0.68, 1), transform 3s cubic-bezier(0.45, 0, 0.55, 1); }
.cc-cursor { display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25)); }
.cc-bubble {
  position: absolute; left: 25px; top: 25px;
  height: 3.125rem; padding: 0 1.25rem; box-sizing: border-box;
  display: flex; align-items: center; overflow: hidden; white-space: nowrap;
  border-radius: 999px;
  background: #e5249b; border: 2px solid #f56fc3;
  box-shadow: 0 0 22px rgba(229, 36, 155, 0.45);
  color: #fff; font-size: 1.25rem; line-height: 1; letter-spacing: -0.01em;
  opacity: 0; transform: scale(0.6); transform-origin: 0 0;
  transition: opacity 0.45s cubic-bezier(0.33, 1, 0.68, 1), transform 0.6s cubic-bezier(0.34, 1.4, 0.64, 1), width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.cursor-chat.is-open .cc-bubble { opacity: 1; transform: scale(1); }
.cc-bubble.is-placeholder .cc-text { color: rgba(255, 255, 255, 0.72); }
/* a blinking caret before the placeholder, like a text field */
.cc-bubble.is-placeholder::before { content: ""; flex: none; width: 1.5px; height: 1.15em; margin-right: 1.5px; background: #fff; animation: cc-caret 1s steps(1) infinite; }
@keyframes cc-caret { 50% { opacity: 0; } }
@media (max-width: 760px) { .cursor-chat { --x: 22%; --y: 8%; } }
@media (prefers-reduced-motion: reduce) { .cursor-chat, .cc-bubble { transition: none; } .cc-bubble::before { animation: none; } }

/* Photo stack next to Experience (photo-stack.js moves it) */
.photo-stack { position: relative; width: min(22.5rem, 100%); aspect-ratio: 1; justify-self: center; }
.photo-stack img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 10px;
  box-shadow: 0 1px 2px rgba(20, 20, 40, 0.06), 0 8px 24px rgba(20, 20, 40, 0.08);
  will-change: transform; backface-visibility: hidden;
}
.about .section-title { color: #222; line-height: 1.6; margin: 0 0 1.5rem; }
.experience .section-title { margin-bottom: 2.5rem; }
/* About text: 452 wide, 64 in from each side of its column (Figma) */
.about-row:not(.experience) .about-text { padding-inline: clamp(0rem, 4.2vw, 4rem); }
.about-text p { margin: 0 0 1rem; color: #5c5c5c; font-size: 1rem; line-height: 1.8; }
.jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; }
.jobs li { display: grid; grid-template-columns: 6.5625rem minmax(0, 1fr); column-gap: 4rem; align-items: start; }
.jobs .dates { font-size: 1.125rem; color: #666; white-space: nowrap; line-height: 1.5; }
.about-text .job-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 0.5rem; font-size: 1.125rem; line-height: 1.5; color: #666; }
.job-head strong { font-weight: 500; color: #000; letter-spacing: -0.03em; }
.job-head .dot { width: 4px; height: 4px; border-radius: 50%; background: #666; }
.about-text .job-desc { margin: 0; }

/* Contact */
.contact { padding: clamp(4rem, 10vw, 7rem) 0; border-top: 1px solid var(--line); }
.contact h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4.2vw, 4.25rem); letter-spacing: -0.03em; line-height: 1.12; margin: 0 0 1.5rem; max-width: 18em; }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; font-size: 1.15rem; }

.site-footer { padding: 2rem 0 3rem; color: var(--ink-soft); font-size: 0.9rem; }

/* Case study */
.case-hero { padding: clamp(3rem, 7vw, 5rem) 0 clamp(4rem, 9vw, 7.5rem); }
.case-head { max-width: var(--wide); }
.case-text { max-width: calc(40.125rem + 2 * var(--gutter)); }
.case-company { margin: 0; color: var(--ink-soft); font-size: 1.125rem; line-height: 1.6; }
.case-hero h1 { font-family: var(--display); font-weight: 400; letter-spacing: -0.02em; color: #282828; font-size: clamp(2.25rem, 3.56vw, 3.36rem); line-height: 1.2; margin: 1.25rem 0 0; max-width: 18em; }

.case-media { display: grid; grid-template-columns: minmax(0, 474fr) minmax(0, 710fr); gap: clamp(1rem, 3.11vw, 2.9375rem); margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.case-media .frame { border-radius: 10px; aspect-ratio: 474 / 448; display: grid; place-items: center; overflow: hidden; }
.case-media .frame { position: relative; }
.case-media .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.case-media .frame:last-child { aspect-ratio: 710 / 448; }
.case-media .frame:last-child img { object-position: right center; }


.figure { max-width: 38rem; margin: 0 0 clamp(3rem, 7vw, 5rem); }
.figure .frame { border-radius: 10px; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; }
.figure .frame.has-shot { display: block; aspect-ratio: auto; padding: clamp(0.75rem, 2vw, 1.25rem); }
.figure .frame.has-shot img { width: 100%; border-radius: 10px; }
.figure .frame.has-shot.full { padding: 0; background: none; }   /* no coloured hairline at the edges when the image fills the frame */
.figure .frame.has-shot.full img { display: block; border-radius: 0; }
.figure .frame.stack { display: grid; gap: 0.75rem; }
.figure .frame.has-shot.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(0.75rem, 2vw, 1.25rem); align-items: start; }
.figure figcaption { color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.85rem; max-width: var(--measure); }

.case-index { position: sticky; top: 2rem; align-self: start; }
.case-index ul { list-style: none; margin: 0; padding: 0; width: max-content; border-left: 2px solid var(--line); }
.case-index a { display: block; margin-left: -2px; padding: 0.3rem 0 0.3rem 1rem; border-left: 2px solid transparent; color: var(--ink-soft); text-decoration: none; }
.case-index a:hover { color: var(--ink); }
.case-index a[aria-current] { color: var(--ink); border-left-color: var(--ink); }

.chapter { margin: 0 0 clamp(4.5rem, 9vw, 7.5rem); scroll-margin-top: 2rem; font-size: 1rem; line-height: 1.75; }
.chapter h2 { font-family: var(--display); font-weight: 600; font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.01em; color: #282828; margin: 0 0 1rem; text-wrap: balance; }
.chapter .figure figcaption { font-size: 1rem; }
.chapter.case-overview h2 { line-height: normal; margin: 0 0 2rem; }
.chapter.case-overview h3 { font-size: 1rem; line-height: normal; color: #282828; margin: 0 0 0.5rem; }
.overview-item { margin: 0 0 2rem; }
.overview-item > p { margin: 0; font-family: var(--reading); letter-spacing: -0.01em; color: #5c5c5c; }
.overview-impact { margin-bottom: 0; }
.chapter.case-overview .overview-impact h3 { margin-bottom: 1rem; }
.case-subtitle { margin: 1rem 0 0; max-width: 46rem; font-family: var(--reading); font-size: 1.125rem; line-height: 1.75; letter-spacing: -0.01em; color: #5c5c5c; }
.overview-item:last-child { margin-bottom: 0; }
/* Impact numbers: grey cards (Figma case study spec) */
.stat-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.stat-cards p { flex: 1 1 0; min-width: 0; margin: 0; padding: 20px; border-radius: 6px; background: #f2f2f2; display: flex; flex-direction: column; gap: 4px; font-family: var(--reading); font-size: 0.875rem; line-height: 1.4; letter-spacing: -0.01em; color: #5c5c5c; }
.stat-cards b { font-family: var(--display); font-weight: 700; font-size: 2.25rem; line-height: normal; letter-spacing: -0.01em; color: #282828; }
.stat-cards.two p { flex: 0 0 calc((100% - 12px) / 2); }
.case-overview .stat-cards { min-height: 142px; align-items: flex-start; }   /* the Impact block is 142px tall in the spec */
.chapter .stat-cards.two { margin: 2rem 0; }
@media (max-width: 560px) { .stat-cards p, .stat-cards.two p { flex: 1 1 100%; } }

.chapter h3 { font-family: var(--reading); font-weight: 500; letter-spacing: -0.01em; color: #282828; font-size: 1.125rem; line-height: 1.25; margin: clamp(3.5rem, 7vw, 5rem) 0 1rem; }
.chapter h2 + h3 { margin-top: 2.5rem; }
/* after an image, always 120px before whatever comes next (the next section already sits 120px below) */
.chapter .figure + * { margin-top: clamp(4.5rem, 9vw, 7.5rem); }
/* Images run wider than the text column, staying centered on it. */
.chapter .figure { --figure-w: min(57rem, 100vw - 2 * var(--gutter)); width: var(--figure-w); max-width: none; margin: 2.5rem 0 0 calc((100% - var(--figure-w)) / 2); }
.chapter .figure.narrow { --figure-w: min(47.5rem, 100vw - 2 * var(--gutter)); }
.chapter .figure figcaption { width: min(40.125rem, 100%); max-width: none; margin-inline: auto; text-align: center; }
.chapter .body, .chapter .figure figcaption, .about-grid p, .project-info p { font-family: var(--reading); }
.chapter .body, .chapter .figure figcaption, .about-grid p, .project-info p { letter-spacing: -0.01em; }
.about-grid p, .project-info p { line-height: 1.75; }
.chapter .body { max-width: none; color: #5c5c5c; }
.chapter .body strong { color: var(--ink); font-weight: 500; }
/* Live CSAT: problems as grey cards, one list under the other (Figma) */
.problem-list { margin-top: 2rem; }
.chapter .problem-list h3 { margin: 0 0 1rem; line-height: normal; }
.problem-cards { display: flex; flex-direction: column; gap: 12px; }
.problem-cards p { margin: 0; padding: 20px; border-radius: 6px; background: #f2f2f2; font-family: var(--reading); font-size: 1rem; line-height: 1.75; letter-spacing: -0.01em; color: #5c5c5c; }
.problem-cards strong { font-weight: 600; color: inherit; }
/* Live CSAT: problems as text grids instead of an image */
.problem-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 1.5rem); }
.problem-column { display: flex; flex-direction: column; }
.chapter .problem-figure h3 { line-height: normal; margin: 0 0 1rem; }
.problem-grid { flex: 1; display: grid; border: 1px solid #d9d9d9; border-radius: 1px; }
.problem-grid p { margin: 0; padding: 1.25rem; font-family: var(--reading); font-size: 1rem; line-height: 1.75; letter-spacing: -0.01em; color: #5c5c5c; }
.problem-grid p + p { border-top: 1px solid #d9d9d9; }
.problem-grid strong { font-weight: 600; color: inherit; }
.chapter .body p { margin: 0 0 1rem; }
.chapter .body p:last-child { margin-bottom: 0; }
.chapter .body ul { margin: 0 0 1.1rem; padding-left: 1.2rem; }
.chapter .body li { margin-bottom: 0.6rem; }

.results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; margin: 0.5rem 0 1.5rem; color: var(--ink); }
.results div { border-top: 2px solid var(--qa-deep); padding-top: 0.75rem; }
.results b { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(1.8rem, 3.5vw, 2.6rem); letter-spacing: -0.03em; line-height: 1.1; }
.results span { color: var(--ink-soft); font-size: 0.95rem; }

.next { border-top: 1px solid var(--line); padding: clamp(3rem, 7vw, 5rem) 0; }
.next p { color: var(--ink-soft); margin: 0 0 0.5rem; }
.next a { font-family: var(--display); font-size: clamp(1.6rem, 3.5vw, 2.6rem); letter-spacing: -0.02em; font-weight: 400; }

/* On wider screens, long section titles fill the text column before wrapping */
@media (min-width: 761px) {
  .chapter h2 { text-wrap: pretty; }
}

@media (max-width: 760px) {
  .about-grid, .project-grid, .case-media, .about-row { grid-template-columns: 1fr; }
  .about-row { row-gap: 2rem; }
  .about-row:not(.experience) .about-text { padding-inline: 0; }
  .about-row.experience .photo-stack { display: none; }
  .jobs li { grid-template-columns: 1fr; row-gap: 0.25rem; }
  .case-media .frame:last-child { aspect-ratio: 4 / 3; }
  .case-media .frame:first-child { aspect-ratio: 1422 / 1344; }
  .chapter h2 { font-size: 1.375rem; }
  .problem-columns { grid-template-columns: 1fr; gap: 2.5rem; }
  .figure .frame.has-shot.pair { grid-template-columns: 1fr; }
  .hero .wrap { min-height: 0; padding-left: var(--gutter); }
  .project-grid { gap: 3rem; }
  .site-nav { gap: 1rem; }
  .figure .frame, .project-panel { border-radius: 10px; aspect-ratio: 4 / 3; }
}

/* Soft reveal on scroll, like the previous portfolio: each block rises a little and fades in, settling slowly.
   No blur, nothing that calls attention to itself. */
.reveal-on .reveal {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 1s cubic-bezier(0.33, 1, 0.68, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-on .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal-on .reveal { opacity: 1; transform: none; transition: none; } }

/* No single words left alone on the last line */
main p, main li { text-wrap: pretty; }
main h3 { text-wrap: balance; }
.case-hero h1 { text-wrap: balance; }
