/* ==========================================================================
   Fatemeh Jalali — portfolio
   Shared stylesheet. Every page links this file.

   Visual direction: light, editorial, magazine-like. Typography and
   whitespace carry the hierarchy — no monospace/dashboard motifs.
   ========================================================================== */

/* ---------- design tokens ---------- */
:root{
  --bg: #FAFAF8;
  --bg-card: #FFFFFF;
  --ink: #16181C;
  --ink-soft: #55585F;
  --ink-faint: #9A9C98;
  --accent: #8868A8;
  --accent-soft: #EDE6F5;
  --line: #DCDAD1;
  --line-strong: #B9B6AA;

  /* Per-case-study accents. Applied to that case's work-entry media/link on
     the homepage, and as the page-wide --accent on the case's own page. */
  --cs1-accent: #C1652B;      /* addon features — vivid warm amber */
  --cs1-accent-soft: #F7E1CD;
  --cs2-accent: #4453C4;      /* template system — vivid indigo */
  --cs2-accent-soft: #E3E6FA;

  /* Inter everywhere by default — clean and reliable at every weight/
     size, with no unusual letterforms to trip on. --serif is kept as
     an alias (rather than rewriting every heading rule) so existing
     styles that reference it still resolve correctly. --display-serif
     is the one deliberate exception: Fraunces, used only for
     .section-title, to give major section headings stronger contrast
     against the Inter body text. */
  --serif: 'Inter', sans-serif;
  --sans: 'Inter', sans-serif;
  --display-serif: 'Fraunces', serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(22, 24, 28, 0.07);

  --max: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
}

:root[data-theme="cs1"]{ --accent: var(--cs1-accent); --accent-soft: var(--cs1-accent-soft); }
:root[data-theme="cs2"]{ --accent: var(--cs2-accent); --accent-soft: var(--cs2-accent-soft); }

/* ---------- base ---------- */
*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a{ color: inherit; }
img{ max-width: 100%; display:block; }

.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Visually hidden, still read by screen readers. */
.visually-hidden{
  position:absolute;
  width:1px; height:1px;
  margin:-1px; padding:0;
  overflow:hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border:0;
}

.skip-link{
  position:absolute;
  left:-9999px;
  top:0;
  z-index: 10;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 18px;
  text-decoration:none;
}
.skip-link:focus{
  left: var(--gutter);
  top: 12px;
}

/* ---------- divider ---------- */
/* A quiet horizontal rule, used sparingly — whitespace does most of the
   work of separating sections. */
.divider{
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
  width: 100%;
}

/* ---------- header ---------- */
header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-top: 18px;
  padding-bottom: 14px;
}
.header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.logo{
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration:none;
}
.header-row nav{
  display:flex;
  gap: clamp(18px, 3vw, 36px);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
}
.header-row nav a{
  text-decoration:none;
  color: var(--ink-soft);
  position:relative;
  padding-bottom: 2px;
}
.header-row nav a::after{
  content:'';
  position:absolute;
  left:0; bottom:0;
  width:100%;
  height:1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s ease;
}
.header-row nav a:hover{ color: var(--ink); }
.header-row nav a:hover::after{ transform: scaleX(1); transform-origin: left; }
/* Current page in a multi-page nav. */
.header-row nav a[aria-current="page"]{
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
}
.header-row nav a[aria-current="page"]::after{ content:none; }

/* ---------- buttons ---------- */
.btn{
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration:none;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  display:inline-flex;
  align-items:center;
  gap: 8px;
}
.btn-primary{
  background: var(--accent);
  color: #FFFFFF;
}
.btn-primary:hover{ filter: brightness(0.92); }
.btn-ghost{
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-ghost:hover{ background: var(--accent-soft); }

/* ---------- section heads ---------- */
/* Single-sided rhythm: sections sit back to back with no divider between
   them, so only padding-top creates the gap — adding padding-bottom too
   would double it at every section-to-section boundary. */
.section{
  padding-top: clamp(48px, 6vw, 80px);
}
.section-head{
  display:flex;
  justify-content:space-between;
  align-items: flex-end;
  margin-bottom: clamp(24px, 3.5vw, 40px);
  gap: 20px;
  flex-wrap: wrap;
}
.section-label{
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-title{
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 8px 0 0 0;
}
.section-note{
  font-family: var(--sans);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-faint);
  max-width: 30ch;
  text-align: right;
}
/* A short, single-line note (e.g. Selected Work) shouldn't wrap like the
   longer per-section notes on case study pages do. */
.section-note--wide{ max-width: none; }

/* ---------- tags ---------- */
.tag{
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 6px 13px;
  border-radius: 20px;
}

/* ---------- hero (home) ---------- */
.hero{
  position: relative;
  padding-top: clamp(84px, 12vw, 144px);
  padding-bottom: clamp(28px, 4vw, 48px);
  display:grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.eyebrow{
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 10px;
}
.eyebrow::after{
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.hero-identity{
  display:flex;
  align-items:center;
  gap: 20px;
}
.hero-photo{
  width: 140px; height: 140px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
  filter: saturate(0.92);
  flex-shrink:0;
}
.hero-name{
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.8vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 8px 0 0 0;
}
.hero-sub{
  display:grid;
  grid-template-columns: minmax(0,1fr);
  gap: 22px;
  max-width: 640px;
}
.hero-sub p{
  font-size: 19px;
  color: var(--ink-soft);
  margin: 0;
  max-width: 56ch;
}
.hero-cta{
  display:flex;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ---------- work entries (home) ---------- */
.work-list{
  display:flex;
  flex-direction: column;
}
.work-divider{
  border:none;
  border-top:1px solid var(--line);
  width:100%;
  margin: clamp(48px, 6vw, 80px) 0;
}
.work-entry{
  display:flex;
  flex-direction: column;
}
/* Per-entry accent, scoped so it doesn't leak past this entry. */
.work-entry--cs1{ --card-accent: var(--cs1-accent); --card-accent-soft: var(--cs1-accent-soft); }
.work-entry--cs2{ --card-accent: var(--cs2-accent); --card-accent-soft: var(--cs2-accent-soft); }

.work-kicker{
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--card-accent, var(--accent));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
  position: relative;
  padding-top: 16px;
}
.work-kicker::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--card-accent, var(--accent));
}

.work-media{
  display:block;
  width:100%;
  aspect-ratio: 3/2;
  background: var(--card-accent-soft, var(--accent-soft));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.5vw, 28px);
  position: relative;
  overflow: hidden;
}
.work-media img{
  width:100%;
  height:100%;
  object-fit: contain;
  display:block;
  transition: transform .4s ease;
}
.work-entry:hover .work-media img{ transform: scale(1.02); }

.work-body{
  display:flex;
  flex-direction: column;
  gap: 16px;
  margin-top: clamp(24px, 4vw, 36px);
}
.work-title{
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 500;
  margin: 0;
  line-height: 1.15;
}
.work-title a{
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}
.work-entry:hover .work-title a{ color: var(--card-accent, var(--accent)); }
.work-result{
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card-accent-soft, var(--accent-soft));
  display:inline-block;
  width:fit-content;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
}
.work-desc{
  color: var(--ink-soft);
  font-size: 16px;
  margin: 0;
}
.work-tags{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.work-link{
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  margin-top: 6px;
  width: fit-content;
}
.work-entry:hover .work-link{ color: var(--card-accent, var(--accent)); }
.work-link-text{ position:relative; }
.work-link-text::after{
  content:'';
  position:absolute;
  left:0; bottom:-2px;
  width:100%;
  height:1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s ease;
}
.work-entry:hover .work-link-text::after{ transform: scaleX(1); transform-origin: left; }
.work-link .arrow{ transition: transform .2s ease; }
.work-entry:hover .arrow{ transform: translateX(4px); }

/* ---------- about ---------- */
.about-grid{
  display:grid;
  grid-template-columns: 1fr;
}
.about-text p{
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 18px 0;
}
.about-text p:last-child{ margin-bottom:0; }
.about-text strong{
  color: var(--ink);
  font-weight: 500;
}

.skills{
  margin-top: 32px;
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
}
.skills span{
  color: var(--ink);
  background: var(--accent-soft);
  padding: 7px 14px;
  border-radius: 20px;
}

/* ==========================================================================
   Case study components
   Shared by case-study-1.html / case-study-2.html.
   ========================================================================== */

/* ---------- case hero ---------- */
.case-hero{
  padding-top: clamp(24px, 4vw, 40px);
  padding-bottom: clamp(28px, 4vw, 48px);
}
.case-hero h1{
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.8vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 14px 0 0 0;
  max-width: 20ch;
}
.case-summary-label{
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 28px 0 10px 0;
}
.case-summary{
  font-size: 19px;
  color: var(--ink-soft);
  margin: 0;
  text-align: justify;
}

/* ---------- media frame (cover + inline images) ---------- */
.frame{
  width:100%;
  background: var(--accent-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.frame::after{
  content: attr(data-label);
  position:absolute;
  bottom: 16px; left:16px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  opacity: 0.75;
}
.frame img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}
.frame--cover{ aspect-ratio: 3/2; }
.frame--wide{ aspect-ratio: 16/9; }
.frame--square{ aspect-ratio: 4/3; }

/* ---------- prose ---------- */
.prose h3{
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  margin: 0 0 14px 0;
}
.prose p{
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 18px 0;
  text-align: justify;
}
.prose p:last-child{ margin-bottom:0; }
.prose strong{ color: var(--ink); font-weight: 500; }
.prose ul{
  margin: 0 0 18px 0;
  padding-left: 20px;
  color: var(--ink-soft);
}
.prose li{ margin-bottom: 8px; text-align: justify; }
.prose li:last-child{ margin-bottom:0; }

/* a .frame following body text within the same section (e.g. a supporting
   chart under a problem statement) needs its own top gap, since .prose
   itself carries no trailing margin. Same for a second .prose block
   (e.g. a numbered sub-point) following the section's intro prose, and
   for text resuming after an inline frame. */
.prose + .frame,
.frame + .prose,
.frame + .frame,
.compare-table-wrap + .prose,
.lightbox + .prose,
.prose + .layer-diagram,
.layer-diagram + .prose,
.result-compare-wrap + .prose,
.prose + .result-block,
.frame + .result-block{ margin-top: clamp(28px, 4vw, 40px); }
.prose + .prose{ margin-top: clamp(28px, 4vw, 40px); }

/* ---------- layer diagram ---------- */
/* A minimal, three-step relationship diagram — plain cards and an
   arrow, no icons or illustration, so it breaks up prose without
   looking like a technical flowchart. */
.layer-diagram{
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.layer-diagram-item{
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  flex: 1 1 180px;
  max-width: 220px;
}
.layer-diagram-index{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.layer-diagram-item h4{
  font-family: var(--serif);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 6px 0;
}
.layer-diagram-item p{
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}
.layer-diagram-arrow{
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--line-strong);
  flex-shrink: 0;
}
@media (max-width: 700px){
  .layer-diagram{ flex-direction: column; }
  .layer-diagram-arrow{ transform: rotate(90deg); }
}

/* pull quote / callout, dropped inline in a section */
.callout{
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  padding: 20px 24px;
  margin: clamp(24px, 4vw, 36px) 0;
  max-width: 62ch;
}
.callout--wide{ max-width: none; }
.callout p{
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink);
  text-align: justify;
  margin: 0;
  line-height: 1.4;
}

/* ---------- process steps ---------- */
/* Each step is an image (reusing .frame, so it carries the same
   accent-tinted placeholder treatment as the cover shot) followed by
   its text, stacked — matching the homepage work-entry pattern rather
   than a plain bulleted list. */
.process-list{
  list-style:none;
  margin:0; padding:0;
  display:flex;
  flex-direction:column;
  gap: clamp(48px, 7vw, 72px);
}
.process-step{
  display:flex;
  flex-direction:column;
  gap: 20px;
}
.timeline-index{
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  display:block;
  margin-bottom: 8px;
}
.process-body h3{
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  margin: 0 0 10px 0;
}
.process-body p{
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 12px 0;
}
.process-body p:last-child{ margin-bottom: 0; }
.process-body strong{ color: var(--ink); font-weight: 500; }

/* ---------- key decisions ---------- */
.decision-list{
  display:flex;
  flex-direction:column;
  gap: clamp(48px, 7vw, 72px);
}
.decision-item{
  display:flex;
  flex-direction:column;
  gap: 20px;
}
.decision-index{
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  display:block;
  margin-bottom: 10px;
}
.decision-body h3{
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  margin: 0 0 12px 0;
}
.decision-body p{
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 10px 0;
}
.decision-body p:last-child{ margin-bottom:0; }
.decision-body .label{
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display:block;
  margin-bottom: 4px;
}

/* ---------- result comparison ---------- */
.result-compare{
  display:flex;
  flex-wrap: wrap;
  align-items:center;
  gap: clamp(16px, 4vw, 32px);
  margin: clamp(24px, 4vw, 40px) 0;
}
.result-stat{
  display:flex;
  flex-direction:column;
  gap: 4px;
}
.result-stat b{
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 48px);
  line-height:1;
  color: var(--ink);
}
.result-stat b.is-accent{ color: var(--accent); }
.result-stat span{
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
}
.result-arrow{
  font-family: var(--serif);
  font-size: 28px;
  color: var(--line-strong);
}
.result-highlight{
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--accent-soft);
  display:inline-block;
  width:fit-content;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  margin-top: clamp(20px, 3vw, 32px);
}

/* ---------- competitor comparison table ---------- */
.compare-table-wrap{
  margin: clamp(28px, 4vw, 40px) 0 0 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.compare-table{
  width: 100%;
  border-collapse: collapse;
}
.compare-table th{
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-align: left;
  padding: 16px 24px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
}
.compare-table td{
  padding: 20px 24px;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.compare-table tr:last-child td{ border-bottom: none; }
.compare-table em{ color: var(--ink); font-style: italic; }
.compare-app{
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
}

@media (max-width: 700px){
  .compare-table thead{ display: none; }
  .compare-table, .compare-table tbody, .compare-table tr, .compare-table td{
    display: block;
    width: 100%;
  }
  .compare-table tr{
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
  }
  .compare-table tr:last-child{ border-bottom: none; }
  .compare-table td{
    padding: 6px 0;
    border-bottom: none;
  }
  .compare-table td::before{
    content: attr(data-label);
    display: block;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 4px;
  }
  .compare-table td:first-child::before{ display: none; }
}

/* ---------- comparison-table screenshot thumbnail ---------- */
.compare-thumb{
  position: relative;
  display: inline-block;
  width: 96px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}
.compare-thumb .frame{
  display: block;
  aspect-ratio: 3/2;
  border-radius: var(--radius-sm);
  box-shadow: none;
  transition: opacity .2s ease;
}
.compare-thumb:hover .frame{ opacity: 0.85; }
.compare-thumb-count{
  position: absolute;
  right: 5px;
  bottom: 5px;
  background: rgba(22, 24, 28, 0.72);
  color: #FFFFFF;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 20px;
  line-height: 1.3;
}

/* ---------- screenshot lightbox ---------- */
/* One reusable dialog for all four apps: setupCompareLightbox() in
   main.js swaps which .shot-grid is visible and opens/closes it. */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lightbox[hidden]{ display: none; }
.lightbox-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(22, 24, 28, 0.55);
}
.lightbox-dialog{
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(22, 24, 28, 0.3);
  width: 100%;
  max-width: 1400px;
  max-height: 94vh;
  overflow-y: auto;
  padding: clamp(20px, 3vw, 36px);
}
.lightbox-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(20px, 3vw, 28px);
}
.lightbox-title{
  font-family: var(--display-serif);
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
}
.lightbox-close{
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px 0 0;
}
.lightbox-close:hover{ color: var(--ink); }

/* Flex + justify-content:center (rather than CSS grid) so an
   incomplete last row — e.g. Pumper's 5 images as 3 + 2 — centers
   itself instead of hugging the left edge with dead space on the
   right. Column count/width is driven by data-count. */
.shot-grid{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
.shot-grid[hidden]{ display: none; }
.shot{ display: flex; flex-direction: column; }
.shot-caption{
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
  margin: 8px 0 0 0;
}

/* A single image is sized by available dialog height rather than a
   fixed width, so the lightbox never needs to scroll for it — width
   follows from the frame's own 3:2 ratio. */
.shot-grid[data-count="1"] .shot{ flex: 0 1 auto; max-width: 100%; }
.shot-grid[data-count="1"] .frame{
  width: auto;
  max-width: 100%;
  height: min(calc(94vh - 180px), 700px);
}
.shot-grid[data-count="2"] .shot{ flex: 1 1 0; max-width: calc(50% - 10px); }
.shot-grid[data-count="3"] .shot{ flex: 1 1 0; max-width: calc(33.333% - 14px); }
.shot-grid:not([data-count="1"]):not([data-count="2"]):not([data-count="3"]) .shot{
  flex: 1 1 340px;
  max-width: 420px;
}

@media (max-width: 700px){
  .shot-grid[data-count]:not([data-count="1"]) .shot{
    flex: 1 1 100%;
    max-width: 100%;
  }
}

body.lightbox-open{ overflow: hidden; }

/* ---------- prev/next case nav ---------- */
nav[aria-label="More work"]{
  padding-top: clamp(48px, 6vw, 80px);
  padding-bottom: clamp(48px, 6vw, 80px);
}
.case-switch{
  display:grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2.5vw, 24px);
}
.case-switch-link{
  background: #FFFFFF;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  outline: none;
  padding: clamp(24px, 4vw, 40px);
  text-decoration:none;
  color: inherit;
  display:flex;
  flex-direction:column;
  gap: 8px;
  transition: transform .2s ease, border-color .2s ease;
}
.case-switch-link:hover,
.case-switch-link:focus-visible{
  transform: translateY(-3px);
  background: #FFFFFF;
  box-shadow: var(--shadow);
  border-color: var(--accent);
  outline: none;
}
.case-switch-link:hover .case-switch-title,
.case-switch-link:focus-visible .case-switch-title{ color: var(--accent); }
.case-switch-label{
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.case-switch-title{
  font-family: var(--serif);
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 500;
}

@media (min-width: 700px){
  .case-switch{ grid-template-columns: 1fr 1fr; }
  .case-switch-link:last-child{ align-items: flex-end; text-align: right; }
}

/* ---------- contact ---------- */
.contact{
  position: relative;
  padding-top: clamp(56px, 8vw, 96px);
  padding-bottom: clamp(56px, 8vw, 96px);
}
.contact-inner{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap: 28px;
}
.contact h2{
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 6vw, 64px);
  margin: 0;
  letter-spacing: -0.015em;
  max-width: 12ch;
}
.contact h2 em{ font-style: italic; color: var(--accent); }
.contact-links{
  display:flex;
  flex-wrap: wrap;
  gap: 14px;
}
.contact-link{
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration:none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  display:inline-flex;
  align-items:center;
  gap: 8px;
}
.contact-link:hover{
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- footer ---------- */
footer{
  padding: 24px var(--gutter) 40px;
  max-width: var(--max);
  margin: 0 auto;
  display:flex;
  justify-content:space-between;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- reveal ---------- */
.reveal{
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.in{
  opacity: 1;
  transform: translateY(0);
}
/* A touch of stagger between two sibling .reveal blocks in the same
   section (e.g. hero photo before hero copy, About head before body)
   without needing a separate observer per element. */
.hero-sub.reveal,
.about-grid.reveal{
  transition-delay: .1s;
}

/* Staggered reveal within each work entry: image scales in first,
   then title/badge/description/tags/link fade up in sequence. Driven
   by the single .work-entry.in toggle (same IntersectionObserver
   entry as every other .reveal), so it only ever plays once. */
.work-entry .work-media,
.work-entry .work-title,
.work-entry .work-result,
.work-entry .work-desc,
.work-entry .work-tags,
.work-entry .work-link{
  opacity: 0;
  transition: opacity .5s ease, transform .5s ease;
}
.work-entry .work-media{ transform: scale(0.96); }
.work-entry .work-title,
.work-entry .work-result,
.work-entry .work-desc,
.work-entry .work-tags,
.work-entry .work-link{
  transform: translateY(22px);
}
.work-entry .work-title{ transition-delay: .1s; }
.work-entry .work-result{ transition-delay: .2s; }
.work-entry .work-desc{ transition-delay: .3s; }
.work-entry .work-tags{ transition-delay: .4s; }
.work-entry .work-link{ transition-delay: .5s; }

.work-entry.in .work-media,
.work-entry.in .work-title,
.work-entry.in .work-result,
.work-entry.in .work-desc,
.work-entry.in .work-tags,
.work-entry.in .work-link{
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce){
  .reveal{ opacity:1; transform:none; transition:none; }
  .work-entry .work-media,
  .work-entry .work-title,
  .work-entry .work-result,
  .work-entry .work-desc,
  .work-entry .work-tags,
  .work-entry .work-link{
    opacity:1; transform:none; transition:none;
  }
  html{ scroll-behavior:auto; }
}

/* ---------- focus ---------- */
a:focus-visible, .btn:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- responsive ---------- */
@media (min-width: 760px){
  .hero{ grid-template-columns: 1.3fr 1fr; align-items: center; }
  .contact-inner{ flex-direction: row; align-items:center; justify-content:space-between; width:100%; }
}
@media (max-width: 759px){
  nav{ gap: 16px; }
  .section-note{ display:none; }
}
