/* Brandon Lepine — personal site. Page layer on top of Nautilus (nautilus.css). */
@property --z { syntax: "<number>"; inherits: false; initial-value: 1; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
.st { max-width: 1240px; margin: 0 auto; padding: 0 40px; box-sizing: border-box; }
.st:last-of-type { padding-bottom: 0; }
.na-nav strong a { color: inherit; text-decoration: none; }
a.na-pill { text-decoration: none; }

/* Scenes. A scene is closed until scrolling brings it into view; then it plays by itself, as one motion. */
.u-frame { position: relative; margin: 0; overflow: hidden; background: #000; --s: 0; clip-path: inset(0 100% 0 0); transition: clip-path 1350ms cubic-bezier(0.7, 0, 0.2, 1) var(--d, 0ms); }
.u-frame[data-unroll="left"] { clip-path: inset(0 0 0 100%); }
.u-frame[data-unroll="down"] { clip-path: inset(0 0 100% 0); }
.u-frame[data-unroll="open"] { clip-path: inset(50% 0); }
.is-open.u-frame, .is-open .u-frame { clip-path: inset(0); }
.u-film { position: absolute; left: 0; top: -8%; width: 100%; height: 116%; object-fit: cover; display: block; --z: 1.3; transition: --z 2300ms cubic-bezier(0.3, 0, 0.1, 1) var(--d, 0ms); transform: translate3d(0, calc(var(--s) * 5%), 0) scale(var(--z)); will-change: transform; }
.is-open.u-frame .u-film, .is-open .u-frame .u-film { --z: 1; }
[data-rise] > * { opacity: 0; transform: translate3d(0, 34px, 0); transition: opacity 800ms ease calc(250ms + var(--i, 0) * 130ms), transform 1100ms cubic-bezier(0.2, 0.9, 0.1, 1) calc(250ms + var(--i, 0) * 130ms); }
.is-open[data-rise] > *, .is-open [data-rise] > * { opacity: 1; transform: none; }

/* Opener */
.st-open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); gap: 64px; align-items: end; padding: 140px 0 48px; }
.st-open h1 { margin: 14px 0 0; font-size: clamp(40px, 4.8vw, 64px); line-height: 1.02; font-weight: 600; letter-spacing: -0.034em; max-width: 12.5em; text-wrap: balance; }
.st-open h1 em { font-family: var(--font-serif); font-weight: 300; font-style: italic; letter-spacing: -0.02em; }
.st-open .u-frame { aspect-ratio: 3 / 4; }

/* Rows of text beside a frame */
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 72px; align-items: center; padding: 128px 0 0; }
.st-row.flip > :first-child { order: 2; }
.st-row .u-frame { aspect-ratio: 4 / 5; }
.st-row.flip .u-frame { aspect-ratio: 5 / 4; }
.st h2 { margin: 12px 0 18px; font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -0.026em; max-width: 13em; text-wrap: balance; }
.st p.b { margin: 0 0 16px; font-size: 17px; line-height: 1.7; color: var(--ink-soft); max-width: 31em; text-wrap: pretty; }
.st p.b i { font-style: italic; }
.st .nt-rows { margin-top: 28px; max-width: 34em; }
.st .nt-rows dd { font-size: 16px; line-height: 1.45; }
.st .nt-rows dd small { font-size: 13.5px; }
.st-strip { aspect-ratio: 16 / 5; margin: 136px 0 0; }

/* Pinned scene: reaching it starts one motion; the page holds while the statement arrives. */
.st-pin { position: relative; height: 190vh; margin-top: 140px; }
.st-pin-in { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; align-items: end; padding: 9vh 6vw; box-sizing: border-box; }
.st-pin-film { position: absolute; inset: 0; margin: 0; overflow: hidden; background: #000; clip-path: inset(50% 34%); transition: clip-path 1000ms cubic-bezier(0.7, 0, 0.2, 1); }
.st-pin.is-open .st-pin-film { clip-path: inset(30% 34%); }
.st-pin.is-full .st-pin-film { clip-path: inset(0); transition: clip-path 1500ms cubic-bezier(0.75, 0, 0.15, 1); }
.st-pin-film .u-film { top: 0; height: 100%; --z: 1.5; transform: scale(var(--z)); transition: --z 2400ms cubic-bezier(0.4, 0, 0.1, 1); }
.st-pin.is-open .u-film { --z: 1.4; } .st-pin.is-full .u-film { --z: 1; }
.st-pin-in::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0) 85%); opacity: 0; transition: opacity 900ms ease; pointer-events: none; }
.st-pin.is-full .st-pin-in::after { opacity: 1; transition-delay: 900ms; }
.st-pin p { position: relative; z-index: 1; margin: 0; max-width: 12em; font-family: var(--font-serif); font-weight: 300; font-size: clamp(40px, 5.4vw, 84px); line-height: 1.02; letter-spacing: -0.022em; color: #f1efe9; }
.st-pin p span { display: inline-block; opacity: 0; transform: translateY(0.35em); transition: opacity 200ms ease, transform 200ms ease; }
.st-pin.is-full p span { opacity: 1; transform: none; transition: opacity 520ms ease calc(1050ms + var(--w) * 95ms), transform 760ms cubic-bezier(0.2, 0.9, 0.1, 1) calc(1050ms + var(--w) * 95ms); }

/* Section head for parts without a frame */
.st-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 64px; align-items: end; padding: 128px 0 44px; border-bottom: 1px solid var(--line); margin-bottom: 44px; }
.st-head h2 { margin-bottom: 0; }
.st-head .na-lead { margin: 0; font-size: 17px; }
.st .nt-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 40px; }
.st .nt-card-title { font-size: 22px; }
div.nt-card:hover { border-top-color: var(--ink); }

/* About: a small frame beside the voice */
.st-end { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 72px; align-items: start; padding: 136px 0 0; }
.st-end .u-frame { aspect-ratio: 3 / 4; position: sticky; top: 110px; }
.st-end blockquote { margin: 14px 0 8px; font-family: var(--font-serif); font-weight: 300; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -0.016em; max-width: 15em; }
.st-end blockquote i { font-style: italic; }

/* Contact */
.st-contact { padding: 136px 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: end; }
.st-contact h2 { margin-bottom: 10px; }
.st-contact p.b { margin: 0; }
.st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

.st-foot { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 40px; margin-top: 28px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-muted); }
.st-foot a { color: inherit; }

@media (max-width: 900px) {
  .st { padding: 0 20px; }
  .st-open, .st-row, .st-end, .st-head, .st-contact { grid-template-columns: 1fr; gap: 32px; }
  .st-open { padding-top: 112px; }
  .st-open .u-frame { aspect-ratio: 4 / 3; }
  .st-row { padding-top: 96px; }
  .st-row.flip > :first-child { order: 0; }
  .st-end .u-frame { position: relative; top: 0; aspect-ratio: 16 / 9; }
  .st .nt-cards { grid-template-columns: 1fr; gap: 44px; }
  .st-strip { aspect-ratio: 16 / 7; margin-top: 96px; }
  .st-foot { flex-direction: column; }
  .st .nt-rows > div { grid-template-columns: 1fr; row-gap: 4px; }
  .st .nt-rows dt { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .u-frame, .st-pin-film { clip-path: none !important; transition: none !important; }
  .u-film { --z: 1 !important; }
  [data-rise] > *, .st-pin p span { opacity: 1 !important; transform: none !important; }
  .st-pin { height: auto; } .st-pin-in { position: relative; } .st-pin-in::after { opacity: 1; }
}

/* Grades bring a clip onto the palette */
.g-darker { filter: brightness(0.66) contrast(1.18); }
.g-bone { filter: grayscale(1) sepia(0.2) contrast(1.35) brightness(0.9); }
.g-warm { filter: sepia(0.8) saturate(2.4) hue-rotate(-20deg) contrast(1.12) brightness(0.88); }
/* Light theme: the same clips turned over. Black becomes paper and the film is multiplied into the page. */
html[data-theme="washi"] .u-film { filter: invert(1) hue-rotate(180deg) contrast(1.06); mix-blend-mode: multiply; }
html[data-theme="washi"] .g-bone { filter: grayscale(1) invert(1) contrast(1.15); }
html[data-theme="washi"] .u-frame { background: var(--paper); }
html[data-theme="washi"] .st-pin-film { background: var(--paper); }
html[data-theme="washi"] .st-pin-in::after { background: linear-gradient(90deg, rgba(241,239,233,0.9) 0%, rgba(241,239,233,0.4) 55%, rgba(241,239,233,0) 85%); }
html[data-theme="washi"] .st-pin p { color: #0b0b0b; }
