/*  Tom Arias — shared case-study + index styles
    Loaded by every /work page. Brand tokens mirror index.html.            */

@font-face {
  font-family: 'Pacaembu';
  src: url('Pacaembu-ExtraBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --bg:       #F4EDE6;
  --bg-card:  #EDE7DC;
  --text:     #1A1A17;
  --muted:    #7A756B;
  --green:    #2B6842;
  --mist:     #B9DBC6;
  --rule:     #D9D3C9;
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
  --mono:     ui-monospace, 'SF Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--green); color: var(--bg); }
img, svg { display: block; }
a { color: inherit; }

/* ── NAV ── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 52px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s, padding 0.4s;
}
#nav.scrolled { border-color: var(--rule); padding-top: 16px; padding-bottom: 16px; }
.nav-logo img { height: 34px; width: auto; }
.nav-links { display: flex; gap: 40px; list-style: none; align-items: center; }
.nav-links a {
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); text-decoration: none;
  position: relative; padding-bottom: 3px;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: var(--text); transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.active { color: var(--green); }

/* ── SCROLL FLIGHT-LINE ── */
.flightline { position: fixed; top: 130px; bottom: 130px; right: 26px; width: 1px; z-index: 90; pointer-events: none; }
.flightline::before {
  content: ''; position: absolute; inset: 0; width: 1px;
  background-image: linear-gradient(var(--green) 40%, transparent 0);
  background-size: 1px 7px; opacity: 0.28;
}
.flightline-plane { position: absolute; left: 50%; top: 0; width: 17px; margin-left: -8.5px; color: var(--green); transition: top 0.12s linear; will-change: top; }
.flightline-plane svg { width: 100%; height: auto; transform: rotate(125deg); }
@media (max-width: 1180px) { .flightline { display: none; } }

/* ── LAYOUT PRIMITIVES ── */
.wrap { padding-left: 52px; padding-right: 52px; }
section { padding: 92px 52px; position: relative; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); }
.kicker { font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-family: var(--mono); }
.divider { border: none; border-top: 1px solid var(--rule); }

/* ── CASE HERO ── */
.cs-hero { position: relative; padding: 150px 52px 0; overflow: hidden; }
.breadcrumb {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; margin-bottom: 56px;
  transition: gap 0.25s var(--ease), color 0.25s;
}
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb:hover { color: var(--green); gap: 14px; }

.cs-hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: end; }
.cs-eyebrow { margin-bottom: 22px; }
.cs-title { font-family: 'Pacaembu', sans-serif; font-size: clamp(58px, 8.4vw, 132px); line-height: 0.88; letter-spacing: 0.01em; color: var(--green); }
.cs-hook { font-size: clamp(18px, 2vw, 23px); line-height: 1.5; color: var(--text); font-weight: 300; font-style: italic; margin-bottom: 30px; }
.cs-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; }
.cs-meta-item .kicker { display: block; margin-bottom: 6px; }
.cs-meta-item p { font-size: 14px; color: var(--text); font-weight: 400; line-height: 1.45; }
.cs-hero-media { margin-top: 56px; }

/* ── IMAGE COMPONENT ── */
.shot { display: block; width: 100%; background: var(--bg-card); overflow: hidden; position: relative; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.shot.zoom:hover img { transform: scale(1.03); }
.shot.contain { background: #fff; border: 1px solid var(--rule); }
.shot.contain img { object-fit: contain; }
.shot.pad { padding: 5%; }
figure.fig { display: block; }
figure.fig figcaption { margin-top: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }

.r-21x9 { aspect-ratio: 21 / 9; }
.r-16x9 { aspect-ratio: 16 / 9; }
.r-3x2  { aspect-ratio: 3 / 2; }
.r-4x3  { aspect-ratio: 4 / 3; }
.r-1x1  { aspect-ratio: 1 / 1; }
.r-4x5  { aspect-ratio: 4 / 5; }
.r-3x4  { aspect-ratio: 3 / 4; }
.r-9x16 { aspect-ratio: 9 / 16; }
.r-2x3  { aspect-ratio: 2 / 3; }

/* ── PROSE / TWO-COL BLOCK ── */
.block { display: grid; grid-template-columns: 0.42fr 1fr; gap: 56px; align-items: start; }
.block-head .kicker { display: block; margin-bottom: 14px; }
.block-head h2 { font-family: 'Pacaembu', sans-serif; font-size: clamp(28px, 3.4vw, 46px); line-height: 0.98; letter-spacing: 0.01em; color: var(--text); }
.prose p { font-size: 16px; line-height: 1.78; color: var(--muted); font-weight: 300; margin-bottom: 18px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 500; }
.prose .lead { font-size: 19px; color: var(--text); line-height: 1.6; margin-bottom: 24px; }
.prose .note { margin-top: 22px; font-family: var(--mono); font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; border: 1px dashed var(--rule); padding: 8px 12px; }

/* sub-points list */
.subpoints { margin-top: 30px; display: grid; gap: 2px; }
.subpoint { background: var(--bg-card); padding: 22px 24px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: baseline; }
.subpoint .sp-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--green); text-transform: uppercase; white-space: nowrap; }
.subpoint h4 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.subpoint p { font-size: 14px; color: var(--muted); font-weight: 300; line-height: 1.6; }

/* ── GALLERY GRIDS ── */
.grid { display: grid; gap: 3px; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.full { grid-column: 1 / -1; }

/* ── VIDEO EMBED ── */
.embed { background: var(--text); overflow: hidden; }
.embed-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.embed-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mist); }
.embed-label .dot { color: var(--green); }
.embed-meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: #6a6a64; }
.embed-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── PULL QUOTE ── */
.pullquote { background: var(--bg-card); }
.pullquote .inner { max-width: 1040px; margin: 0 auto; text-align: center; }
.pullquote blockquote { font-family: 'Pacaembu', sans-serif; font-size: clamp(28px, 4vw, 56px); line-height: 1.04; letter-spacing: 0.005em; color: var(--green); text-transform: uppercase; }
.pullquote cite { display: block; margin-top: 28px; font-style: normal; font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* ── CONTACT (matches landing page) ── */
.contact { background: var(--text); padding: 112px 52px; position: relative; overflow: hidden; }
.contact-bg-mark { position: absolute; right: -80px; top: 50%; transform: translateY(-50%); width: 560px; opacity: 0.07; pointer-events: none; fill: var(--bg); will-change: transform; }
.contact-display { font-family: 'Pacaembu', sans-serif; font-size: clamp(60px, 10.5vw, 144px); line-height: 0.9; color: var(--bg); position: relative; z-index: 1; text-transform: uppercase; }
.contact-display em { font-style: normal; color: var(--green); }
.contact-row { display: flex; align-items: flex-end; justify-content: space-between; border-top: 1px solid #272722; padding-top: 28px; margin-top: 52px; gap: 40px; position: relative; z-index: 1; flex-wrap: wrap; }
.contact-links { display: flex; flex-direction: column; gap: 14px; }
.contact-link { font-size: 15px; color: #888; text-decoration: none; display: inline-flex; align-items: center; gap: 14px; font-weight: 300; transition: color 0.2s; }
.contact-link:hover { color: var(--bg); }
.contact-link-label { font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green); width: 52px; flex-shrink: 0; }
.contact-note { text-align: right; }
.contact-note p { font-size: 13px; color: #777; line-height: 1.9; font-weight: 300; }
.contact-note strong { color: var(--bg); font-weight: 500; }

/* ── PREV / NEXT ── */
.pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); }
.pager a { display: flex; flex-direction: column; gap: 8px; padding: 40px 52px; text-decoration: none; transition: background 0.3s; }
.pager a:hover { background: var(--bg-card); }
.pager .pg-dir { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pager .pg-name { font-family: 'Pacaembu', sans-serif; font-size: clamp(20px, 2.4vw, 30px); color: var(--green); line-height: 1; }
.pager a.next { text-align: right; align-items: flex-end; border-left: 1px solid var(--rule); }

/* ── CTA ── */
.cta { background: var(--text); position: relative; overflow: hidden; padding: 96px 52px; }
.cta-mark { position: absolute; right: -60px; top: 50%; transform: translateY(-50%); width: 460px; opacity: 0.07; fill: var(--bg); pointer-events: none; }
.cta h2 { font-family: 'Pacaembu', sans-serif; font-size: clamp(48px, 8vw, 110px); line-height: 0.9; color: var(--bg); position: relative; z-index: 1; }
.cta h2 em { font-style: normal; color: var(--green); }
.cta-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; margin-top: 44px; border-top: 1px solid #272722; padding-top: 28px; position: relative; z-index: 1; flex-wrap: wrap; }
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; letter-spacing: 0.04em; text-decoration: none; padding: 15px 24px; transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, border-color 0.25s; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--green); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { color: var(--bg); border: 1px solid #34342f; }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.cta-note { text-align: right; font-size: 13px; color: #888; font-weight: 300; line-height: 1.9; }
.cta-note strong { color: var(--bg); font-weight: 500; }

/* ── FOOTER ── */
footer { background: var(--text); border-top: 1px solid #2a2a26; padding: 20px 52px; display: flex; align-items: center; justify-content: space-between; }
footer p, footer a { font-size: 11px; color: #6a6a64; text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--green); }

/* ── PLACEHOLDER SLOT (for projects without supplied imagery) ── */
.slot {
  position: relative; width: 100%;
  background: repeating-linear-gradient(135deg, transparent 0 16px, color-mix(in srgb, var(--mist) 55%, transparent) 16px 17px), var(--bg-card);
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
}
.slot-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 28px; }

/* ── SOCIAL CAROUSEL (Continental) ── */
.flavour { margin-bottom: 30px; }
.flavour-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--rule); padding-bottom: 12px; }
.flavour-head h3 { font-family: 'Pacaembu', sans-serif; font-size: clamp(22px, 2.4vw, 34px); color: var(--green); letter-spacing: 0.01em; }
.flavour-head .count { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.carousel { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.carousel .frame { flex: 0 0 auto; width: 300px; max-width: 60vw; scroll-snap-align: start; }
.carousel .frame .shot { aspect-ratio: 4/5; }
.carousel .frame .cap { margin-top: 9px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }

/* ── REVEAL ── */
/* Display font (Pacaembu) always renders ALL CAPS */
.cs-title, .block-head h2, .pullquote blockquote, .pager .pg-name, .cta h2, .flavour-head h3, .work-head h1, .proj-feature .proj-title { text-transform: uppercase; }
/* Full-width stacked image (single-column galleries) */
.stack-img { display: block; width: 100%; height: auto; }
.stack-img + .stack-img { margin-top: 3px; }
/* Captioned image block (one image, short caption underneath) */
.imgblock { margin-top: 44px; }
.imgblock:first-of-type { margin-top: 0; }
.imgcap { margin: 16px 0 0; font-size: 15px; line-height: 1.7; color: var(--muted); font-weight: 300; max-width: 860px; }
.imgcap .n { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--green); margin-right: 10px; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
}
.static-fallback .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 980px) {
  .cs-hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .block { grid-template-columns: 1fr; gap: 22px; }
  .g-3, .g-4 { grid-template-columns: 1fr 1fr; }
  .span-3 { grid-column: span 2; }
}
@media (max-width: 880px) {
  nav { padding: 18px 28px; }
  .cs-hero, section, .cta, .contact, footer { padding-left: 28px; padding-right: 28px; }
  .wrap { padding-left: 28px; padding-right: 28px; }
  .pager a { padding: 28px; }
  .cta-row { flex-direction: column; align-items: flex-start; }
  .cta-note { text-align: left; }
  .contact-row { flex-direction: column; align-items: flex-start; gap: 32px; }
  .contact-note { text-align: left; }
}
@media (max-width: 600px) {
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
}
