/* Cassey Realubit — portfolio
   Built from Figma "Design portfolio" (Homepage 1:6, Single assign 11:12, happy mom 11:57).
   1440 frame, 100px side margins, 1240px content, 850px max text width.

   Spacing rules
   - between paragraph sections ............ 50px  (--s-section)
   - between content types (hero/body/footer) 100px (--s-block)
   - heading to body ........................ 20px  (--s-head)  (10px in small case study links)
   - image to caption ....................... 10px  (--s-cap)
*/

:root {
  --bg: #D2D3C3;
  --band: #E1E2DA;
  --ink: #000;
  --muted: #5A5B50;
  --serif: "Domine", Georgia, serif;
  --sans: "Poppins", system-ui, sans-serif;

  --content: 1240px;
  --text: 850px;
  --gutter: clamp(16px, 6.95vw, 100px);

  --s-block: 100px;
  --s-section: 50px;
  --s-head: 20px;
  --s-cap: 10px;

  --fs-body: clamp(1.125rem, 1.67vw, 1.5rem);   /* 24px */
  --fs-h1: clamp(2.5rem, 6.67vw, 6rem);         /* 96px homepage */
  --fs-cs-h1: clamp(2.25rem, 4.45vw, 4rem);     /* 64px case study */
  --fs-h2: clamp(1.75rem, 2.78vw, 2.5rem);      /* 40px */
  --fs-h3: clamp(1.375rem, 2.23vw, 2rem);       /* 32px */
  --fs-cap: 1rem;                               /* 16px */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-anchor: none; } /* js/keep-place.js handles keeping your place on resize */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: var(--fs-body); line-height: 1.5; overflow-x: hidden; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0; }
p { margin: 0; }
b, strong { font-weight: 500; }

.wrap { max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); position: relative; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: #fff; padding: 8px 12px; z-index: 10; }

/* Prose: blank-line paragraph rhythm from Figma (one empty 24px line) */
.prose { max-width: var(--text); }
.prose > * + * { margin-top: 1.5em; }
.prose ul, .prose ol { margin-bottom: 0; padding-left: 1.5em; }
.prose li + li { margin-top: 0; }
.muted { color: var(--muted); }

/* ---------- Homepage nav ---------- */
.nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding-top: 40px; position: relative; z-index: 2; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(20px, 2.8vw, 40px); }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { text-decoration: underline; text-underline-offset: .25em; }
.nav .home { white-space: nowrap; }  /* "Cassey Realubit": home link, same style as the nav links */

/* ---------- Homepage hero ---------- */
.hero { position: relative; overflow-x: clip; }
/* Circle: 800px, left 940 / top 116 in the 1440 frame. Next block starts 100px below it. */
.hero .circle { position: absolute; left: min(65.28vw, calc(50% + 220px)); top: 40px; width: min(55.56vw, 800px); aspect-ratio: 1; border-radius: 50%; background: var(--band); pointer-events: none; }
.hero .wrap { padding-top: clamp(64px, 13.9vw, 200px); min-height: calc(40px + min(55.56vw, 800px) + var(--s-block)); }
.hero h1 { position: relative; font-weight: 400; font-size: var(--fs-h1); max-width: 1073px; }
.hero .aside { position: relative; color: var(--muted); margin-top: 2px; }

/* ---------- Homepage project list ---------- */
.projects { display: flex; flex-direction: column; gap: var(--s-block); }
.project { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-block); align-items: start; text-decoration: none; color: inherit; }
.project .tile { aspect-ratio: 570 / 323; background: var(--band); overflow: hidden; display: grid; place-items: center; }
.project .tile img { width: 100%; height: 100%; object-fit: cover; }
.project h2 { font-size: var(--fs-h2); margin-bottom: var(--s-head); }
.project p { color: var(--muted); line-height: 1.67; }
a.project:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.project.soon { opacity: .5; }
.project.soon .tile span { color: var(--ink); }

/* ---------- Waves ---------- */
.waves { --w: min(538px, 70vw); margin-top: var(--s-block); overflow-x: clip; }
.waves svg { display: block; width: var(--w); height: auto; margin-left: calc(var(--w) * -58 / 538); overflow: visible; }
.waves path { fill: none; stroke: var(--band); stroke-width: 19; stroke-linecap: round; }

/* ---------- About ---------- */
.about { margin-top: var(--s-block); }
.about h2 { font-size: var(--fs-h2); margin-bottom: var(--s-head); }
.about .prose > * + * { margin-top: 1.5em; }

/* ---------- Footer ---------- */
.footer { background: var(--muted); color: #fff; margin-top: var(--s-block); }
.footer .wrap { padding-top: var(--s-block); padding-bottom: var(--s-block); }
.footer h2 { font-weight: 400; font-size: var(--fs-h2); max-width: 610px; margin-bottom: var(--s-head); }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 40px; }
.footer a { text-underline-offset: .2em; }
.footer a:hover { text-decoration-thickness: 2px; }
.footer :focus-visible { outline-color: #fff; }

/* ---------- Case study: back link ---------- */
.back { display: inline-flex; align-items: center; gap: 20px; color: var(--muted); text-decoration: none; padding-top: 40px; }
.back svg { width: 24px; height: 24px; flex: none; }
.back:hover { text-decoration: underline; text-underline-offset: .2em; }

/* ---------- Case study: hero band ---------- */
.cs-hero { margin-top: 40px; background: var(--band); overflow-x: clip; }
.cs-hero .wrap { display: grid; grid-template-columns: minmax(0, var(--text)) 1fr; gap: 40px; align-items: center; padding-top: var(--s-block); padding-bottom: var(--s-block); }
.cs-hero h1 { font-size: var(--fs-cs-h1); }
.cs-hero .sub { color: var(--muted); line-height: 1.67; margin-top: var(--s-head); max-width: 750px; }
.cs-hero .cta { margin-top: 40px; }
.cs-hero .art { justify-self: end; position: relative; }

/* Khan hero art: the "Add assignment" button with a cursor */
.fake-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 321px; height: 73px; padding: 0; overflow: hidden; border-radius: 8px; background: #5753FA; color: #fff; font-family: "Plus Jakarta Sans", var(--sans); font-weight: 600; font-size: 30px; line-height: 1; white-space: nowrap; }
.fake-btn svg { width: 22px; height: 22px; }
.cursor { position: absolute; width: 78px; height: 78px; right: 31px; top: 47px; }
/* One-time intro: cursor glides in and clicks the button (added by JS on first visit per session) */
.fake-btn { transition: none; }
.art.play .cursor { animation: cursor-in 1.7s cubic-bezier(.3, .7, .3, 1) .5s both; transform-origin: 30% 25%; }
.art.play .fake-btn { animation: btn-press 1.7s ease .5s both; }
@keyframes cursor-in {
  0%   { transform: translate(70px, 80px); opacity: 0; }
  15%  { opacity: 1; }
  60%  { transform: translate(0, 0) scale(1); }
  68%  { transform: translate(0, 0) scale(.86); }
  80%  { transform: translate(0, 0) scale(1); }
  100% { transform: translate(0, 0) scale(1); opacity: 1; }
}
@keyframes btn-press {
  0%, 62% { transform: scale(1); background: #5753FA; }
  68%     { transform: scale(.96); background: #4440D6; }
  80%, 100% { transform: scale(1); background: #5753FA; }
}
@media (prefers-reduced-motion: reduce) { .art.play .cursor, .art.play .fake-btn { animation: none; } }

/* happy mom hero art: rotated phone that hangs below the band */
/* happy mom hero (Figma 118:16510). Measured from Figma's rendered layout at 1440:
   the rotated phone's box starts 5px above the green band and its bottom hangs ~90px below it.
   The phone is pinned to the TOP of the band and scales with the page width (cqw = % of the hero's width). */
.cs-hero.hm { overflow: visible; position: relative; z-index: 1; }
.cs-hero.hm .wrap { display: block; }
.cs-hero.hm h1 { max-width: min(800px, 55.56vw); }
.cs-hero.hm .sub { max-width: min(750px, 52.08vw); }
.cs-hero.hm .cta { margin-top: var(--s-section); }
.cs-hero.hm .art { position: absolute; inset: 0; justify-self: stretch; align-self: stretch; container-type: inline-size; pointer-events: none; }
.cs-hero.hm .phone { position: absolute; left: 67.64cqw; top: 1.39cqw; width: 23.96cqw; max-width: none; transform: rotate(-10deg); filter: drop-shadow(-10px 10px 20px rgba(0, 0, 0, .25)); }

.cta { display: inline-block; background: var(--muted); color: #fff; text-decoration: none; font-size: 16px; line-height: 24px; padding: 10px; border-radius: 10px; transition: background-color .15s ease; }
.cta:hover { background: #3F4038; }
.cta.lg { font-size: var(--fs-body); line-height: 1.5; padding: 20px; }
.end-cta { align-self: flex-start; }
/* Chimichurri card + two app screens, one row at 600px tall (Figma 126:16907) */
.chimi { display: grid; grid-template-columns: 558fr 290fr 291fr; gap: var(--s-section); align-items: start; width: 100%; }
.chimi img { width: 100%; height: auto; }

/* ---------- Case study body ---------- */
.cs-body { display: flex; flex-direction: column; gap: var(--s-section); margin-top: var(--s-block); }
.cs-body h2 { font-size: var(--fs-h2); margin-bottom: var(--s-head); }
.section { max-width: var(--text); }
.callout { max-width: var(--text); background: var(--band); border-radius: 20px; padding: 40px; }
.callout ul { margin: 0; padding-left: 1.5em; }

/* Figures: images span the 1240 content width, caption 10px below, max 850 wide */
.fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--s-cap); width: 100%; }
.fig figcaption { font-size: var(--fs-cap); font-style: italic; color: var(--muted); text-align: center; max-width: var(--text); }
.fig img { width: 100%; }
.screen { border-radius: 10px; }
.zoom { display: block; width: min(646px, 100%); cursor: zoom-in; }  /* topic-first flow: 646 x 900 */           /* desktop screenshots */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; align-items: start; }
.grid-2 img { aspect-ratio: 610 / 342; object-fit: cover; object-position: left top; }
.grid-2.natural img { aspect-ratio: auto; }
.grid-2.even img { aspect-ratio: 610 / 343; object-position: center; }  /* same-height pair (Figma 92:15269) */
.strip { display: grid; grid-template-columns: 345fr 471fr 387fr; gap: 19px; width: 100%; }
.strip img { aspect-ratio: var(--ar); object-fit: cover; object-position: left top; }
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; width: 100%; align-items: start; }

.phones { display: flex; justify-content: space-between; gap: 32px; width: 100%; }
.phones > * { width: min(539px, 100%); }
.phone-video { position: relative; width: min(364px, 100%); border-radius: 40px; overflow: hidden; background: #fff; border: 1px solid rgba(0, 0, 0, .08); box-shadow: -10px 10px 20px rgba(0, 0, 0, .15); }
.phone-video video { width: 100%; }
.phones .phone-video { width: min(364px, 100%); margin: 0 auto; align-self: center; }
.phone-video video { cursor: pointer; }
/* Play button over screen recordings (videos don't autoplay) */
.play-btn { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; cursor: pointer; transition: opacity .2s ease, background-color .15s ease, transform .15s ease; }
.play-btn svg { width: 30px; height: 30px; fill: currentColor; margin-left: 4px; }
.play-btn:hover { background: rgba(0, 0, 0, .8); transform: scale(1.05); }
.play-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px #000; }
.playing .play-btn { opacity: 0; pointer-events: none; }
/* Three home screens across the page (Figma 95:16208): 370 x 750 each, 50px apart */
.trio { display: flex; justify-content: center; align-items: flex-start; gap: var(--s-section); width: 100%; }
.trio img { width: min(370px, calc((100% - 2 * var(--s-section)) / 3)); height: auto; }

/* Hand-drawn loops over screenshots (positions from Figma, in % of the image) */
.marked { position: relative; }
.loop { position: absolute; overflow: visible; pointer-events: none; }
.loop path { fill: none; stroke: #4A4B42; stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* Table */
.table-wrap { width: 100%; border: 1px solid var(--muted); border-radius: 10px; overflow: hidden; }
.data { width: 100%; border-collapse: collapse; }
.data th, .data td { text-align: left; vertical-align: middle; font-weight: 400; padding: 10px 20px; }
.data th { font-weight: 500; padding: 20px; border-bottom: 1px solid var(--muted); }
.data th:nth-child(2), .data td:nth-child(2) { border-left: 1px solid var(--muted); border-right: 1px solid var(--muted); }
.data th:first-child, .data td:first-child { width: 120px; }
.data th:last-child, .data td:last-child { width: 220px; }

/* End of case study */
/* Back to the top: 100px from the content above and the links below (50 gap + 50) */
.to-top-wrap { display: flex; flex-direction: column; align-items: center; padding-top: var(--s-section); }
.to-top { color: #000; text-underline-offset: .2em; }
/* happy mom mascot hops gently beside "try it yourself!", feet on the text's bottom edge */
.try { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; }
.mascot { width: 60px; height: 60px; flex: none; margin-top: -24px; /* let her head rise into the gap so the line keeps normal height */ transform-origin: center bottom; animation: hop 2.6s ease-in-out infinite; }
@keyframes hop {
  0%, 55%, 100% { transform: translateY(0) scale(1, 1); }
  62% { transform: translateY(0) scale(1.04, .96); }
  75% { transform: translateY(-8px) scale(.98, 1.02); }
  88% { transform: translateY(0) scale(1.03, .97); }
}
@media (prefers-reduced-motion: reduce) { .mascot { animation: none; } }

.others { display: flex; flex-direction: column; gap: var(--s-section); padding-top: var(--s-section); }
.others .label { color: var(--muted); }
.other { display: flex; gap: 20px; align-items: center; text-decoration: none; color: inherit; }
.other .thumb { flex: none; width: 120px; height: 120px; }
.other .thumb.khan { width: 113px; }
.other .title { display: block; font-family: var(--serif); font-weight: 700; font-size: var(--fs-h3); line-height: 1.15; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.other .desc { display: block; color: var(--muted); line-height: 1.67; margin-top: 10px; }
a.other:hover .title { text-decoration-thickness: 2px; }
.other.soon { opacity: .5; }

/* ---------- Responsive ---------- */
/* Hero art hides (doesn't stack) once there's no room beside the title */
/* happy mom phone needs a little more room than the Khan button */
@media (max-width: 1180px) {
  .cs-hero .wrap { grid-template-columns: 1fr; }
  .cs-hero:not(.hm) .art { display: none; }
}
/* happy mom phone scales with the page; hide it once the text needs the full width */
@media (max-width: 900px) {
  .cs-hero.hm .art { display: none; }
  .cs-hero.hm h1, .cs-hero.hm .sub { max-width: none; }
  .chimi { grid-template-columns: 1fr; justify-items: center; }
  .chimi img + img { width: min(370px, 100%); }
}
@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; gap: 24px; }
  .hero .circle { display: none; }
  .hero .wrap { min-height: 0; padding-bottom: var(--s-block); }
  .grid-2, .strip, .before-after { grid-template-columns: 1fr; }
  .phones { flex-direction: column; align-items: center; }
  .trio { flex-direction: column; align-items: center; }
  .trio img { width: min(370px, 100%); }
  .data th:first-child, .data td:first-child { width: auto; }
  .data th:last-child, .data td:last-child { width: auto; white-space: nowrap; }
}
@media (max-width: 600px) {
  :root { --s-block: 64px; --s-section: 40px; }
  .callout { padding: 24px; }
  .data th, .data td { padding: 8px 10px; font-size: .9em; }
  .other { align-items: flex-start; }
  .other .thumb { width: 72px; height: 72px; }
  .other .thumb.khan { width: 68px; }
  .fake-btn { font-size: 22px; }
}
