/* ==========================================================
   Fran Langdon: portfolio. Design direction C, "Magazine".
   Gallery-white pages for the work; dark full-bleed spreads
   for the contents and each chapter opener. No accent colour:
   the photography carries the colour.
   ========================================================== */

:root {
  --bg: #fcfbf8;
  --bg-2: #f2f0eb;
  --ink: #121211;
  --muted: #75736d;
  --line: #e3e0da;

  --dark: #0d0d0c;
  --dark-2: #1a1a18;
  --dark-ink: #f4f0e7;
  --dark-muted: #a39e95;
  --dark-line: rgba(244, 240, 231, .14);

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --nav-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.serif { font-family: var(--serif); font-weight: 400; }
.caps { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.muted { color: var(--muted); }
.dark { background: var(--dark); color: var(--dark-ink); --line: var(--dark-line); --muted: var(--dark-muted); }
section[id] { scroll-margin-top: var(--nav-h); }
.ph { background: rgba(0,0,0,.06); outline: 1px dashed var(--muted); padding: 0 .2em; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.nav > .wrap { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font-size: 13px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 3vw, 36px); font-size: 14px; }
.nav-links > a, .nav-work > a { padding: 8px 0; position: relative; }
.nav-links > a::after, .nav-work > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav-links > a:hover::after, .nav-work:hover > a::after, .nav-work:focus-within > a::after { transform: scaleX(1); }
.nav-work > a .chev { display: inline-block; margin-left: 4px; font-size: 10px; transition: transform .3s; }
.nav-work:hover > a .chev, .nav-work:focus-within > a .chev { transform: rotate(180deg); }

/* Work menu: a dark panel listing the chapters */
.work-menu {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--dark); color: var(--dark-ink);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .25s, transform .25s var(--ease), visibility 0s .25s;
}
.nav-work:hover .work-menu, .nav-work:focus-within .work-menu {
  opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .25s var(--ease);
}
.work-menu .wrap { padding-top: 36px; padding-bottom: 40px; }
.work-menu ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px; }
.work-menu li a {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: baseline; gap: 10px;
  padding: 14px 0; border-bottom: 1px solid var(--dark-line); transition: padding .3s var(--ease), color .2s;
}
.work-menu li a:hover, .work-menu li a:focus { padding-left: 8px; }
.work-menu .n { font-family: var(--serif); font-style: italic; color: var(--dark-muted); font-size: 17px; }
.work-menu .t { font-family: var(--serif); font-size: 24px; line-height: 1.15; }
.work-menu .c { font-size: 12px; color: var(--dark-muted); }
.work-menu .all { display: inline-block; margin-top: 24px; font-size: 13px; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
/* Hover menus don't exist on touch screens: there, "Work" goes to the contents */
@media (hover: none), (max-width: 860px) { .work-menu { display: none; } .nav-work > a .chev { display: none; } }

/* ---------- Cover (home) ---------- */
.cover { padding: clamp(40px, 5.5vw, 88px) 0 clamp(40px, 5vw, 76px); }
.cover-grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 5vw, 88px); align-items: center; }
.cover h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 6.4vw, 104px); line-height: .94; letter-spacing: -0.02em; }
.cover h1 em { font-style: italic; }
.cover .intro { margin-top: 26px; max-width: 46ch; font-size: clamp(15px, 1.15vw, 17px); color: var(--muted); }
.cover .intro strong { color: var(--ink); font-weight: 500; }
.available { display: inline-flex; align-items: center; gap: 10px; }
.available i { width: 7px; height: 7px; border-radius: 50%; background: #2f9e62; }
@media (max-width: 900px) { .cover-grid { grid-template-columns: minmax(0, 1fr); align-items: start; } }

/* Spinner: a two-faced card that turns on its vertical axis */
.spinner { width: 100%; max-width: 380px; justify-self: end; }
.spin-stage { perspective: 1600px; }
.spin-card { position: relative; aspect-ratio: 4 / 5; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.65, 0, .35, 1); }
.spin-face { position: absolute; inset: 0; display: block; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--bg-2); }
.spin-face.back { transform: rotateY(180deg); }
.spin-face img { width: 100%; height: 100%; object-fit: cover; }
.spin-caption { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; font-size: 13px; min-height: 1.6em; }
.spin-caption a:hover .t { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) { .spinner { justify-self: center; max-width: 320px; } }

/* Clients strip */

/* ---------- Section heads ---------- */
section { padding: clamp(64px, 8vw, 120px) 0; }
.head { display: flex; align-items: end; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 48px; }
.head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5vw, 72px); line-height: 1; }

/* ---------- Work items (selected work + chapter lists) ---------- */
.works { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2.4vw, 36px); row-gap: clamp(48px, 6vw, 80px); }
.work { grid-column: span 6; display: block; }
.work.big { grid-column: span 8; }
.work.small { grid-column: span 4; }
.work .pic { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); }
.work.big .pic { aspect-ratio: 16 / 10; }
.work.small .pic { aspect-ratio: 4 / 5; }
.work .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.work:hover .pic img { transform: scale(1.03); }
.work .meta { display: grid; grid-template-columns: 40px 1fr; gap: 0 12px; margin-top: 18px; }
.work .num { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--muted); line-height: 1.3; }
.work h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.4vw, 36px); line-height: 1.08; margin-top: 6px; }
.work:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.work .sum { margin-top: 8px; color: var(--muted); font-size: 15px; max-width: 52ch; }
.work .award { margin-top: 10px; font-size: 13px; color: var(--muted); }
.work .award::before { content: "✦ "; }
@media (max-width: 860px) { .work, .work.big, .work.small { grid-column: span 12; } .work.small .pic { aspect-ratio: 4 / 3; } }

/* ---------- Contents (dark spread) ---------- */
.contents li { border-bottom: 1px solid var(--line); }
.contents li:first-child { border-top: 1px solid var(--line); }
.contents a { display: grid; grid-template-columns: 70px 120px 1.1fr 1.3fr 90px; gap: 24px; align-items: center; padding: 22px 0; transition: padding .35s var(--ease); }
.contents a:hover { padding-left: 14px; }
.contents .n { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); }
.contents .thumb { aspect-ratio: 3 / 2; overflow: hidden; background: var(--dark-2); }
.contents .thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .3s, transform .9s var(--ease); }
.contents a:hover .thumb img { opacity: 1; transform: scale(1.06); }
.contents .t { font-family: var(--serif); font-size: clamp(28px, 3vw, 44px); line-height: 1.05; }
.contents .d { color: var(--muted); }
.contents .c { text-align: right; font-size: 13px; color: var(--muted); }
@media (max-width: 960px) {
  .contents a { grid-template-columns: 40px 1fr 72px; gap: 14px; }
  .contents .thumb { order: 3; }
  .contents .d, .contents .c { display: none; }
}

/* ---------- Chapter opener (full-bleed spread) ---------- */
.opener { position: relative; min-height: min(92vh, 900px); display: flex; align-items: flex-end; overflow: hidden; padding: 0; background: var(--dark); color: var(--dark-ink); }
.opener .bg { position: absolute; inset: 0; }
.opener .bg img { width: 100%; height: 100%; object-fit: cover; }
.opener .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,13,12,.25) 0%, rgba(13,13,12,.35) 40%, rgba(13,13,12,.94) 100%); }
.opener .wrap { position: relative; width: 100%; padding-top: 120px; padding-bottom: clamp(48px, 7vw, 96px); }
.opener .crumb { color: var(--dark-ink); opacity: .8; }
.opener .crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.opener h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(60px, 10vw, 168px); line-height: .9; letter-spacing: -0.02em; margin: 18px 0 22px; max-width: 12ch; }
.opener p { font-size: clamp(18px, 1.6vw, 22px); max-width: 44ch; }

/* Next-chapter band */
.next-chapter { display: block; position: relative; overflow: hidden; background: var(--dark); color: var(--dark-ink); padding: 0; }
.next-chapter .bg { position: absolute; inset: 0; opacity: .35; transition: opacity .5s; }
.next-chapter .bg img { width: 100%; height: 100%; object-fit: cover; }
.next-chapter:hover .bg { opacity: .5; }
.next-chapter .wrap { position: relative; padding-top: clamp(64px, 9vw, 130px); padding-bottom: clamp(64px, 9vw, 130px); }
.next-chapter h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 7vw, 110px); line-height: .95; margin-top: 14px; }

/* Showcase (grid of examples within a chapter) */
.showcase { margin-top: clamp(56px, 7vw, 96px); padding-top: 40px; border-top: 1px solid var(--line); }
.showcase h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.2vw, 46px); line-height: 1.05; margin-top: 8px; }
.showcase p { color: var(--muted); max-width: 60ch; margin-top: 10px; }
.showcase .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
.showcase .grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--bg-2); }

/* ---------- Case study ---------- */
.cs-head { padding: clamp(40px, 6vw, 90px) 0 clamp(32px, 4vw, 56px); }
.cs-head .crumb a { border-bottom: 1px solid transparent; }
.cs-head .crumb a:hover { border-color: currentColor; }
.cs-head h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 7.4vw, 118px); line-height: .94; letter-spacing: -0.02em; margin: 22px 0 0; max-width: 16ch; }
.cs-head .client { margin-top: 28px; }
.cs-head .standfirst { margin-top: 14px; max-width: 54ch; font-size: clamp(19px, 1.7vw, 24px); color: var(--muted); }
.cs-hero { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.cs-hero img { width: 100%; height: 100%; object-fit: cover; }
.cs-hero.contain img { object-fit: contain; }

.cs-body { display: grid; grid-template-columns: 4fr 8fr; gap: 0 clamp(24px, 5vw, 80px); }
.cs-body > .k { padding: 34px 0; border-top: 1px solid var(--line); }
.cs-body > .v { padding: 34px 0; border-top: 1px solid var(--line); }
.cs-body .v p { font-size: clamp(17px, 1.35vw, 19px); max-width: 62ch; }
.cs-body .v p.pull { font-family: var(--serif); font-size: clamp(26px, 2.5vw, 36px); line-height: 1.2; max-width: 30ch; }
@media (max-width: 860px) { .cs-body { grid-template-columns: minmax(0, 1fr); } .cs-body > .v { border-top: 0; padding-top: 4px; } }

.impact { padding-top: clamp(48px, 6vw, 88px); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); border-top: 1px solid var(--line); }
.stats div { padding: 26px 24px 26px 0; border-bottom: 1px solid var(--line); }
.stats strong { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 4.6vw, 72px); line-height: 1; letter-spacing: -0.02em; }
.stats span { display: block; margin-top: 10px; color: var(--muted); font-size: 14px; max-width: 26ch; }
.accolades { margin-top: 28px; display: flex; flex-direction: column; gap: 8px; }
.accolades li { font-family: var(--serif); font-size: clamp(21px, 1.8vw, 26px); line-height: 1.3; }
.accolades li::before { content: "✦"; font-family: var(--sans); font-size: 13px; margin-right: 12px; vertical-align: 3px; }
.notes { margin-top: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.notes li::before { content: "—"; margin-right: 10px; }
.cs-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: clamp(48px, 6vw, 80px); }
.cs-gallery img { width: 100%; height: 100%; object-fit: cover; background: var(--bg-2); }
.cs-gallery img:only-child { grid-column: span 2; }
@media (max-width: 700px) { .cs-gallery { grid-template-columns: minmax(0, 1fr); } .cs-gallery img:only-child { grid-column: auto; } }

.more { border-top: 1px solid var(--line); }
.more .works { row-gap: 40px; }
.more .work { grid-column: span 4; }
@media (max-width: 860px) { .more .work { grid-column: span 12; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.portrait { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; background: var(--bg-2); }
.about-copy .lead { font-family: var(--serif); font-size: clamp(28px, 2.8vw, 40px); line-height: 1.15; }
.about-copy p { font-size: clamp(17px, 1.35vw, 19px); margin-top: 22px; max-width: 58ch; }
.about-copy .role-line { margin-top: 26px; }
.recognition { margin-top: 44px; }
.rec-intro { margin-top: 10px !important; font-size: 15px !important; color: var(--muted); }
.awards { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; border-top: 1px solid var(--line); }
.awards li { display: flex; flex-direction: column; gap: 1px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.awards b { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.2; }
.awards span { font-size: 13px; color: var(--muted); }
.rec-note { margin-top: 16px !important; font-size: 14px !important; color: var(--muted); max-width: 62ch; }
@media (max-width: 600px) { .awards { grid-template-columns: minmax(0, 1fr); } }
.cv-label { margin-top: 44px; }
.cv { border-top: 1px solid var(--line); margin-top: 14px; }
.cv-co { padding: 18px 0; border-bottom: 1px solid var(--line); }
.cv-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.cv-head strong { font-family: var(--serif); font-weight: 400; font-size: 24px; }
.cv-head em { color: var(--muted); font-size: 14px; }
.cv-head span { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.cv-co ul { margin-top: 6px; }
.cv-co ul li { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; font-size: 15px; }
.cv-co ul li span:last-child { color: var(--muted); white-space: nowrap; font-size: 14px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: minmax(0, 1fr); } .portrait { max-width: 220px; } }

/* ---------- Contact ---------- */
.contact h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 9vw, 150px); line-height: .92; letter-spacing: -0.02em; max-width: 11ch; }
.contact h2 em { font-style: italic; }
.contact .open-to { margin-top: 28px; max-width: 54ch; font-size: clamp(17px, 1.4vw, 20px); color: var(--muted); }
.contact .open-to strong { color: var(--dark-ink); font-weight: 500; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 26px; border: 1px solid currentColor; font-size: 15px; transition: background .25s, color .25s; }
.btn.solid { background: var(--dark-ink); color: var(--dark); border-color: var(--dark-ink); }
.btn:hover { background: var(--dark-ink); color: var(--dark); }
.btn.solid:hover { background: transparent; color: var(--dark-ink); }

/* ---------- Footer ---------- */
footer { padding: 28px 0; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dark + footer, footer.dark { background: var(--dark); color: var(--dark-muted); border-top-color: var(--dark-line); }

/* ---------- Phones ---------- */
@media (max-width: 520px) {
  .logo { font-size: 11px; letter-spacing: .2em; }
  .nav-links { gap: 16px; font-size: 13px; }
}

/* Keep the hover alive between "Work" and its menu: the trigger fills the nav's height */
.nav-work { height: var(--nav-h); display: flex; align-items: center; }

/* Nav on narrow phones: never wrap, shorter contact label */
.nav-links a { white-space: nowrap; }
.nav-links .short { display: none; }
@media (max-width: 420px) {
  .logo { letter-spacing: .14em; }
  .nav-links { gap: 14px; }
  .nav-links .long { display: none; }
  .nav-links .short { display: inline; }
}

/* Phones: the whole contents table fits on one screen when you tap "Work" */
@media (max-width: 600px) {
  #contents { padding-top: 20px; }
  #contents .head { margin-bottom: 4px; padding-bottom: 12px; border-bottom: 0; }
  #contents .head h2 { font-size: 34px; }
  .contents a { grid-template-columns: 28px 1fr 48px; gap: 12px; padding: 9px 0; }
  .contents a:hover { padding-left: 0; }
  .contents .n { font-size: 15px; }
  .contents .t { font-size: 23px; line-height: 1.1; }
  .contents .thumb { aspect-ratio: 3 / 2; }
}

/* Desktop: the whole contents table fits on one laptop screen (1440×800) when you click "Work" */
@media (min-width: 601px) {
  #contents { padding-top: clamp(24px, 3vw, 40px); padding-bottom: clamp(40px, 5vw, 72px); }
  #contents .head { margin-bottom: 0; padding-bottom: 14px; border-bottom: 0; }
  #contents .head h2 { font-size: clamp(36px, 3.6vw, 52px); }
  .contents a { grid-template-columns: 56px 72px 1.1fr 1.3fr 80px; gap: 22px; padding: 10px 0; }
  .contents .t { font-size: clamp(24px, 2.2vw, 32px); }
  .contents .d { font-size: 14px; line-height: 1.45; }
}
@media (min-width: 601px) and (max-width: 960px) {
  .contents a { grid-template-columns: 40px 1fr 72px; }
}

/* Tall photos: thumbnails crop towards the top (where faces usually are) */
.work .pic img[data-shape="portrait"], .contents .thumb img[data-shape="portrait"] { object-position: 50% 22%; }
/* Case study hero: tall and square images are shown whole, centred on a soft band */
.cs-hero.shape-portrait, .cs-hero.shape-square { aspect-ratio: auto; display: flex; justify-content: center; padding: clamp(20px, 3vw, 40px); }
.cs-hero.shape-portrait img, .cs-hero.shape-square img { width: auto; height: auto; max-width: 100%; max-height: min(78vh, 820px); object-fit: contain; }
/* Phone mockups: whole phones in a row, no cropping */
.showcase .grid.phones { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
.showcase .grid.phones img { aspect-ratio: auto; height: auto; object-fit: contain; background: none; }

/* Cover layout: named areas so phones can reorder the pieces.
   Desktop: title + intro on the left, spinner on the right (as before). */
.cover-grid { grid-template-areas: "title spin" "intro spin"; grid-template-rows: auto auto; row-gap: 0; }
.cover-grid > h1 { grid-area: title; align-self: end; }
.cover-grid > .intro { grid-area: intro; align-self: start; }
.cover-grid > .spinner { grid-area: spin; align-self: center; }
@media (max-width: 900px) {
  .cover-grid { grid-template-areas: "title" "spin" "intro"; row-gap: 28px; }
  .cover-grid > .intro { margin-top: 0; }
}
/* Phones: the title sits on exactly two lines, sized to the screen width */
@media (max-width: 600px) {
  .cover { padding-top: 28px; }
  .cover h1 { font-size: clamp(24px, calc((100vw - 32px) * 0.09), 40px); line-height: 1.02; }
}

/* Full-width card (odd piece out at the end of Selected work) */
.work.wide { grid-column: span 12; }
.work.wide .pic { aspect-ratio: 21 / 9; }
@media (max-width: 860px) { .work.wide .pic { aspect-ratio: 4 / 3; } }
