/* Project pages: new nav + footer, hero order, section rail (rail is an ADDITION, in-page titles stay).
   Everything is scoped to body.pj so the old shared CSS keeps working. */
body.pj {
  --pj-accent: #4a7c8c; --ink: #26262b; --mute: #6b6b73; --soft: #8b8b96; --accent: #c9545c;
  --pad: clamp(20px, 5vw, 64px);
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; /* labels use DM Sans too: the site uses two fonts only */
  margin: 0; background: #fff; color: var(--ink); font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- nav ---------- */
body.pj > nav, body.pj > .back-arrow { display: none; }
.pj-nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid #f0ecec; padding: 18px var(--pad, clamp(20px, 5vw, 64px)); }
.pj-nav-in { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.pj-logo { display: block; width: 56px; height: auto; }
.pj-links { display: inline-flex; align-items: center; gap: 28px; }
.pj-links > a:not(.pj-connect) { position: relative; color: var(--ink); text-decoration: none; transition: color .2s ease; }
.pj-links > a:not(.pj-connect):hover { color: var(--accent); }
.pj-links > a.is-active::after { content: ''; position: absolute; left: 50%; bottom: -10px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.pj-connect {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
  border: 1px solid rgba(155,176,206,.3); border-radius: 30px; font-weight: 500; font-size: 14.4px; letter-spacing: .025em; color: var(--ink); text-decoration: none;
  background: linear-gradient(135deg, rgba(255,255,255,.8), rgba(255,255,255,.6)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(155,176,206,.15), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(155,176,206,.1);
  transition: all .4s cubic-bezier(.23,1,.32,1);
}
.pj-connect::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent); transition: left .6s ease; }
.pj-connect:hover::before { left: 100%; }
.pj-connect:hover { border-color: #9bb0ce; color: #9bb0ce; transform: translateY(-2px); box-shadow: 0 12px 40px rgba(155,176,206,.25), inset 0 1px 0 rgba(255,255,255,.6), inset 0 -1px 0 rgba(155,176,206,.2); }
.pj-connect svg { transition: transform .3s ease; }
.pj-connect:hover svg { transform: translate(2px, -2px); }

/* ---------- hero: back link, title, image, meta ---------- */
body.pj main.project-page { display: block; max-width: none; width: 100%; margin: 0; padding: 0; }
body.pj .project-hero { text-align: left; align-items: stretch; display: flex; flex-direction: column; gap: 0; padding: 40px 64px 0; margin: 0; border: 0; }
.pj-back { order: 0; font: 400 12px/1 var(--mono); letter-spacing: 1.5px; color: var(--soft); text-decoration: none; text-transform: uppercase; align-self: flex-start; transition: color .2s ease; }
.pj-back:hover { color: var(--pj-accent); }
body.pj .project-header-content { display: contents; }
body.pj .project-text-content { order: 1; width: 100%; margin: 36px 0 0; padding: 0; border: 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
body.pj .project-page-title { font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 8.75vw, 112px); line-height: 1; letter-spacing: -0.01em; color: var(--ink); margin: 0; }
body.pj .project-tagline { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 3vw, 38px); line-height: 1.2; color: var(--pj-accent); margin: 18px 0 0; max-width: 28ch; }
body.pj .project-hero-image { order: 2; margin: 48px 0 0; max-width: none; border-radius: 10px; box-shadow: 0 20px 40px rgba(38,38,43,.1); overflow: hidden; }
body.pj .project-meta-info { order: 3; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin: 48px 0 0; padding: 0; width: auto; border: 0; }
body.pj .meta-item { display: block; text-align: left; border-top: 1px solid #eee9e9; padding-top: 18px; }
body.pj .meta-label { display: block; font: 400 12px/1.2 var(--mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--soft); }
body.pj .meta-value { display: block; font-size: 17px; line-height: 1.5; margin-top: 8px; color: var(--ink); white-space: pre-line; }

/* ---------- sections sit right of the rail column ---------- */
body.pj .project-page > section { padding-left: 388px; padding-right: 64px; padding-top: 56px; padding-bottom: 0; margin: 0; max-width: none; box-sizing: border-box; }
body.pj .project-page > section.project-content > * { max-width: 860px; }
body.pj .project-content { text-align: left; }
body.pj .section-label { font-family: var(--mono); font-weight: 400; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--pj-accent); display: block; margin-bottom: 14px; }
body.pj h1, body.pj h2 { font-family: var(--serif); font-weight: 400; }
body.pj .project-page > section h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.15; }
/* body copy is the ink colour; gradient/bold emphasis from each page stays as originally written */
body.pj { --gray: var(--ink); } /* body copy that used the old gray now reads as ink; coloured callouts keep their own colours */
body.pj .project-page strong, body.pj .project-page b { font-weight: 600; }
.pj-spacer { height: 110px; }

/* ---------- section rail ---------- */
.pj-rail { position: fixed; left: 64px; top: 140px; width: 230px; z-index: 20; opacity: 0; transform: translateX(-8px); pointer-events: none; transition: opacity .4s ease, transform .4s ease; will-change: top; }
.pj-rail.on { opacity: 1; transform: none; }
.pj-rail .hl { position: absolute; left: 4px; top: 8px; width: 1px; background: #e3dddd; }
.pj-rail .dt { position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--pj-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--pj-accent) 18%, transparent); transition: transform .12s linear; }
.pj-rail a { position: relative; display: block; height: 34px; line-height: 17px; padding: 0 0 0 28px; font: 400 10.5px/17px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: #9a9aa5; text-decoration: none; transition: color .3s ease; }
.pj-rail.on a { pointer-events: auto; }
.pj-rail a.a { color: var(--ink); }
.pj-rail a:hover { color: var(--pj-accent); }

/* ---------- footer (same as home) ---------- */
body.pj .site-footer { margin-top: 0; padding: 36px 0 56px; background: linear-gradient(0deg, rgba(255,255,255,0) 0%, #fff 62%), radial-gradient(ellipse at 88% 105%, #f9e1d5 0%, transparent 55%), radial-gradient(ellipse at 52% 112%, #f5d6d8 0%, transparent 50%), radial-gradient(ellipse at 10% 100%, #f4d9dc 0%, transparent 55%), #fff; }
body.pj .footer-inner { max-width: 1520px; margin: 0 40px; padding: 40px 64px 72px; border-top: 1px solid #eee9e9; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; position: relative; }
@media (min-width: 1600px) { body.pj .footer-inner { margin-inline: auto; } }
body.pj .footer-contact { width: 340px; flex: none; }
body.pj .footer-sig { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; }
body.pj .sig { position: relative; display: inline-block; font-size: 14px; color: #9ca3af; cursor: pointer; transition: color .3s ease, transform .3s ease; }
body.pj .sig:hover, body.pj .sig:focus-visible { color: var(--accent); transform: translateY(-2px); outline: none; }
body.pj .sig-tip { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff; padding: 8px 12px; border-radius: 4px; font-size: 12px; white-space: nowrap; opacity: 0; visibility: hidden; transition: all .3s ease; }
body.pj .sig:hover .sig-tip, body.pj .sig:focus-visible .sig-tip { opacity: 1; visibility: visible; margin-bottom: 8px; }
body.pj .footer-brand { display: flex; align-items: center; gap: 20px; }
body.pj .footer-brand img { display: block; width: 60px; height: auto; }
body.pj .footer-name { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 3.6vw, 46px); line-height: 1; }
body.pj .footer-local { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 17px; color: var(--soft); }
body.pj .footer-local svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
body.pj .footer-note { margin: 0; font-size: 19px; line-height: 1.4; color: var(--soft); }
body.pj .footer-email { display: inline-block; margin-top: 6px; font-size: 21px; color: var(--ink); text-decoration: none; transition: color .2s ease; }
body.pj .footer-email:hover { color: var(--accent); }
body.pj .footer-links { display: flex; gap: 18px; margin-top: 18px; }
body.pj .footer-links a { color: #c3c6d4; transition: color .25s ease, transform .25s ease; }
body.pj .footer-links a:hover { color: var(--accent); transform: translateY(-2px); }
body.pj .footer-links svg { display: block; width: 32px; height: 32px; fill: currentColor; }
body.pj .footer-links svg.stroke { fill: none; stroke: currentColor; }
[hidden] { display: none !important; }

/* ---------- narrower screens: no rail, content back to full width ---------- */
@media (max-width: 1100px) {
  .pj-rail { display: none; }
  body.pj .project-page > section { padding-left: 32px; padding-right: 32px; padding-top: 64px; }
  body.pj .project-hero { padding: 32px 24px 0; }
  body.pj .project-text-content { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) { .pj-links { gap: 16px; font-size: 15px; } .pj-connect { padding: 10px 20px; font-size: 14px; } body.pj .footer-inner { flex-direction: column; gap: 28px; margin: 0 16px; padding: 32px 24px 72px; } body.pj .footer-contact { width: auto; } }

/* Arycs hero logo panel sits between the title and the meta row, like the other pages */
body.pj .arycs-hero { order: 2; margin: 48px 0 0; max-width: none; width: 100%; }

/* stacked case-study blocks (Seals) get the same breathing room as the other pages */
body.pj .project-content > .project-overview + .project-overview { margin-top: 48px; margin-bottom: 0; }

@media (max-width: 480px) { .pj-connect { padding: 8px 16px; font-size: 13px; gap: 6px; } .pj-connect svg { width: 14px; height: 14px; } }

/* the old block-level .reveal is replaced by the per-element load-in (css/reveal.css) */
body.pj .reveal { opacity: 1; transform: none; transition: none; }

/* top image fills its frame edge to edge (no letterbox bands, no height cap) */
body.pj .project-hero-image img { display: block; width: 100%; height: auto; max-height: none; object-fit: cover; }
/* Arycs: the logo is zoomed in to fill more of its panel */
body.pj .arycs-hero img { width: 62%; max-width: none; }
@media (max-width: 800px) { body.pj .arycs-hero img { width: 78%; } }

/* prototype / GitHub / preview buttons get the connect button's sweep + lift + arrow nudge */
body.pj :is(.prototype-button, .blue-prototype-button, .red-prototype-button) { position: relative; overflow: hidden; transition: all .4s cubic-bezier(.23,1,.32,1); }
body.pj :is(.prototype-button, .blue-prototype-button, .red-prototype-button)::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent); transition: left .6s ease; pointer-events: none; }
body.pj :is(.prototype-button, .blue-prototype-button, .red-prototype-button):hover::before { left: 100%; }
body.pj :is(.prototype-button, .blue-prototype-button, .red-prototype-button):hover { transform: translateY(-2px); }
body.pj :is(.prototype-button, .blue-prototype-button, .red-prototype-button) svg { transition: transform .3s ease; }
body.pj :is(.prototype-button, .blue-prototype-button, .red-prototype-button):hover svg { transform: translate(2px, -2px); }

/* the old entrance animation held the button at translateY(0) forever, which blocked the hover lift */
body.pj :is(.prototype-button, .blue-prototype-button, .red-prototype-button) { animation: none; }

/* less empty space under the signature line */
body.pj .site-footer { padding-bottom: 14px; }
