/* ============================================================
   Case Study — Shared Design System
   Maria Baida · Portfolio
   ============================================================ */

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

:root {
  --ink:    #0A0A0A;
  --muted:  #666666;
  --accent: #1A4EE8;
  --rule:   #E0E0E0;
  --bg:     #F5F7FF;

  /* 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(8px);
    transition: opacity var(--dur) var(--ease),
                transform var(--dur) var(--ease);
    will-change: opacity, transform;
  }
  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ── 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: 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;
    scroll-behavior: auto !important;
  }
}

body {
  background: #fff;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ──────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--rule);
  padding: 0 120px; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: 'Fraunces', serif; font-weight: 300; font-size: 15px;
  color: var(--ink); text-decoration: none;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  position: relative;
  font-family: 'DM Sans', sans-serif;
  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::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-fast) var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

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

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  max-width: 1200px; margin: 0 auto;
  padding: 80px 120px 0;
}
.hero-label {
  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 {
  font-family: 'Fraunces', serif; font-weight: 300;
  font-size: 58px; line-height: 1.06; letter-spacing: -0.02em;
  max-width: 820px; margin-bottom: 40px;
}
.hero-title em { font-style: normal; }

/* ── META STRIP ───────────────────────────────────────────── */
.meta-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--rule);
  border: 1px solid var(--rule);
}
.meta-item { background: #fff; padding: 24px 28px; }
/* ── 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);
}

.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: #F0F0F0;
  border-radius: 4px;
  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: #AAAAAA;
}
.screen-sublabel { font-size: 12px; color: #BBBBBB; }
.img-caption { font-size: 12px; color: var(--muted); margin-top: 12px; }
.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: 100%; height: auto;
  border: 1px solid var(--rule);
}
.video-embed {
  position: relative; width: 100%; padding-top: 56.25%;
  overflow: hidden; background: #000; border: 1px solid var(--rule);
}
.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-family: 'Fraunces', serif; font-weight: 300;
  font-size: 30px; line-height: 1.25; 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(--muted);
  margin-bottom: 16px;
}
.col-body p:last-child { margin-bottom: 0; }
.col-body p strong { color: var(--ink); font-weight: 500; }

/* ── CALLOUT ──────────────────────────────────────────────── */
.callout {
  border-left: 2px solid var(--accent);
  padding: 20px 28px; margin: 28px 0;
  background: var(--bg);
}
.callout p {
  font-family: 'Fraunces', serif; font-weight: 300;
  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: 2px; background: var(--rule); margin-bottom: 0;
}
.outcome-card { background: #fff; padding: 40px 36px; }
.outcome-num {
  font-family: 'Fraunces', serif; font-weight: 300;
  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(--muted); }
.outcome-desc strong {
  color: var(--ink); font-weight: 500;
  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;
}

/* ── 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(--muted);
}
.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: 500; }

/* ── PROCESS STEPS ────────────────────────────────────────── */
.steps {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; border: 1px solid var(--rule);
  margin: 40px 0;
}
.step { padding: 28px 24px; 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(--muted); line-height: 1.55; }

/* ── CARD GRIDS ───────────────────────────────────────────── */
.card-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2px; background: var(--rule); margin: 40px 0;
}
.card-grid-3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 2px; background: var(--rule); margin: 40px 0;
}
.card { background: #fff; padding: 32px 36px; }
.card-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.card-title {
  font-family: 'Fraunces', serif; font-weight: 300;
  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(--muted); }
.card-body strong { color: var(--ink); font-weight: 500; }
.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; }

/* ── IMAGE GRIDS ──────────────────────────────────────────── */
.two-up   { display: grid; grid-template-columns: 1fr 1fr;       gap: 16px; margin: 40px 0; }
.three-up { display: grid; grid-template-columns: 1fr 1fr 1fr;   gap: 16px; margin: 40px 0; }

/* ── 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-family: 'Fraunces', serif; font-weight: 300; 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(--rule);
  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-family: 'Fraunces', serif;
  font-weight: 300; font-size: 15px; color: var(--ink);
}
.footer-links { display: flex; gap: 32px; }
.footer-links a {
  position: relative;
  font-family: 'DM Sans', sans-serif; font-weight: 400;
  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(10, 10, 10, 0.4);
    z-index: 55;
  }
  .nav-overlay.is-open { display: block; }

  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid var(--rule);
    padding: 8px 20px 16px;
    box-shadow: 0 12px 24px rgba(10, 10, 10, 0.08);
    z-index: 60;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 16px 0; border-bottom: 1px solid var(--rule); }
  .nav-links a:last-child { border-bottom: none; }

  .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; }

  .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; }
  .outcome-card { padding: 28px 24px; }

  .steps { grid-template-columns: 1fr 1fr; }
  .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; }
  .card { padding: 24px 20px; }

  .two-up, .three-up { grid-template-columns: 1fr; }

  .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; }
}
