/* ============================================================
   Case Study — Warm Variant (matches the Inter Tight / cream
   homepage design: used on Pielio only, forked from
   case-study.css so Fiesta and Brain Data Explorer are untouched)
   Maria Baida · Portfolio
   ============================================================ */

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

:root {
  --ink:    #16150f;
  --soft:   #48463d;
  --muted:  #8d887b;
  --faint:  #bdb8aa;
  --accent: #c2601e;
  --rule:   #ebe7dd;
  --bg:     #fbfaf8;

  /* Motion system — shared with the homepage, whisper-quiet */
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.18s;
  --dur:      0.45s;
}

html { scroll-behavior: smooth; }

/* ── MOTION: scroll reveal ──────────────────────────────────
   Hidden only with JS present AND motion welcome, so no-JS /
   reduced-motion readers always get full content. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(70px);
    will-change: opacity, transform;
  }
}

/* ── MOTION: hero entrance ──────────────────────────────────  */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .hero-label,
  .js .hero-title,
  .js .meta-strip {
    opacity: 0;
    animation: rise 0.6s var(--ease) forwards;
  }
  .js .hero-label { animation-delay: 0.05s; }
  .js .hero-title { animation-delay: 0.13s; }
  .js .meta-strip { animation-delay: 0.26s; }
}

/* ── MOTION: hero blob ───────────────────────────────────────  */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MOTION: respect reduced-motion globally ──────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter Tight', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ──────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--rule);
  padding: 0 120px; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-weight: 700; font-size: 15px;
  color: var(--ink); text-decoration: none;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  position: relative;
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted);
  text-decoration: none; transition: color var(--dur-fast) var(--ease);
}
.nav-links a:hover,
.nav-links a:focus-visible { color: var(--ink); }
.nav-links a.nav-link-accent { color: var(--ink); }
.nav-links a.nav-link-accent:hover,
.nav-links a.nav-link-accent:focus-visible { color: var(--accent); }

/* Roll Links: each letter is a tiny drum with the letter stacked
   twice. Hovering (or focusing) rolls every letter up in sequence,
   left to right, revealing the duplicate underneath. */
.roll-text { display: inline-flex; }
.roll-arrow { margin-left: 2px; }
.roll-ch {
  display: inline-block;
  height: 1.2em;
  overflow: hidden;
  white-space: pre;
  vertical-align: top;
}
.roll-ch .roll-in {
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-fast) var(--ease);
  transition-delay: calc(var(--i, 0) * 16ms);
}
.roll-ch .roll-in span {
  display: block;
  height: 1.2em;
  line-height: 1.2em;
}
.nav-links a:hover .roll-in,
.nav-links a:focus-visible .roll-in {
  transform: translateY(-50%);
}

.nav-toggle { display: none; }
.nav-overlay { display: none; }

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  max-width: 1200px; margin: 0 auto;
  padding: 80px 120px 0;
}
.hero-label {
  position: relative; z-index: 1;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 20px;
}
a.hero-label {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  transition: gap 0.2s, color 0.2s;
}
a.hero-label::before { content: "←"; }
a.hero-label:hover { color: var(--ink); gap: 10px; }
.hero-title {
  position: relative; z-index: 1;
  font-weight: 800;
  font-size: 58px; line-height: 1.06; letter-spacing: -0.03em;
  max-width: 820px; margin-bottom: 40px;
}
.hero-title em { font-style: normal; }

/* ── META STRIP ───────────────────────────────────────────── */
.meta-strip {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 8px;
}
.meta-item {
  background: #fff; padding: 20px 24px;
  border-right: 1px solid var(--rule);
}
.meta-item:last-child { border-right: none; }
/* ── HERO SCREEN ──────────────────────────────────────────── */
.hero-screen {
  max-width: 1200px; margin: 40px auto 0; padding: 0 120px;
}
.hero-screen img {
  display: block; width: 100%; border: 1px solid var(--rule);
  border-radius: 18px;
}

.meta-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.meta-value { font-size: 14px; line-height: 1.5; color: var(--ink); }

/* ── IMAGE PLACEHOLDERS ───────────────────────────────────── */
.screen {
  background: var(--rule);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
}
.screen-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--faint);
}
.screen-sublabel { font-size: 12px; color: var(--faint); }
.img-caption { font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center; }
.img-caption a {
  color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease);
}
.img-caption a:hover { border-color: var(--accent); }
.img-block { margin: 40px 0; }
.img-block img, .two-up img, .three-up img {
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: 80vh;
  margin: 0 auto;
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.video-embed {
  position: relative; width: 100%; padding-top: 56.25%;
  overflow: hidden; background: #000; border: 1px solid var(--rule);
  border-radius: 16px;
}
.video-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* ── CONTENT WRAPPER ──────────────────────────────────────── */
.content {
  max-width: 1200px; margin: 0 auto;
  padding: 0 120px;
}

/* ── SECTION DIVIDER ──────────────────────────────────────── */
.section-label {
  display: flex; align-items: center; gap: 16px;
  padding: 80px 0 48px;
}
.section-label span {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.section-label hr { flex: 1; border: none; border-top: 1px solid var(--rule); }

/* ── TWO-COLUMN LAYOUT ────────────────────────────────────── */
.two-col {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 80px; margin-bottom: 48px;
}
.two-col--spaced { margin-top: 60px; }
.col-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  padding-top: 6px; line-height: 1.7;
}
.col-body h2 {
  font-weight: 800;
  font-size: 30px; line-height: 1.2; letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.col-body h2 em { font-style: normal; }
.col-body p {
  font-size: 15px; line-height: 1.75; color: var(--soft);
  margin-bottom: 16px;
}
.col-body p:last-child { margin-bottom: 0; }
.col-body p strong { color: var(--ink); font-weight: 600; }

/* ── CALLOUT ──────────────────────────────────────────────── */
.callout {
  border-left: 2px solid var(--accent);
  padding: 20px 28px; margin: 28px 0;
  background: #fff;
  border-radius: 0 12px 12px 0;
}
.callout p {
  font-weight: 600;
  font-size: 19px; line-height: 1.55; letter-spacing: -0.02em;
  color: var(--ink) !important; margin: 0 !important;
}

/* ── OUTCOMES ─────────────────────────────────────────────── */
.outcomes {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0;
  background: #fff; border: 1px solid var(--rule); margin-bottom: 0;
  border-radius: 16px; padding: 8px;
}
.outcome-card { background: #fff; padding: 32px 28px; border-right: 1px solid var(--rule); }
.outcome-card:last-child { border-right: none; }
.outcome-num {
  font-weight: 800;
  font-size: 52px; line-height: 1; letter-spacing: -0.04em;
  color: var(--accent); margin-bottom: 12px;
}
.outcome-desc { font-size: 13px; line-height: 1.65; color: var(--soft); }
.outcome-desc strong {
  color: var(--ink); font-weight: 600;
  display: block; margin-bottom: 4px;
}

/* ── TAGS ─────────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--rule); padding: 4px 10px;
  border-radius: 100px;
}

/* ── NUMBERED LIST ────────────────────────────────────────── */
.num-list { list-style: none; margin: 24px 0; }
.num-list li {
  display: grid; grid-template-columns: 32px 1fr;
  gap: 16px; padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 15px; line-height: 1.65; color: var(--soft);
}
.num-list li:first-child { border-top: 1px solid var(--rule); }
.num-list li .num {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--accent); padding-top: 3px;
}
.num-list li strong { color: var(--ink); font-weight: 600; }

/* ── PROCESS STEPS ────────────────────────────────────────── */
.steps {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; background: #fff; border: 1px solid var(--rule);
  margin: 40px 0; padding: 8px;
  border-radius: 16px;
}
.step { background: #fff; padding: 24px 20px; border-right: 1px solid var(--rule); }
.step:last-child { border-right: none; }
.step-num {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.step-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.step-body { font-size: 13px; color: var(--soft); line-height: 1.55; }

/* ── CARD GRIDS ───────────────────────────────────────────── */
.card-grid-2, .card-grid-3 {
  display: grid; gap: 0;
  background: #fff; border: 1px solid var(--rule);
  margin: 40px 0; padding: 8px;
  border-radius: 16px;
}
.card-grid-2 { grid-template-columns: 1fr 1fr; }
.card-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.card { background: #fff; padding: 28px 32px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.card-grid-2 .card:nth-child(2n) { border-right: none; }
.card-grid-3 .card:last-child { border-right: none; }
.card-grid-2 .card:nth-last-child(-n+2) { border-bottom: none; }
.card-grid-3 .card:nth-last-child(-n+3) { border-bottom: none; }
.card-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.card-title {
  font-weight: 700;
  font-size: 18px; line-height: 1.3; letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.card-body { font-size: 14px; line-height: 1.65; color: var(--soft); }
.card-body strong { color: var(--ink); font-weight: 600; }
.card-list { list-style: none; margin-top: 16px; }
.card-list li {
  padding: 6px 0;
  font-size: 13px; line-height: 1.5; color: var(--muted);
}
.card-list li:first-child { padding-top: 0; }

/* ── STICKY BOARD (whiteboard with one sticker per idea) ───── */
.sticky-board {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 36px; margin: 40px 0;
  padding: 48px 40px;
  background-color: #FAFAF7;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 28px 28px;
  border: 1px solid var(--rule);
  border-radius: 18px;
}
.sticky-group { display: flex; flex-direction: column; }
.sticky-group .card-label { color: var(--accent); }
.sticky-group .card-title { font-size: 17px; margin-bottom: 22px; }
.sticky-stack { display: flex; flex-direction: column; gap: 16px; }

.sticky-note {
  position: relative;
  padding: 14px 18px 13px;
  border-radius: 3px;
  font-size: 13px; line-height: 1.5; color: rgba(22,21,15,.75);
  box-shadow: 0 10px 16px -10px rgba(22,21,15,.4), 0 2px 4px rgba(22,21,15,.1);
  transition: transform var(--dur-fast) var(--ease);
}
.sticky-note:nth-child(odd)  { transform: rotate(-2deg); }
.sticky-note:nth-child(even) { transform: rotate(1.5deg); }
.sticky-note:hover { transform: rotate(0deg) scale(1.05); z-index: 2; }
.sticky-note::before {
  content: ""; position: absolute; top: -10px; left: 50%;
  width: 40px; height: 18px;
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(22,21,15,.08);
  box-shadow: 0 2px 3px rgba(22,21,15,.1);
  transform: translateX(-50%) rotate(-4deg);
}

.sticky-group--yellow .sticky-note { background: #FFF3B0; }
.sticky-group--peach  .sticky-note { background: #FFD9BE; }
.sticky-group--gray   .sticky-note { background: #E4E6EE; }

/* ── IMAGE GRIDS ──────────────────────────────────────────── */
.two-up, .three-up {
  display: flex; flex-wrap: wrap;
  justify-content: center; align-items: flex-start;
  gap: 16px; margin: 40px 0;
}
.two-up .img-block, .three-up .img-block { margin: 0; flex: 0 1 auto; min-width: 0; }
.two-up .img-block   { max-width: calc(50% - 8px); }
.three-up .img-block { max-width: calc(33.333% - 11px); }

/* Pairs/sets of screenshots with mismatched native sizes: force identical
   width and height so they sit flush, instead of each keeping its own
   aspect ratio. */
.two-up--match .img-block   { width: calc(50% - 8px); }
.two-up--match .img-block img {
  width: 100%; height: auto;
  aspect-ratio: 1280 / 850;
  object-fit: cover; object-position: top;
}

/* ── PREV / NEXT PROJECT ──────────────────────────────────── */
.prev-project {
  border-top: 1px solid var(--rule); margin-top: 80px; padding: 60px 0;
}
.prev-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 16px;
}
.prev-link {
  font-weight: 800; font-size: 24px;
  line-height: 1.15; letter-spacing: -0.03em; color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center; gap: 16px;
  transition: color 0.2s;
}
.prev-link:hover { color: var(--accent); }
.prev-arrow {
  font-size: 24px; color: var(--faint);
  transition: transform 0.2s, color 0.2s; display: inline-block;
}
.prev-link:hover .prev-arrow { transform: translate(4px,-4px); color: var(--accent); }

.prev-project--split {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
}
.prev-project-col--next { text-align: right; }
.prev-project-col--next .prev-link { justify-content: flex-end; }

/* ── FOOTER ───────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--rule); padding: 36px 120px;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-name {
  font-weight: 700; font-size: 15px; color: var(--ink);
}
.footer-links { display: flex; gap: 32px; }
.footer-links a {
  position: relative;
  font-weight: 500;
  font-size: 13px; color: var(--muted); text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.footer-links a::after {
  content: ""; position: absolute; left: 0; bottom: -3px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-fast) var(--ease);
}
.footer-links a:hover { color: var(--ink); }
.footer-links a:hover::after { transform: scaleX(1); }

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 0 20px; height: 64px; }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
  }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-overlay {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(22, 21, 15, 0.4);
    z-index: 55;
  }
  .nav-overlay.is-open { display: block; }

  .nav-links {
    display: flex;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    padding: 0 20px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 60;
    --menu-dur: 0.7s;
    --menu-dur-fast: 0.4s;
    transition: max-height var(--menu-dur) var(--ease), opacity var(--menu-dur-fast) var(--ease),
      padding var(--menu-dur) var(--ease), border-color var(--menu-dur-fast) var(--ease),
      box-shadow var(--menu-dur-fast) var(--ease);
  }
  .nav-links.is-open {
    max-height: 400px;
    opacity: 1;
    pointer-events: auto;
    padding: 8px 20px 16px;
    border-bottom-color: var(--rule);
    box-shadow: 0 12px 24px rgba(22, 21, 15, 0.08);
  }
  .nav-links a {
    padding: 16px 0;
    border-bottom: 1px solid var(--rule);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--menu-dur-fast) var(--ease), transform var(--menu-dur-fast) var(--ease);
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links.is-open a {
    opacity: 1;
    transform: none;
  }
  .nav-links.is-open a:nth-child(1) { transition-delay: 0.08s; }
  .nav-links.is-open a:nth-child(2) { transition-delay: 0.16s; }
  .nav-links.is-open a:nth-child(3) { transition-delay: 0.24s; }
  .nav-links.is-open a:nth-child(4) { transition-delay: 0.32s; }

  .hero { padding: 40px 20px 0; }
  .hero-title { font-size: 32px; max-width: 100%; }

  .hero-screen { padding: 0 20px; }

  .meta-strip { grid-template-columns: 1fr 1fr; border-radius: 12px; }
  .meta-item { border-bottom: 1px solid var(--rule); }
  .meta-item:nth-child(2n) { border-right: none; }
  .meta-item:nth-last-child(-n+2) { border-bottom: none; }

  .content { padding: 0 20px; }

  .section-label { padding: 48px 0 32px; }

  .two-col { grid-template-columns: 1fr; gap: 12px; margin-bottom: 32px; }
  .two-col--spaced { margin-top: 40px; }
  .col-body h2 { font-size: 24px; }

  .outcomes { grid-template-columns: 1fr; border-radius: 12px; }
  .outcome-card { padding: 24px 20px; border-right: none; border-bottom: 1px solid var(--rule); }
  .outcome-card:last-child { border-bottom: none; }

  .steps { grid-template-columns: 1fr 1fr; border-radius: 12px; }
  .step { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .step:nth-child(2n) { border-right: none; }

  .card-grid-2, .card-grid-3 { grid-template-columns: 1fr; border-radius: 12px; }
  .card { padding: 24px 20px; border-right: none; border-bottom: 1px solid var(--rule); }
  .card:last-child { border-bottom: none; }

  .sticky-board { grid-template-columns: 1fr; padding: 40px 20px 28px; gap: 44px; border-radius: 12px; }
  .sticky-note { transform: rotate(-1deg) !important; }

  .two-up .img-block, .three-up .img-block { max-width: 100%; }

  .prev-project--split { flex-direction: column; gap: 32px; }
  .prev-project-col--next { text-align: left; }
  .prev-project-col--next .prev-link { justify-content: flex-start; }
  .prev-link { font-size: 20px; }

  footer { padding: 28px 20px; flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-links { flex-direction: column; align-items: flex-start; gap: 12px; }
}
