/* 1238 St. James Place — project pages (B Pagez, BSSMNT, …).
   Same paper, ink and hand as the main site. Shared here: the top menu (hamburger on phones),
   type, buttons, index cards, the sketch-to-reality screens and the Light | Dark switch. */
@font-face { font-family: "Tag"; src: url("../type/aAnotherTag.otf") format("opentype"), url("../type/aAnotherTag.ttf") format("truetype"); font-display: swap; }
:root {
  --paper: #F4F4F0; --ink: #040A00; --slate: #2D4649; --cyan: #43F0FF; --yellow: #FFFF02; --orange: #FF6A00;
  --hand: 'Architects Daughter', cursive; --sans: 'Josefin Sans', sans-serif; --marker: 'Permanent Marker', cursive;
  --gut: clamp(16px, 4vw, 56px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper) url("../textures/paper.png") 0 0 / 256px 256px repeat; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--ink); }
img { display: block; max-width: 100%; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gut); }

/* ---------- Top menu: handwritten (Architects Daughter); a hamburger of brush strokes on phones ---------- */
.menu { position: sticky; top: 0; z-index: 50; background: var(--paper) url("../textures/paper.png") 0 0 / 256px 256px repeat; border-bottom: 2px solid transparent; transition: border-color .2s; }
.menu.is-stuck { border-bottom-color: rgba(4,10,0,.12); }
.menu .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 68px; }
.menu .home { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--hand); font-size: 18px; white-space: nowrap; }
.menu .home img { width: 28px; }
.menu nav ul { display: flex; gap: clamp(14px, 2vw, 30px); margin: 0; padding: 0; list-style: none; }
.menu nav a { position: relative; z-index: 0; display: inline-block; padding: 6px 2px; font-family: var(--hand); font-size: 18px; text-decoration: none; white-space: nowrap; }
/* The marker stroke under the current page, and drawn in on hover */
.menu nav a::after { content: ""; position: absolute; left: -6px; right: -8px; bottom: -2px; height: 12px; z-index: -1;
  background: url("../masks/marker-stroke.png") 0 50% / 100% 100% no-repeat; clip-path: inset(0 100% 0 0); transition: clip-path .35s ease-out; }
.menu nav a:hover::after, .menu nav a:focus-visible::after, .menu nav a[aria-current="page"]::after { clip-path: inset(0 0 0 0); }
.menu nav .ext::before { content: "↗ "; font-size: .8em; }
.burger { display: none; position: relative; width: 46px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; }
/* Each bar is a brush stroke: a marker-stroke image used as a mask, filled with ink */
.burger span { position: absolute; left: 3px; right: 3px; height: 9px; background: var(--ink);
  -webkit-mask: url("../masks/marker-stroke.png") 0 50% / 100% 100% no-repeat; mask: url("../masks/marker-stroke.png") 0 50% / 100% 100% no-repeat;
  transition: transform .3s ease, opacity .2s; }
.burger span:nth-child(1) { top: 7px; transform: rotate(-2deg); }
.burger span:nth-child(2) { top: 16px; transform: scaleX(-1) rotate(1deg); right: 8px;
  -webkit-mask-image: url("../../marker-stroke-mulhdku0-zjrv.png"); mask-image: url("../../marker-stroke-mulhdku0-zjrv.png"); }
.burger span:nth-child(3) { top: 25px; transform: rotate(1.5deg); left: 7px;
  -webkit-mask-image: url("../../marker-stroke-mulhshi1-dhrm.png"); mask-image: url("../../marker-stroke-mulhshi1-dhrm.png"); }
.menu.is-open .burger span:nth-child(1) { transform: translateY(9px) rotate(42deg); }
.menu.is-open .burger span:nth-child(2) { opacity: 0; }
.menu.is-open .burger span:nth-child(3) { transform: translateY(-9px) rotate(-40deg); }

@media (max-width: 1100px) {
  .burger { display: block; }
  .menu nav { position: fixed; inset: 68px 0 0 0; background: var(--paper) url("../textures/paper.png") 0 0 / 256px 256px repeat;
    padding: 28px var(--gut) 40px; overflow-y: auto; visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility 0s .2s; }
  .menu.is-open nav { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .2s; }
  .menu nav ul { flex-direction: column; gap: 6px; }
  .menu nav a { font-size: 30px; padding: 8px 2px; }
  .menu nav a::after { height: 18px; bottom: 2px; }
  .menu nav li:nth-child(odd) a { transform: rotate(-1.5deg); }
  .menu nav li:nth-child(even) a { transform: rotate(1deg); }
  body.menu-open { overflow: hidden; }
}

/* ---------- Type ---------- */
.label { font-family: var(--hand); font-style: italic; text-transform: uppercase; font-size: 15px; letter-spacing: .02em; margin: 0 0 14px; }
h2 { font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: clamp(30px, 4vw, 54px); line-height: 1.02; margin: 0 0 20px; }
p.body { font-size: clamp(16px, 1.35vw, 19px); line-height: 1.5; max-width: 60ch; margin: 0 0 14px; }
.note { font-family: var(--hand); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.35; transform: rotate(-3deg); }
.caption { font-family: var(--hand); font-size: 15px; transform: rotate(-2deg); }
section { padding: clamp(48px, 8vw, 110px) 0; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 80px); align-items: center; padding: clamp(28px, 6vw, 80px) 0 clamp(40px, 6vw, 80px); }
.hero.wide { grid-template-columns: .85fr 1.15fr; }
.lockup { position: relative; display: inline-block; }
.lockup h1 { margin: 0; font-family: "Tag", var(--marker); font-weight: 400; font-size: clamp(84px, 13vw, 190px); line-height: .9; letter-spacing: .01em; position: relative; z-index: 1; }
.swash { position: absolute; left: -4%; right: -6%; bottom: 8%; height: 26%; background: var(--cyan); border-radius: 40% 60% 55% 45% / 60% 40% 60% 40%; transform: rotate(-3deg) scaleX(0); transform-origin: left center; z-index: 0; }
.is-on .swash { transform: rotate(-3deg) scaleX(1); transition: transform .9s cubic-bezier(.65,0,.35,1) .3s; }
.hero .lede { font-size: clamp(20px, 2vw, 28px); font-weight: 600; line-height: 1.2; max-width: 24ch; margin: 22px 0 14px; }
.hero .sub { font-size: clamp(16px, 1.4vw, 19px); line-height: 1.45; max-width: 46ch; margin: 0; }
.hero .note { margin-top: 26px; display: flex; align-items: center; gap: 12px; }
.hero .note svg { width: 92px; height: 40px; flex: none; }
.alpha { display: inline-block; font-family: var(--hand); text-transform: uppercase; font-size: 14px; border: 2px solid var(--ink); padding: 4px 10px 2px; transform: rotate(-2deg); background: var(--yellow); }

/* ---------- Buttons ---------- */
.cta { display: inline-block; margin-top: 28px; font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 16px; text-decoration: none; color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); padding: 14px 22px 11px; box-shadow: 5px 5px 0 var(--ink); transform: rotate(-1deg); transition: transform .15s, box-shadow .15s; cursor: pointer; }
.cta:hover, .cta:focus-visible { transform: rotate(-1deg) translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.cta.plain { background: #fff; }

/* ---------- Sketch to reality: a pencil sketch over the real screen, rubbed away as it comes in ---------- */
.shot-col { display: grid; justify-items: center; gap: 16px; }
.phone { position: relative; width: min(340px, 78vw); aspect-ratio: 390 / 770; border: 3px solid var(--ink); border-radius: 34px; padding: 10px; background: #fff; box-shadow: 10px 12px 0 rgba(4,10,0,.12); transform: rotate(2deg); }
.phone.alt { transform: rotate(-2.5deg); }
.phone::after { content: ""; position: absolute; left: 50%; top: 4px; width: 22%; height: 7px; border-radius: 0 0 8px 8px; background: var(--ink); transform: translateX(-50%); }
.laptop { position: relative; width: 92%; max-width: 720px; transform: rotate(-1.5deg); }
.laptop .lid { border: 3px solid var(--ink); border-radius: 14px 14px 4px 4px; padding: 10px; background: #fff; box-shadow: 10px 12px 0 rgba(4,10,0,.12); aspect-ratio: 1600 / 1000; }
.laptop .base { height: 16px; margin: 0 -5%; border: 3px solid var(--ink); border-top: 0; border-radius: 0 0 16px 16px; background: #fff; position: relative; }
.laptop .base::after { content: ""; position: absolute; left: 42%; right: 42%; top: 0; height: 5px; border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 6px 6px; }
/* A print taped to the page (posters, covers) */
.print { position: relative; width: min(400px, 80vw); background: #fff; border: 2px solid var(--ink); padding: 12px; box-shadow: 10px 12px 0 rgba(4,10,0,.12); transform: rotate(-2deg); }
.print.alt { transform: rotate(2.5deg); }
.print::before { content: ""; position: absolute; left: 50%; top: -12px; z-index: 2; width: 90px; height: 24px; background: rgba(67,240,255,.55); transform: translateX(-50%) rotate(-4deg); }
.print .screen { border-radius: 0; aspect-ratio: var(--ar, 2 / 3); }
.screen { position: relative; width: 100%; height: 100%; border-radius: 24px; overflow: hidden; background: #fff; }
.laptop .screen { border-radius: 4px; }
.screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.screen .sketch { clip-path: polygon(-30% 0, 130% 0, 130% 100%, -30% 100%); }
.is-real .sketch { clip-path: polygon(130% 0, 130% 0, 130% 100%, 100% 100%); transition: clip-path 1.8s cubic-bezier(.65,0,.35,1) .2s; }

/* Light | Dark, lettered like the main site's Process | Result */
.mode { display: inline-flex; gap: 6px; align-items: center; font-family: var(--hand); font-size: 17px; text-transform: uppercase; }
.mode button { font: inherit; text-transform: inherit; background: none; border: 0; padding: 4px 6px 2px; cursor: pointer; color: var(--ink); position: relative; z-index: 0; opacity: .55; }
.mode button[aria-pressed="true"] { opacity: 1; }
.mode button[aria-pressed="true"]::after { content: ""; position: absolute; left: -4px; right: -6px; bottom: -4px; height: 12px; z-index: -1; background: url("../masks/marker-stroke.png") 0 50% / 100% 100% no-repeat; }

/* ---------- Index cards pinned to the page ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 22px; margin-top: 10px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card { background: #fff; border: 2px solid var(--ink); padding: 22px 22px 18px; box-shadow: 6px 6px 0 rgba(4,10,0,.14); position: relative; }
.card:nth-child(4n+1) { transform: rotate(-1.2deg); } .card:nth-child(4n+2) { transform: rotate(.9deg); } .card:nth-child(4n+3) { transform: rotate(.6deg); } .card:nth-child(4n) { transform: rotate(-.8deg); }
.card::before { content: ""; position: absolute; left: 50%; top: -11px; width: 64px; height: 20px; background: rgba(67,240,255,.55); transform: translateX(-50%) rotate(-3deg); }
.card h3 { font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 19px; margin: 4px 0 8px; }
.card p { margin: 0 0 8px; font-size: 15px; line-height: 1.4; }
.card ul { margin: 0; padding: 0; list-style: none; font-family: var(--hand); font-size: 15.5px; line-height: 1.5; }
.card li::before { content: "— "; }
.card .tail { font-family: var(--hand); font-size: 14px; margin-top: 10px; color: var(--slate); }

/* ---------- Highlighter and write-on ---------- */
.hl { background: linear-gradient(transparent 52%, var(--yellow) 52%, var(--yellow) 90%, transparent 90%) no-repeat 0 0 / 0% 100%; }
.is-on .hl, .is-on.hl { background-size: 100% 100%; transition: background-size 1.2s cubic-bezier(.65,0,.35,1) .4s; }
.write { clip-path: inset(-20% 100% -20% -5%); }
.is-on .write, .is-on.write { clip-path: inset(-20% -5% -20% -5%); transition: clip-path 1.1s steps(18, end) .5s; }

/* ---------- Dark closing section ---------- */
.closing { background: var(--ink); color: var(--paper); border-radius: 26px 26px 0 0; margin-top: 40px; padding-bottom: clamp(60px, 8vw, 110px); }
.closing .label, .closing h2 { color: var(--paper); }
.closing .grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
.closing p.body { color: #E6E6E1; }
.closing .note { color: var(--cyan); }
.closing .cta { box-shadow: 5px 5px 0 var(--cyan); }
.closing .cta:hover { box-shadow: 3px 3px 0 var(--cyan); }
.closing a:not(.cta) { color: var(--paper); }
/* More from 1238: every project page links to the others */
.more { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 56px; padding-top: 28px; border-top: 2px dashed rgba(244,244,240,.35); }
.more a { display: block; text-decoration: none; padding: 16px 18px 14px; border: 2px solid var(--paper); border-radius: 4px; transition: background .15s, color .15s; }
.more a:hover, .more a:focus-visible { background: var(--paper); color: var(--ink); }
.more b { display: block; font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 16px; }
.more span { font-family: var(--hand); font-size: 14px; }
.more a[aria-current] { display: none; }
@media (max-width: 960px) { .more { grid-template-columns: repeat(2, 1fr); } }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 70px; font-family: var(--hand); font-size: 15px; color: #CFCFCA; }

/* ---------- Pop-up (Fluent Form) ---------- */
dialog.form { width: min(720px, calc(100vw - 32px)); height: min(860px, calc(100vh - 48px)); padding: 0; border: 3px solid var(--ink); border-radius: 18px; background: var(--paper); box-shadow: 10px 10px 0 var(--ink); }
dialog.form::backdrop { background: rgba(4,10,0,.6); }
dialog.form .bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 2px solid var(--ink); font-family: var(--hand); text-transform: uppercase; }
dialog.form .bar button { font: 700 22px/1 var(--sans); background: none; border: 0; cursor: pointer; }
dialog.form iframe { width: 100%; height: calc(100% - 58px); border: 0; background: #fff; }
dialog.form .soon { padding: 40px 28px; font-family: var(--hand); font-size: 20px; line-height: 1.5; }

@media (max-width: 960px) {
  .hero, .hero.wide, .closing .grid { grid-template-columns: 1fr; }
  .cards.three { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .cards, .cards.three { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; }
}
