/* ==========================================================================
   megandreisbach.com — site.css
   Case template styles. Built fresh for case.html (does NOT use the old
   styles.css / tab.css / main.js).

   Design system (from SPEC.md):
   - Fonts (Google Fonts):
       Newsreader (reg+ital) → headlines, case titles, beauty mark lines,
                           pull quotes (locked Nov 17, replaces Instrument Serif)
       Inter 400/500     → body, nav, labels, captions
   - Colors:
       Cream      #F3ECE0  background
       Deep olive #3B3F24  type, accents, dark sections
       Ink        #1A1A17  the dot only, nothing else
   ========================================================================== */

/* ---------- Design tokens (colors + fonts) ------------------------------ */
:root {
  /* Colors */
  --cream: #f3ece0;
  --olive: #3b3f24;
  --ink: #1a1a17;

  /* Fonts */
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Derived + layout */
  --hairline: color-mix(in srgb, var(--olive) 22%, transparent);
  --measure: 34rem; /* comfortable reading width */
  --page-max: 82rem; /* outer content width */
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --section-gap: clamp(3.5rem, 8vw, 7.5rem);
  --label: 0.72rem; /* 11–12px uppercase labels */
  --sys-height: clamp(220px, 32vw, 380px); /* shared height of system strip */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset-ish ---------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--olive);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
video {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}

/* Shared label treatment (Inter, uppercase, 0.14em) */
.label,
.case-intro__category,
.site-header__contact,
.case-quote__kicker,
.case-next__kicker,
  .case-meta dt {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* All headlines balance their line breaks (SPEC: Newsreader headlines) */
.case-intro__title,
.case-idea__text,
.case-quote__line,
.case-next__title,
.site-footer__wordmark {
  text-wrap: balance;
}

/* ---------- Skip link ---------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--olive);
  color: var(--cream);
  padding: 0.6rem 1rem;
  border-radius: 0 0 0.4rem 0;
  font-size: 0.9rem;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Header + wordmark -------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
}
.site-header__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0.9rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Wordmark: "MEGAN DREISBACH" only, Inter 11px caps, 0.14em, 75% opacity.
   No "Meg" mark, no signature, no handwriting. The only uppercase on home. */
.wordmark {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--olive);
  opacity: 0.75;
}

.site-header__contact {
  color: var(--olive);
  text-decoration: none;
  opacity: 0.8;
}
.site-header__contact:hover {
  opacity: 1;
}

/* ---------- Main scaffold ------------------------------------------------ */
.case {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--section-gap);
}
.case-status {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  padding: 25vh var(--gutter);
  text-align: center;
}
.case-status a {
  color: var(--olive);
}

.case > section,
.case > header,
.case > .case-next {
  margin-top: var(--section-gap);
}
.case > .case-hero {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

/* ---------- 1. Hero + beauty mark dot ------------------------------------ */
.case-hero {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.case-hero__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--cream);
}
.case-hero__media img,
.case-hero__media video,
.case-hero__media .ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Motion 1: hero settles from 106% to 100% */
.case-hero__media img,
.case-hero__media video {
  animation: hero-settle 2.4s var(--ease) both;
}
@keyframes hero-settle {
  from {
    transform: scale(1.06);
  }
  to {
    transform: scale(1);
  }
}
@media (max-width: 768px) {
  .case-hero__media {
    aspect-ratio: 3 / 4;
  }
}

/* The dot (ink on cream/light imagery) */
.dot {
  --dot-size: 18px;
  display: inline-block;
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  background: var(--ink);
  border: 0;
  padding: 0;
}
.dot--hero {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  cursor: pointer;
  --dot-size: clamp(16px, 1.4vw, 22px);
  /* Motion 4: dot pops in at 0.7s */
  animation: dot-pop 0.5s var(--ease) 0.7s both;
}
.dot--hero::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cream) 55%, transparent);
  opacity: 0.6;
}
@keyframes dot-pop {
  from {
    transform: translate(-50%, -50%) scale(0);
  }
  60% {
    transform: translate(-50%, -50%) scale(1.15);
  }
  to {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* The revealed line: "The beauty mark: [line]" */
.dot__label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  transform: translate(-50%, 6px);
  width: max-content;
  max-width: min(74vw, 22rem);
  background: var(--olive);
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.35;
  text-align: left;
  padding: 0.55rem 0.85rem;
  border-radius: 0.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.dot__label::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--olive);
}
.dot--hero:hover .dot__label,
.dot--hero:focus-visible .dot__label,
.dot--hero.is-open .dot__label {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ---------- 2. Title, category, meta ------------------------------------ */
.case-intro {
  max-width: 60rem;
}
.case-intro__category {
  margin: 0 0 0.75rem;
  color: var(--olive);
  opacity: 0.75;
}
.case-intro__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 1.4rem + 3.8vw, 5rem);
  line-height: 1.02;
  margin: 0;
}
.tag-spec {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--olive);
  border: 1px solid var(--olive);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
}
.case-meta {
  margin: 2.25rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.5rem 2rem;
  border-top: 1px solid var(--hairline);
  padding-top: 1.75rem;
}
.case-meta div {
  margin: 0;
}
.case-meta dt {
  opacity: 0.65;
  margin-bottom: 0.35rem;
}
.case-meta dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

/* ---------- 3. The idea + role line -------------------------------------- */
.case-idea {
  max-width: var(--measure);
}
.case-idea__text {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 1.2rem + 1.3vw, 2.4rem);
  line-height: 1.28;
  margin: 0;
}
.case-idea__role {
  margin: 1.5rem 0 0;
  font-size: 0.95rem;
  opacity: 0.8;
}

/* ---------- 4. Pull quote: "The beauty mark" ----------------------------- */
.case-quote {
  margin-inline: 0;
  max-width: 54rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: clamp(2rem, 5vw, 3.5rem) 0;
}
.case-quote__kicker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
  opacity: 0.75;
}
.case-quote__kicker::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  flex: none;
}
.case-quote__line {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.4rem);
  line-height: 1.14;
  margin: 0;
}

/* ---------- 5. Film (Vimeo, or "Film coming soon." placeholder) ---------- */
.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--cream);
  border-radius: 2px;
  overflow: hidden;
}
.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.embed .ph {
  position: absolute;
  inset: 0;
}

/* ---------- 6. The system strip: own aspect ratios, equal height --------- */
/* Images sit side by side at a shared height, each at its natural aspect
   ratio with NO cropping. If the row is wider than the page it scrolls
   horizontally rather than cropping. On phone they stack. */
.case-system__strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: clamp(0.75rem, 1.6vw, 1.5rem);
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.sys-item {
  flex: 0 0 auto;
  height: var(--sys-height);
}
.sys-item > img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain; /* no cropping */
  border-radius: 2px;
}
/* Missing system image → cream box, same height, default shape */
.sys-item > .ph {
  height: 100%;
  aspect-ratio: 4 / 5;
}
.case-system__caption {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.75;
}
@media (max-width: 768px) {
  .case-system__strip {
    flex-direction: column;
    overflow-x: visible;
  }
  .sys-item {
    height: auto;
    width: 100%;
  }
  .sys-item > img {
    width: 100%;
    height: auto;
  }
  .sys-item > .ph {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }
}

/* ---------- 7. The work: editorial grid (6) ------------------------------ */
.case-work__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.75rem, 1.6vw, 1.5rem);
}
.case-work__item {
  margin: 0;
  grid-column: span 3;
  aspect-ratio: 4 / 5;
}
.case-work__item:nth-child(1) {
  grid-column: span 6;
  aspect-ratio: 16 / 9;
}
.case-work__item:nth-child(4) {
  grid-column: span 2;
  aspect-ratio: 3 / 4;
}
.case-work__item:nth-child(5) {
  grid-column: span 4;
  aspect-ratio: 16 / 10;
}
.case-work__item:nth-child(6) {
  grid-column: span 6;
  aspect-ratio: 16 / 9;
}
/* Vimeo work tiles: vertical 9:16, same width as their grid cell */
.case-work__item.case-work__item--vertical {
  aspect-ratio: 9 / 16;
}
.case-work__item iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .case-work__item,
  .case-work__item:nth-child(n) {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 5;
  }
  .case-work__item.case-work__item--vertical {
    aspect-ratio: 9 / 16;
  }
}

/* ---------- Shared media + missing-file placeholder ---------------------- */
.media {
  position: relative;
  overflow: hidden;
  background: var(--cream);
  border-radius: 2px;
}
.media img,
.media video,
.media .ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Cream box shown when an image OR video file is missing */
.ph {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--cream);
  border: 1px solid var(--hairline);
}
.ph__label {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: center;
  color: color-mix(in srgb, var(--olive) 85%, transparent);
  max-width: 90%;
}

/* ---------- 8. Credits + recognition ------------------------------------- */
.case-credits {
  max-width: 56rem;
  border-top: 1px solid var(--hairline);
  padding-top: 1.75rem;
}
.case-credits__line,
.case-credits__recognition {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.85;
}
.case-credits__recognition {
  margin-top: 1rem;
}
.case-credits__recognition strong {
  font-weight: 500;
}

/* ---------- 9. Next project (with the dot) ------------------------------- */
.case-next {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--olive);
  border-top: 1px solid var(--hairline);
  padding-top: 1.75rem;
}
.case-next__group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.case-next__kicker {
  opacity: 0.7;
}
.case-next__title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem);
  line-height: 1.08;
}
.case-next .dot--next {
  --dot-size: 14px;
  margin-left: auto;
  transition: transform 0.3s var(--ease);
}
.case-next:hover .dot--next {
  transform: translateX(6px) scale(1.15);
}
.case-next:hover .case-next__title {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* ---------- Footer (Pages, item 4) --------------------------------------- */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0;
  padding: 18px;
  border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  background: var(--cream);
  color: var(--olive);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.4;
}
.site-footer p { margin: 0; }
.site-footer__links,
.site-footer__place { color: color-mix(in srgb, currentColor 80%, transparent); }
.site-footer a {
  color: inherit;
  font-size: 12px;
  text-decoration: none;
}
.theme-olive .site-footer {
  background: var(--olive);
  color: var(--cream);
}
@media (min-width: 768px) {
  .site-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    padding: 18px 32px;
  }
}

/* ---------- Motion 5: sections fade up on scroll ------------------------- */
.fade {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.fade.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .fade {
    opacity: 1;
    transform: none;
  }
}

/* Mobile tap targets (Nov 25): bigger invisible hit areas, no visual change. */
@media (max-width: 760px) {
  .wordmark, .menu-toggle, .site-footer a { position: relative; }
  .wordmark::after, .menu-toggle::after, .menu__close::after {
    content: ""; position: absolute; inset: -14px -10px;
  }
  .site-footer a::after { content: ""; position: absolute; inset: -14px -4px; }
}
