/* =====================================================================
   styles.css
   ---------------------------------------------------------------------
   Shared styles used on every page of the portfolio.
   case-study.css extends this file with case-study-specific rules.

   Contents:
     1. Design tokens (palette, radii, fonts)
     2. Base / reset
     3. Page wrapper + nav
     4. Homepage hero (status pill, title, subtitle)
     5. Generic sections + work card grid (index.html only)
     6. About / quote / services list (index.html only)
     7. Footer
     8. Custom cursor
     9. Hero title word reveal
    10. Scroll reveal + stagger helpers
    11. Card 3D tilt helpers
    12. Marquee strip
    13. Reduced-motion overrides
    14. Responsive
   ===================================================================== */


/* ---------------------------------------------------------------------
   1a. Monzo Sans (private typeface)
   These files are kept locally and excluded from git — see .gitignore.
   If the folder is missing, each stack falls back to DM Sans cleanly.
   --------------------------------------------------------------------- */

/* Display family — used for headings, hero titles, big numbers */
@font-face {
  font-family: "Monzo Sans Display";
  src: url("Monzo%20Sans%20%28restricted%20license%29/WOFF2/MonzoSansDisplay-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Monzo Sans Display";
  src: url("Monzo%20Sans%20%28restricted%20license%29/WOFF2/MonzoSansDisplay-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Monzo Sans Display";
  src: url("Monzo%20Sans%20%28restricted%20license%29/WOFF2/MonzoSansDisplay-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Monzo Sans Display";
  src: url("Monzo%20Sans%20%28restricted%20license%29/WOFF2/MonzoSansDisplay-MediumItalic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Monzo Sans Display";
  src: url("Monzo%20Sans%20%28restricted%20license%29/WOFF2/MonzoSansDisplay-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Monzo Sans Display";
  src: url("Monzo%20Sans%20%28restricted%20license%29/WOFF2/MonzoSansDisplay-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Text family — used for body, labels, UI chrome */
@font-face {
  font-family: "Monzo Sans Text";
  src: url("Monzo%20Sans%20%28restricted%20license%29/WOFF2/MonzoSansText-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Monzo Sans Text";
  src: url("Monzo%20Sans%20%28restricted%20license%29/WOFF2/MonzoSansText-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Monzo Sans Text";
  src: url("Monzo%20Sans%20%28restricted%20license%29/WOFF2/MonzoSansText-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Monzo Sans Text";
  src: url("Monzo%20Sans%20%28restricted%20license%29/WOFF2/MonzoSansText-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Monzo Sans Text";
  src: url("Monzo%20Sans%20%28restricted%20license%29/WOFF2/MonzoSansText-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* ---------------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------------- */
:root {
  /* Laura: soft paper, lavender and a single dark drawing ink. */
  --bg: #faf9f6;
  --bg-raised: #f0edf4;
  --surface: #ffffff;
  --ink: #27232c;
  --ink-soft: #514b59;
  --ink-muted: #726b7a;
  --line: rgba(39, 35, 44, .12);
  --accent: #69488f;
  --accent-rgb: 105, 72, 143;
  --lavender: #d5c9ed;
  --lavender-soft: #ece6f5;
  --lavender-mid: #b49bd3;
  --ink-block: #332b3e;

  --radius-lg: 28px;
  --radius-md: 18px;

  /* The portfolio has its own type; product mockups retain their brand fonts. */
  --font-display: "DM Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --font-heading: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-body:    "DM Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --font-mono:    "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------------------------------------------------------------------
   2. Base / reset
   --------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}
@media (hover: hover) and (pointer: fine) {
  body.cursor-ready,
  body.cursor-ready a,
  body.cursor-ready button {
    cursor: none;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

.link {
  color: var(--accent);
  font-weight: 500;
}

/* ---------------------------------------------------------------------
   3. Page wrapper + nav
   --------------------------------------------------------------------- */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 32px 96px;
}


.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 56px;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
}
.nav-links a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------------
   4. Homepage hero
   --------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: center;
  gap: 32px;
  padding: 48px 0 96px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--lavender-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 34px;
}
.status-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .15);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 6.2vw, 82px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 32px;
}
.hero-accent {
  color: var(--accent);
  font-style: italic;
}
.hero-sub {
  margin-bottom: 0;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 640px;
}

/* ---------------------------------------------------------------------
   5. Generic sections + work card grid
   --------------------------------------------------------------------- */
section {
  padding: 64px 0;
  border-top: 1px solid var(--line);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 40px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.025em;
  margin: 0;
}
.mono-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* --- Work card grid --- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 12px;
  transition: transform 240ms ease, box-shadow 240ms ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -28px rgba(39, 35, 44, .25);
}
.card-lg {
  grid-column: span 1;
}
.card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.card-lg .card-media {
  aspect-ratio: 4 / 3;
}
.media-lilac { background: var(--lavender); }
.media-mist { background: var(--lavender-soft); }
.media-paper { background: var(--bg-raised); }
.media-deep { background: var(--ink-block); }
.card-meta {
  padding: 6px 10px 12px;
}
.card-meta .mono-label {
  display: block;
  margin-bottom: 10px;
}
.card-meta h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.2;
}
.card-meta p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
}

/* ---------------------------------------------------------------------
   6. About / quote / services
   --------------------------------------------------------------------- */
.about-lead {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 900px;
  margin: 0;
}

/* --- Testimonial quote --- */
.quote blockquote {
  margin: 0;
  max-width: 820px;
}
.quote p {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  margin: 0 0 24px;
}
.quote footer {
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-muted);
}
.quote-name {
  color: var(--ink);
  font-weight: 500;
}
.quote-role::before {
  content: "·";
  margin-right: 8px;
}

/* --- Services list --- */
.services-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.services-list li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.services-list li:last-child {
  border-bottom: 1px solid var(--line);
}
.service-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-muted);
  padding-top: 6px;
}
.services-list h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}
.services-list p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 16px;
}

/* ---------------------------------------------------------------------
   7. Footer
   --------------------------------------------------------------------- */
.footer {
  border: 0;
  border-radius: 28px;
  padding: clamp(28px, 4vw, 56px);
  margin-top: 64px;
  background: var(--lavender);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.footer-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 72px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
  max-width: 800px;
}
.footer-email {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(20px, 2vw, 28px);
  color: var(--accent);
  letter-spacing: -0.015em;
}
.footer-email:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.footer .mono-label { color: var(--ink-soft); }
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------
   8. Custom cursor (ring + dot — logic lives in script.js)
   --------------------------------------------------------------------- */
.cursor,
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform, width, height;
}
.cursor {
  width: 36px;
  height: 36px;
  border: 1px solid var(--ink);
  mix-blend-mode: difference;
  transition: width 280ms ease, height 280ms ease, border-color 280ms ease,
    background 280ms ease;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
}
.cursor.is-hover {
  width: 68px;
  height: 68px;
  background: var(--accent);
  border-color: var(--accent);
}
.cursor.is-down {
  width: 24px;
  height: 24px;
}
@media (hover: none), (pointer: coarse) {
  .cursor,
  .cursor-dot {
    display: none;
  }
}

/* ---------------------------------------------------------------------
   9. Hero title word reveal
   Each word is wrapped in <span class="word"><span>word</span></span>.
   The outer clips; the inner translates up once .is-in is added.
   --------------------------------------------------------------------- */
.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0.05em 0.1em 0.2em;
  margin: -0.05em -0.1em -0.2em;
}
.word > span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 900ms ease;
  transition-delay: var(--delay, 0ms);
}
.word.is-in > span {
  transform: translateY(0);
  opacity: 1;
}

/* ---------------------------------------------------------------------
   10. Scroll reveal helpers
   Any [data-reveal] element fades in + slides up when it scrolls into
   view. [data-stagger] groups stagger their children using --i.
   --------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 900ms ease, transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}
[data-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
[data-stagger].is-in > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------------------
   11. Card 3D tilt
   Rotation is applied inline by script.js; the media and meta layers
   float forward on Z when .is-tilting is present.
   --------------------------------------------------------------------- */
[data-tilt] {
  transform-style: preserve-3d;
  transition: transform 180ms ease;
}
[data-tilt] .card-media,
[data-tilt] .card-meta {
  transition: transform 180ms ease;
  transform: translateZ(0);
}
[data-tilt].is-tilting .card-media {
  transform: translateZ(30px);
}
[data-tilt].is-tilting .card-meta {
  transform: translateZ(14px);
}

/* ---------------------------------------------------------------------
   12. Marquee strip (infinite horizontal scroll)
   --------------------------------------------------------------------- */
.marquee {
  overflow: hidden;
  padding: 22px 0;
  border-radius: 18px;
  margin: 8px 0 32px;
  background: var(--lavender);
  transform: rotate(-1deg);
}
.marquee-track {
  display: flex;
  gap: 36px;
  width: max-content;
  animation: marquee 32s linear infinite;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}
.marquee-track span:nth-child(even) {
  color: var(--accent);
}
@keyframes marquee {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* ---------------------------------------------------------------------
   13. Reduced-motion overrides
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
  }
  [data-reveal],
  [data-stagger] > *,
  .word > span {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------------------
   14. Responsive
   --------------------------------------------------------------------- */
@media (max-width: 720px) {
  .page {
    padding: 20px 20px 64px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .card-lg {
    grid-column: auto;
  }
  .nav-links {
    gap: 18px;
  }
  .services-list li {
    grid-template-columns: 56px 1fr;
    gap: 16px;
  }
}


/* Small elastic flower signature. The fixed button is its stable hit area. */
.nav-signature { display: flex; align-items: center; gap: 7px; }
.signature-flower {
  position: relative; width: 58px; height: 58px; flex: 0 0 58px; padding: 0;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--ink); touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.signature-flower svg { display: block; width: 100%; height: 100%; overflow: visible; }
.signature-flower:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.signature-flower, .signature-flower * { cursor: none !important; }
body:has(.signature-flower:hover) .cursor { opacity: 0; }
@media (max-width: 420px) {
  .nav-signature { gap: 3px; }
  .signature-flower { width: 52px; height: 52px; flex-basis: 52px; }
  .nav-links { gap: 12px; }
}

/* The same illustrated flower signs the navigation and the hero. */
.signature-flower { --doodle-fill: var(--lavender); }
.signature-flower:is(:hover, :focus-visible, :active) { --doodle-fill: var(--lavender-mid); }
.signature-flower .flower-art { transition: filter 260ms ease; }
.signature-flower:is(:hover, :focus-visible) .flower-art { filter: saturate(1.25); }
@media (prefers-reduced-motion: reduce) {
  .signature-flower .flower-art { transition: none; }
}

/* Hand-drawn marker capitals: broad strokes, open spacing, uneven contours. */
.nav-signature .nav-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 44px;
  color: var(--ink);
}
.nav-wordmark { display: block; width: 108px; height: auto; }
.nav-signature .nav-logo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}
@media (max-width: 420px) {
  .nav-wordmark { width: 90px; }
}
@media (max-width: 360px) {
  .nav-wordmark { width: 75px; }
}

/* A loose ink-drawing composition beside the introduction. */
.hero-copy { min-width: 0; }
.hero-doodles { width: 100%; color: var(--ink); }
.hero-doodles > svg { display: block; width: 100%; height: auto; overflow: visible; }
.doodle-paper { fill: var(--bg); }
.doodle-accent { color: var(--accent); }
.doodle-blush { fill: var(--accent); stroke: none; opacity: .22; }
.doodle-flower-body, .doodle-hand-body, .doodle-chat-body {
  transform-box: fill-box;
  transform-origin: 50% 70%;
  transition: transform 600ms cubic-bezier(.2,.8,.2,1);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hero-doodles:hover .doodle-hand-body { transform: rotate(-9deg); }
  .hero-doodles:hover .doodle-flower-body { transform: rotate(4deg); }
  .hero-doodles:hover .doodle-chat-body { transform: translateY(-4px) rotate(4deg); }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .hero { grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; }
  .hero .hero-title { font-size: clamp(48px, 6.5vw, 65px); }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 28px 0 56px; }
  .hero .hero-title { font-size: clamp(45px, 8.3vw, 62px); }
  .hero .status { font-size: 10px; gap: 9px; padding: 8px 12px; margin-bottom: 28px; }
  .hero-doodles { width: min(260px, 75%); justify-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .doodle-flower-body, .doodle-hand-body, .doodle-chat-body { transition: none; }
}

/* Decorative visitors never receive pointer or keyboard input. */
.doodle-pop {
  position: fixed; z-index: 20; pointer-events: none; user-select: none;
  object-fit: contain; opacity: 0; transform-origin: 50% 80%;
  animation: doodle-visit 1900ms ease both;
}
@keyframes doodle-visit {
  0% { opacity: 0; transform: translateY(12px) scale(.72) rotate(calc(var(--doodle-angle) - 8deg)); }
  16% { opacity: 1; transform: translateY(-3px) scale(1.04) rotate(var(--doodle-angle)); }
  28%, 73% { opacity: 1; transform: translateY(0) scale(1) rotate(var(--doodle-angle)); }
  100% { opacity: 0; transform: translateY(-9px) scale(.96) rotate(calc(var(--doodle-angle) + 4deg)); }
}
@media (prefers-reduced-motion: reduce) {
  .doodle-pop { animation: none; opacity: 1; transform: none; }
}

/* Shared identity and a clearer hierarchy for the work. */
::selection { background: var(--lavender); color: var(--ink); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.nav-logo-back { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; }
.nav-logo-back .nav-wordmark { width: 90px; }
.card-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
.card-featured .card-media { aspect-ratio: 4 / 3; margin: 0; min-height: 340px; }
.card-featured .card-meta { align-self: center; padding: 24px 24px 24px 0; }
.card-featured .card-meta h3 { font-size: clamp(24px, 2.5vw, 32px); }
.card-media.cover-phones { display: flex; justify-content: center; gap: 5%; align-items: flex-start; }
.cover-phones img { display: block; width: 35%; height: auto; margin-top: 28px; border-radius: 18px; box-shadow: 0 12px 30px #27232c24; transform: rotate(-4deg); }
.cover-phones img:nth-child(2) { margin-top: 58px; transform: rotate(4deg); }
.cover-single img { width: 47%; }
.cover-diagram, .cover-photo, .cover-doodle { display: grid; place-items: center; }
.cover-diagram img { width: 92%; height: 90%; object-fit: contain; }
.cover-photo img { width: 100%; height: 100%; object-fit: cover; }
.cover-doodle img { width: 40%; height: 66%; object-fit: contain; }
.cover-research { padding: 24px; }
.cover-research img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.quote { background: var(--lavender-soft); border: 0; border-radius: 24px; padding: 40px; margin: 32px 0; }
@media (max-width: 760px) {
  .card-featured { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .card-featured .card-media { min-height: 0; }
  .card-featured .card-meta { padding: 16px 10px; }
  .quote { padding: 28px; }
  .marquee { padding: 18px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html, body { scroll-behavior: auto; }
}

@media (max-width: 600px) {
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 24px; }
  .section-head .mono-label { white-space: nowrap; }
}
