/* ============================================================
   marycrimmins.org
   One stylesheet for every page.
   ============================================================ */

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

:root {
  --bg:              #F2F2F0;
  --bg-surface:      #E8E8E6;
  --bg-dark:         #3D3D3B;
  --border:          rgba(0,0,0,0.08);

  --text-primary:    #3D3D3B;
  --text-secondary:  #6A6A68;
  --text-muted:      #9A9A98;

  --accent:          #2D4A42;
  --accent-mid:      #7AA99A;
  --accent-soft:     #C8DDD5;
  --divider:         #C8DDD5;

  --heading-font:    'Cormorant Garamond', serif;
  --body-font:       'DM Sans', sans-serif;

  --page-max:        1200px;
  --gutter:          60px;
  --transition:      0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  font-family: var(--body-font);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }

::selection { background: var(--accent-soft); color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff;
  padding: 12px 20px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
}
.skip-link:focus { left: 0; }

/* ---------- NAV ---------------------------------------------------------- */

/* Scoped to #navbar deliberately. A bare `nav` selector also caught the
   bottom-of-case-study nav and pinned it to the top of the viewport. */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
#navbar.scrolled {
  border-color: var(--divider);
  background: rgba(242,242,240,0.95);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.nav-logo {
  font-family: var(--heading-font); font-size: 20px; font-weight: 400;
  letter-spacing: 0.04em; color: var(--text-primary); text-decoration: none;
}
.nav-links { display: flex; gap: 36px; list-style: none; align-items: center; }
.nav-links a {
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text-primary); }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 8px; margin: -8px;
}
.nav-toggle span {
  display: block; width: 22px; height: 1.5px; background: var(--text-primary);
  transition: transform 0.3s, opacity 0.2s;
}
.nav-toggle span + span { margin-top: 5px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- LAYOUT ------------------------------------------------------- */

main { padding-top: 76px; }

.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 90px 0; }
.section-tight { padding: 48px 0 90px; }

.section-header {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 24px; margin-bottom: 3rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--divider);
}
.section-title {
  font-family: var(--heading-font);
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; line-height: 1.1;
}
.section-title em { font-style: italic; color: var(--accent); }

.eyebrow {
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent-mid);
}

.lede {
  font-size: 17px; font-weight: 300; line-height: 1.75;
  color: var(--text-secondary); max-width: 62ch;
}

/* ---------- BUTTONS ------------------------------------------------------ */

.btn-primary {
  display: inline-block; padding: 14px 32px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; border-radius: 50px;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.btn-primary:hover { background: var(--accent-mid); color: #fff; transform: translateY(-1px); }

.btn-secondary {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none;
  border-bottom: 1px solid var(--divider); padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--text-primary); }

/* ---------- HERO --------------------------------------------------------- */

.hero {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  gap: 80px; max-width: var(--page-max); margin: 0 auto;
  padding: 90px var(--gutter) 80px;
}
.hero-text { max-width: 540px; }
.hero-eyebrow { margin-bottom: 24px; opacity: 0; animation: fadeUp 0.8s ease forwards 0.2s; }
.hero-name {
  font-family: var(--heading-font);
  font-size: clamp(52px, 6vw, 80px); font-weight: 300;
  line-height: 1.05; letter-spacing: -0.01em; margin-bottom: 12px;
  opacity: 0; animation: fadeUp 0.8s ease forwards 0.4s;
}
.hero-name em { font-style: italic; color: var(--accent); }
.hero-title {
  font-family: var(--heading-font);
  font-size: clamp(20px, 2.5vw, 28px); font-weight: 300;
  color: var(--text-secondary); margin-bottom: 32px;
  opacity: 0; animation: fadeUp 0.8s ease forwards 0.6s;
}
.hero-bio {
  font-size: 15px; font-weight: 300; line-height: 1.8;
  color: var(--text-secondary); max-width: 440px; margin-bottom: 48px;
  opacity: 0; animation: fadeUp 0.8s ease forwards 0.8s;
}
.hero-cta {
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  opacity: 0; animation: fadeUp 0.8s ease forwards 1s;
}
.hero-image-wrap {
  display: flex; justify-content: center;
  opacity: 0; animation: fadeIn 1s ease forwards 0.6s;
}
.hero-image-blob {
  width: 380px; height: 460px; position: relative; overflow: hidden;
  background: var(--accent-soft);
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
}
.hero-image-blob img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- PAGE HEAD (section + case study pages) ----------------------- */

.page-head { padding: 70px 0 0; }
.page-head h1 {
  font-family: var(--heading-font);
  font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 300;
  line-height: 1.05; margin: 16px 0 24px;
}
.page-head h1 em { font-style: italic; color: var(--accent); }

/* ---------- FILTER CHIPS ------------------------------------------------- */

.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 0 0 40px; padding-bottom: 28px;
  border-bottom: 1px solid var(--divider);
}
.chip {
  background: none; cursor: pointer;
  border: 1px solid var(--divider); border-radius: 50px;
  padding: 9px 22px; font-family: var(--body-font);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip:hover { color: var(--text-primary); border-color: var(--accent-mid); }
.chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--bg);
}

/* ---------- PROJECT GRID ------------------------------------------------- */

.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.project-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* A section with a single project reads as a feature, not a lonely grid cell. */
.project-grid.cols-1 { grid-template-columns: 1fr; }
.project-grid.cols-1 .project-card { aspect-ratio: 16 / 7; }
.project-grid.cols-1 .project-card img { object-position: center; }

.project-card {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  display: block; text-decoration: none; background: var(--bg-surface);
}
.project-card img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-card:hover img { transform: scale(1.05); }
.project-card-overlay {
  position: absolute; inset: 0;
  background: rgba(45, 74, 66, 0); transition: background 0.35s ease;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 28px;
}
.project-card:hover .project-card-overlay,
.project-card:focus-visible .project-card-overlay { background: rgba(45, 74, 66, 0.78); }
.project-card-info {
  transform: translateY(12px); opacity: 0;
  transition: transform 0.35s ease, opacity 0.3s ease;
}
.project-card:hover .project-card-info,
.project-card:focus-visible .project-card-info { transform: translateY(0); opacity: 1; }
.project-card-tag {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: #a8cfc4; margin-bottom: 6px;
}
.project-card-title {
  font-family: var(--heading-font);
  font-size: 1.4rem; font-weight: 300; color: var(--bg); line-height: 1.2;
}
.project-card[hidden] { display: none; }

/* ---------- CASE STUDY --------------------------------------------------- */

.cs-head { padding: 70px 0 0; max-width: 760px; }
.cs-head h1 {
  font-family: var(--heading-font);
  font-size: clamp(2.4rem, 5.5vw, 3.6rem); font-weight: 300;
  line-height: 1.08; margin: 14px 0 22px;
}
.cs-summary { font-size: 18px; font-weight: 300; line-height: 1.75; color: var(--text-secondary); }

.cs-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 28px; margin: 48px 0 0; padding: 28px 0;
  border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider);
}
.cs-meta dt {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px;
}
.cs-meta dd { font-size: 14px; font-weight: 300; line-height: 1.6; color: var(--text-primary); }

/* Goals / Challenges / Role at full page width, so a reader gets the shape
   of the project before deciding whether to read the prose. */
.brief-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 48px; padding: 48px 0 16px;
}
.brief-grid h3 {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin-bottom: 16px;
}
.brief-grid ul { list-style: none; margin: 0; }
.brief-grid li {
  font-size: 15px; font-weight: 300; line-height: 1.6;
  color: var(--text-secondary);
  position: relative; padding-left: 18px; margin-bottom: 11px;
}
.brief-grid li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent-mid);
}

.cs-body { max-width: 720px; margin: 0 auto; }
.cs-body h2 {
  font-family: var(--heading-font);
  font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 300;
  margin: 72px 0 20px;
}
.cs-body h2:first-child { margin-top: 0; }
.cs-body h3 {
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin: 44px 0 14px;
}
.cs-body p {
  font-size: 16px; font-weight: 300; line-height: 1.85;
  color: var(--text-secondary); margin-bottom: 20px;
}
.cs-body p strong { font-weight: 500; color: var(--text-primary); }
.cs-body ul, .cs-body ol { margin: 0 0 20px 1.2em; }
.cs-body li {
  font-size: 16px; font-weight: 300; line-height: 1.85;
  color: var(--text-secondary); margin-bottom: 8px;
}
.cs-body p.credit-note {
  font-size: 13px; line-height: 1.7; color: var(--text-muted);
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--divider);
}
.cs-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.pull {
  font-family: var(--heading-font);
  font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 300; font-style: italic;
  line-height: 1.4; color: var(--accent);
  border-left: 2px solid var(--accent-soft); padding-left: 28px;
  margin: 56px 0;
}

/* media blocks break out of the text column */
figure { margin: 48px 0; }
figure.full {
  width: 100vw; max-width: var(--page-max);
  margin-left: 50%; transform: translateX(-50%);
}
/* Never scale artwork past its real size. `width: auto` renders at the
   image's natural width; `max-width: 100%` stops anything overflowing.
   Small assets centre in their space instead of being stretched soft. */
/* Capped by viewport height as well as width, so a whole screen or spread is
   visible at once. Anyone who wants it bigger clicks through to the file. */
figure img, figure video {
  width: auto; max-width: 100%; height: auto; max-height: 76vh;
  margin: 0 auto; background: var(--bg-surface);
}
figure a.zoom { display: block; cursor: zoom-in; }
figure a.zoom img { transition: opacity 0.2s; }
figure a.zoom:hover img { opacity: 0.9; }
figcaption {
  font-size: 12px; letter-spacing: 0.04em; line-height: 1.6;
  color: var(--text-muted); margin-top: 12px;
}
.media-grid { display: grid; gap: 3px; justify-items: center; align-items: start; }
.media-grid.two   { grid-template-columns: repeat(2, 1fr); }
.media-grid.three { grid-template-columns: repeat(3, 1fr); }

/* Loose artwork (labels, logos, product shots) needs air around it and a
   surface to sit on, unlike screenshots which butt up against each other. */
.media-grid.artwork {
  gap: 28px; background: var(--bg-surface); padding: 40px 32px;
}

/* Phone screens: never display wider than the artwork actually is, or they
   upscale and go soft. Centred in the cell with room to breathe. */
.media-grid.phones {
  gap: 32px; justify-items: center; align-items: start;
  background: var(--bg-surface); padding: 40px 32px;
}
.media-grid.phones img {
  width: 100%; max-width: 340px; height: auto; max-height: 76vh;
  border-radius: 14px;
  box-shadow: 0 12px 30px -10px rgba(45, 74, 66, 0.28);
}

@media (max-width: 700px) {
  .media-grid.phones { gap: 24px; padding: 28px 20px; }
  .media-grid.phones img { max-width: 240px; }
}

/* ---------- BROWSER FRAME ------------------------------------------------
   Full-page website designs read as tall flat images on their own. Framing
   them in browser chrome, with the page scrolling inside a fixed viewport,
   makes them read as sites. */

.browser {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--bg-surface);
  box-shadow: 0 20px 50px -12px rgba(45, 74, 66, 0.22);
}
.browser-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px;
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
.browser-dots { display: flex; gap: 6px; flex: 0 0 auto; }
.browser-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #C9C9C5; display: block;
}
.browser-url {
  flex: 1 1 auto; max-width: 340px; margin: 0 auto;
  background: var(--bg); border-radius: 50px; padding: 5px 16px;
  font-size: 11px; letter-spacing: 0.04em; text-align: center;
  color: var(--text-muted); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.browser-spacer { flex: 0 0 42px; }
.browser-viewport {
  max-height: 620px; overflow-y: auto; background: #fff;
  scrollbar-width: thin;
}
/* Reset the figure-level height cap. Inside the frame the page is meant to be
   full height and scroll; capping it squashes the image out of proportion. */
.browser-viewport img {
  width: 100%; height: auto; max-width: none; max-height: none; display: block;
}
.browser-viewport::-webkit-scrollbar { width: 10px; }
.browser-viewport::-webkit-scrollbar-track { background: var(--bg-surface); }
.browser-viewport::-webkit-scrollbar-thumb {
  background: var(--accent-soft); border-radius: 10px;
  border: 3px solid var(--bg-surface);
}
.browser-viewport::-webkit-scrollbar-thumb:hover { background: var(--accent-mid); }

figure .browser + figcaption { margin-top: 14px; }

@media (max-width: 900px) {
  .browser-viewport { max-height: 420px; }
  .browser-url { font-size: 10px; }
}

/* Three thumbnails at the end of a case study, so there's somewhere to go
   after reading rather than a dead end. */
.more-work { padding: 40px 0 90px; }
.more-work .section-header { margin-bottom: 2rem; }
.more-work .project-card { aspect-ratio: 4 / 3; }
.more-work .project-card img { object-position: center; }

.cs-nav {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-top: 90px; padding-top: 32px; border-top: 1px solid var(--divider);
}
.cs-nav a {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none; transition: color 0.2s;
}
.cs-nav a:hover { color: var(--accent); }

/* ---------- ABOUT -------------------------------------------------------- */

.about-grid {
  display: grid; grid-template-columns: 320px 1fr; gap: 72px; align-items: start;
}
.about-photo { border-radius: 4px; overflow: hidden; background: var(--bg-surface); }
.about-body p {
  font-size: 16px; font-weight: 300; line-height: 1.85;
  color: var(--text-secondary); margin: 24px 0;
}
.about-body p:last-of-type { margin-bottom: 44px; }
.skill-group { margin-bottom: 34px; }
.skill-group h3 {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 12px;
}
.skill-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.skill-list li {
  font-size: 13px; font-weight: 300; color: var(--text-primary);
  border: 1px solid var(--divider); border-radius: 50px; padding: 6px 16px;
}

/* ---------- CONTACT + FOOTER --------------------------------------------- */

.contact-section { padding: 80px var(--gutter); text-align: center; }
.contact-email {
  font-family: var(--heading-font);
  font-size: 28px; font-weight: 300; color: var(--text-primary);
  text-decoration: none; border-bottom: 1px solid var(--accent);
  padding-bottom: 4px; display: inline-block; margin-bottom: 24px;
  transition: color 0.2s;
}
.contact-email:hover { color: var(--accent); }
.social-links { display: flex; gap: 32px; justify-content: center; flex-wrap: wrap; }
.social-links a {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none; transition: color 0.2s;
}
.social-links a:hover { color: var(--text-primary); }

footer {
  padding: 32px var(--gutter); border-top: 1px solid var(--divider);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
footer p { font-size: 12px; color: var(--text-muted); letter-spacing: 0.06em; }

/* ---------- MOTION ------------------------------------------------------- */

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal, .hero-eyebrow, .hero-name, .hero-title, .hero-bio, .hero-cta, .hero-image-wrap {
    opacity: 1 !important; transform: none !important;
  }
}

/* ---------- RESPONSIVE --------------------------------------------------- */

@media (max-width: 900px) {
  :root { --gutter: 30px; }

  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--divider);
    padding: 8px var(--gutter) 24px;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block; width: 100%; padding: 16px 0; font-size: 14px;
    border-bottom: 1px solid var(--border);
  }

  .hero { grid-template-columns: 1fr; gap: 48px; padding: 70px var(--gutter) 60px; }
  .hero-image-wrap { order: -1; }
  .hero-image-blob { width: 240px; height: 290px; }

  .section { padding: 60px 0; }
  .project-grid, .project-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .brief-grid { grid-template-columns: 1fr; gap: 34px; padding: 36px 0 8px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-photo { max-width: 280px; }
  .media-grid.three { grid-template-columns: repeat(2, 1fr); }
  figure.full { width: auto; margin-left: 0; transform: none; }
  footer { flex-direction: column; text-align: center; }
}

@media (max-width: 560px) {
  .project-grid, .project-grid.cols-2 { grid-template-columns: 1fr; }
  .media-grid.two, .media-grid.three { grid-template-columns: 1fr; }
  .cs-meta { grid-template-columns: 1fr 1fr; gap: 20px; }
}
