/* maxmorrish.com home: Second State's poster system, in the family tokens (tokens/family.css).
   Hot red on black, a plate whose subject stands in front of the giant word, small red labels in the
   corners, sheets that each open on a corner row and a giant title. Voice (Cook Conthic) for anything set
   large or as a label, Libre Caslon for reading. No rounded corners and no tweens: hovers invert, titles
   cut in. Home loads /poster.css (the system every page shares) first, then this file; never style.css. */

.hero .grain{opacity:.5}   /* the poster is sandier than the sheets, as on the Conthic specimen */

/* ---------- Hero poster ---------- */
.hero{position:relative;height:100svh;min-height:560px;overflow:hidden;background:var(--black);isolation:isolate}
/* The stage keeps the plate's own aspect and covers the hero, so the word and the plate always line up.
   --wx/--wy/--ww place the word (and the opener, which shares its box) in stage units. */
.stage{--arn:1.7778;--wx:7cqw;--wy:15cqh;--ww:86cqw;
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:max(100vw,calc(max(100svh,560px) * var(--arn)));aspect-ratio:2000/1125;container-type:size}
.cam{position:absolute;inset:0;transform-origin:50% 50%}
.cam>img{position:absolute;inset:0;width:100%;height:100%}
.stage-fg{z-index:2}
.word{position:absolute;z-index:1;left:var(--wx);top:var(--wy);width:var(--ww);margin:0;line-height:0;color:var(--red)}
.word-art{display:block;width:100%;height:auto;overflow:visible}
.hero::after{content:"";position:absolute;inset:0;z-index:3;pointer-events:none;
  background:linear-gradient(to bottom,rgba(5,3,3,.6) 0,rgba(5,3,3,0) 12%,rgba(5,3,3,0) 82%,rgba(5,3,3,.75) 100%)}
.corners-top,.corners-bottom{position:absolute;left:var(--pad);right:var(--pad);z-index:5}
.corners-top{top:var(--pad)}
.corners-bottom{bottom:var(--pad);align-items:end}
.nav{display:flex;gap:clamp(16px,2.2vw,32px)}
.nav a{text-decoration:none}
.nav a:hover{color:var(--paper)}
.mark{display:block;line-height:0}
.hero-line{max-width:none}
.nowrap{white-space:nowrap}
.nav a{padding:6px 0}

/* ---------- Opener ----------
   The sigil draws itself, pares down to its upright on the blade, and the dark splits along it (home.js).
   The line art shares the word's box, its upright on the render's blade. Shown only when the head script set
   .intro-on (JS, first visit this session, motion allowed); without JS it never shows. */
.intro{display:none}
.intro-on .intro{display:block;position:absolute;inset:0;z-index:6;background:var(--black)}
.intro-art{position:absolute;left:var(--wx);width:var(--ww);top:calc(var(--wy) - var(--ww) * 760 / 2718);overflow:visible}
.intro .is,.intro .spine{fill:none;stroke:var(--red);stroke-width:14;stroke-linejoin:miter;stroke-miterlimit:8;stroke-linecap:square}
.intro .is{stroke-dasharray:1;stroke-dashoffset:1}
.intro .spine{opacity:0}
.intro .lid{position:absolute;top:0;bottom:0;background:var(--black)}
.intro .lid::after{content:"";position:absolute;top:0;bottom:0;width:1px;background:var(--red);opacity:var(--edge,0)}
.intro .lid-l::after{right:0}
.intro .lid-r::after{left:0}
/* until the script reveals them, the hero's parts wait under the opener */
.intro-on .cam{visibility:hidden;animation:intro-back 0s 4s forwards}
.intro-on.intro-cam .cam{visibility:visible}
.intro-on .hero>:not(.stage):not(.intro-skip){visibility:hidden;animation:intro-back 0s 4s forwards}
.intro-on.intro-chrome .hero>*{visibility:visible}
.intro-on .stage{z-index:6}
.word-art.rising{overflow:hidden}
.intro-skip{display:none}
.intro-on .intro-skip{display:block;position:absolute;z-index:9;right:var(--pad);bottom:var(--pad);background:none;border:0;padding:8px 0;cursor:pointer}
.intro-skip:hover{color:var(--paper)}
/* Fail-safe: if the script never runs, the opener still gets out of the way. */
.intro-on .intro,.intro-on .intro-skip{animation:intro-gone 0s 4s forwards}
@keyframes intro-gone{to{visibility:hidden}}
@keyframes intro-back{to{visibility:visible}}

/* ---------- Sheets ---------- */
.sheet{position:relative;overflow:hidden;padding:calc(var(--pad) * 1.6) var(--pad) clamp(64px,9vw,140px);border-top:1px solid var(--line)}

.split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(24px,4vw,72px);margin-top:clamp(32px,4vw,64px);align-items:end}
.split-rows,.split-even{align-items:start}
.copy{max-width:42ch;display:flex;flex-direction:column;gap:1em;align-items:flex-start;font-size:clamp(17px,1.4vw,20px)}
.copy .mega-tight{margin-bottom:.15em}
.copy .lede{font-size:clamp(20px,1.85vw,27px);line-height:1.32;color:var(--paper)}   /* About: the one sentence that says what he does */
.about-copy{max-width:60ch;margin-top:clamp(32px,4vw,64px)}
.tools{margin-top:24px;max-width:70ch}
.essay-meta>p:not([class]){color:var(--muted);font-size:16px;max-width:40ch}

.plate{position:relative;justify-self:end;width:min(100%,460px)}
.plate img{display:block;width:100%;height:auto;aspect-ratio:4/5;object-fit:cover}
.plate figcaption{margin-top:10px}
.slot-box{aspect-ratio:4/5;display:grid;place-content:center;justify-items:center;gap:14px;border:1px dashed var(--line);
  background:repeating-linear-gradient(135deg,rgba(239,42,64,.06) 0 2px,transparent 2px 14px)}
.slot-box .sig{width:56px;height:56px;stroke-width:22}

/* Since 2022: the timeline as a chart, in red */
.since{margin-top:clamp(48px,6vw,96px)}
.timeline{margin-top:20px}
.tl-axis{position:relative;height:20px;margin-left:calc(17rem + 24px);margin-right:calc(8rem + 24px);font:400 12px/1 var(--display);letter-spacing:.06em;color:var(--red)}
.tl-axis span{position:absolute;top:0;transform:translateX(-50%)}
.timeline ol{border-top:1px solid var(--line)}
.timeline li{display:grid;grid-template-columns:17rem minmax(0,1fr) 8rem;gap:24px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.tl-org{display:block;font-size:15px;color:var(--paper)}
.tl-role{display:block;font-size:13px;color:var(--muted)}
.tl-track{position:relative;height:10px;background:var(--red-deep)}
.tl-bar{position:absolute;top:0;bottom:0;background:var(--red)}
.tl-when{font:400 13px/1.2 var(--display);letter-spacing:.04em;text-transform:uppercase;color:var(--red);text-align:right}
/* the load strip: how many roles ran at once, on the same axis as the bars */
.tl-load{display:grid;grid-template-columns:17rem minmax(0,1fr) 8rem;gap:24px;align-items:end;padding:6px 0 14px}
.tl-area{display:block;height:56px;border-bottom:1px solid var(--red)}
.tl-area svg{display:block;width:100%;height:100%}
.tl-area polygon{fill:var(--red)}
.tl-load .tl-when{font-size:15px;line-height:1.15}
.timeline li.tl-sub .tl-label{padding-left:18px;position:relative}
.timeline li.tl-sub .tl-label::before{content:"";position:absolute;left:4px;top:-4px;width:8px;height:14px;border-left:1px solid var(--red);border-bottom:1px solid var(--red)}
.timeline li.tl-sub{border-top:0}

/* Portals: the sibling sites in their own identities, as windows that link out */
.portal{display:block;position:relative;text-decoration:none;isolation:isolate;overflow:hidden}
.portal-ss{margin-top:clamp(32px,4vw,64px);aspect-ratio:1200/736;width:100%;border:1px solid var(--line);background:#050303}
.pstage{position:absolute;inset:0;container-type:size}
.pstage img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.pfg{z-index:2}
.pword{position:absolute;z-index:1;left:0;right:0;top:38.5cqh;text-align:center;font-family:var(--display);font-size:21.6cqw;line-height:.8;
  letter-spacing:-.005em;text-transform:uppercase;color:#ee2b24;white-space:nowrap}
.pcorner{position:absolute;z-index:3;font-size:clamp(11px,1.05vw,15px);color:#ee2b24}
.pcorner.tl{left:16px;top:14px}.pcorner.tr{right:16px;top:14px}.pcorner.bl{left:16px;bottom:14px}.pcorner.br{right:16px;bottom:14px}
.portal-ss::after{content:"";position:absolute;inset:0;z-index:2;pointer-events:none;
  background:linear-gradient(to bottom,rgba(5,3,3,.8) 0,transparent 16%,transparent 80%,rgba(5,3,3,.85) 100%)}
.portal-ss:hover,.portal-ss:focus-visible{border-color:#ee2b24}
.portal-ss:hover .pcorner.br,.portal-ss:focus-visible .pcorner.br{background:#ee2b24;color:#050303;outline:4px solid #ee2b24}
.copy-one{max-width:46ch;font-size:clamp(17px,1.4vw,20px)}
.copy-one a{display:inline-block;margin-left:.3em;font-family:var(--display);text-transform:uppercase;letter-spacing:.03em;color:var(--red);text-decoration:none;border-bottom:1px solid var(--line)}

/* Dyslexia Untied: royal blue kit, cardinal trim, white print */
.portal-du{display:grid;grid-template-columns:auto 1fr;grid-template-areas:"mark name" "mark line" "shirt shirt" "go go";column-gap:20px;row-gap:6px;
  align-items:center;padding:clamp(20px,2.4vw,32px);background:#12348C;color:#fff;border-top:6px solid #C8102E}
.du-laces{grid-area:mark;width:64px;height:62px}
.du-name{grid-area:name;align-self:end;font-family:var(--display);font-size:clamp(30px,3.4vw,52px);line-height:.9;text-transform:uppercase}
.du-name em{font-style:normal;background:#C8102E;padding:0 .12em}
.du-line{grid-area:line;align-self:start;font-family:var(--display);font-size:14px;letter-spacing:.08em;text-transform:uppercase;color:#cdd6f0}
.du-shirt{grid-area:shirt;width:100%;max-width:520px;justify-self:center;margin:18px 0 6px}
.du-go{grid-area:go;justify-self:end;font-family:var(--display);font-size:16px;letter-spacing:.06em;text-transform:uppercase;border-bottom:1px solid rgba(255,255,255,.4)}
.portal-du:hover{color:#fff}
.portal-du:hover .du-go,.portal-du:focus-visible .du-go{border-color:#fff}

/* the rest of the projects: one line each, name and tagline */
.sub+.more{margin-top:16px}
.more{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:clamp(24px,4vw,72px);border-top:1px solid var(--line)}
.more li{position:relative;padding:14px 0;border-bottom:1px solid var(--line);font-size:15px;color:var(--muted)}
.more a{display:block;margin-bottom:2px;font-family:var(--display);font-size:clamp(20px,1.8vw,26px);line-height:1.05;text-transform:uppercase;text-decoration:none;color:var(--red)}
.more a::after{content:"";position:absolute;inset:0}
.more li:hover a{color:var(--paper)}

/* Writing */
.essay{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:clamp(24px,4vw,72px);margin-top:clamp(32px,4vw,64px);align-items:end}
.pull p{font-size:clamp(30px,3.6vw,56px);line-height:1.12;color:var(--paper);text-wrap:balance}
.pull p::before{content:"“";color:var(--red)} .pull p::after{content:"”";color:var(--red)}
.essay-meta{display:flex;flex-direction:column;gap:14px;align-items:flex-start}
.essay-meta h3{font-size:clamp(19px,1.6vw,24px);line-height:1.3}
.essay-meta h3 a{text-decoration:none}
.sub{margin-top:clamp(56px,7vw,112px)}
.sub+.ledger{margin-top:16px}

/* Independent work: quiet */
.sheet-quiet{padding-bottom:clamp(48px,6vw,96px)}
.quiet-h{margin:clamp(24px,3vw,40px) 0 16px;font-size:clamp(22px,2.2vw,32px)}

/* Contact: Second State's Book Now, the plate on the right half */
.contact{isolation:isolate}
.contact-bg{position:absolute;z-index:-1;right:0;bottom:0;width:min(60%,900px);height:auto;opacity:.85;
  -webkit-mask-image:linear-gradient(to right,transparent,#000 45%);mask-image:linear-gradient(to right,transparent,#000 45%)}
.contact-body{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:28px;margin-top:clamp(28px,3vw,48px)}
.quote p{font-size:clamp(20px,1.8vw,26px);font-style:italic;max-width:34ch}

/* ---------- Phone ---------- */
@media (max-width:699px){
  /* On a phone the art is a band across the middle, so the hero is only as tall as the art and its captions
     (about 1.35 screen-widths) and Work starts on the first screen */
  .hero{height:max(560px,min(100svh,135vw));z-index:1}
  .stage{--wx:4cqw;--ww:92cqw;--wy:40cqh;width:100vw;height:max(560px,min(100svh,135vw));aspect-ratio:auto}
  /* ...but the opener still fills the screen: a black cover over the rest of the page, gone with the opener
     (and after 4 s whatever happens, like the opener's own fail-safe) */
  .hero::before{content:"";position:fixed;inset:0;z-index:5;background:var(--black);pointer-events:none;
    opacity:0;visibility:hidden;transition:opacity .5s,visibility 0s .5s}
  .intro-on .hero::before{opacity:1;visibility:visible;transition:none;animation:intro-gone 0s 4s forwards}
  /* the render keeps its desktop proportions to the word (it is 1.1628 word-widths wide, its top
     .1439 word-widths above the word), so the opener's sword lands on it here too */
  .stage[data-plate="render"]{--wy:30cqh}   /* the art centred between the name and the role line */
  .stage[data-plate="render"] .cam>img{inset:auto;left:calc(var(--wx) - var(--ww) * .0814);top:calc(var(--wy) - var(--ww) * .0981);
    width:calc(var(--ww) * 1.1628);max-width:none;height:auto;
    -webkit-mask-image:linear-gradient(#000 78%,transparent);mask-image:linear-gradient(#000 78%,transparent)}
  .corners-top{grid-template-columns:1fr auto}
  .corners-top .nav{display:none}
  .corners-top .mark{justify-self:end}
  .corners-bottom{grid-template-columns:1fr auto;row-gap:12px}
  .hero-side{display:none}
  .hero-line{grid-column:1/-1;grid-row:1;max-width:none}
  .corners-bottom .btn{grid-column:1;grid-row:2;justify-self:start}
  .sheet .corners>:last-child{display:none}
  .sheet .corners{grid-template-columns:1fr auto}
  .split,.essay{grid-template-columns:1fr}
  .plate{justify-self:stretch;width:100%}
  .timeline li{grid-template-columns:1fr auto;row-gap:6px}
  .tl-track{grid-column:1/-1;grid-row:2}
  .tl-axis{display:none}
  .tl-load{grid-template-columns:1fr auto;row-gap:6px}
  .tl-area{grid-column:1/-1;grid-row:2;height:44px}
  .more{grid-template-columns:1fr}
  .portal-ss{aspect-ratio:4/5}
  .pstage img{object-position:38% 50%}
  .pword{top:30cqh;font-size:31cqw;white-space:normal;line-height:.86}
  .pcorner.tr{display:none}
  .contact-bg{width:100%;opacity:.35;-webkit-mask-image:none;mask-image:none}
}

@media (prefers-reduced-motion:reduce){
  .js .grain{animation:none}
  .js .word{opacity:1;animation:none}
}

/* ---------- Dock: the section bar that takes over once the hero has gone ----------
   Square, frosted black, a red block under the section in view that slides between labels. Top on desktop;
   on phones a bottom bar that steps aside while you scroll down and comes back when you scroll up. */
.dock{position:fixed;z-index:40;left:50%;top:14px;display:flex;align-items:center;gap:2px;padding:4px;
  background:rgba(5,3,3,.62);-webkit-backdrop-filter:blur(14px) saturate(1.2);backdrop-filter:blur(14px) saturate(1.2);border:1px solid var(--line);
  transform:translate(-50%,calc(-100% - 20px));visibility:hidden}
.dock.on{transform:translate(-50%,0);visibility:visible}
.dock a{position:relative;z-index:1;display:block;padding:9px 12px 7px;font-family:var(--display);font-size:14px;line-height:1;letter-spacing:.04em;
  text-transform:uppercase;text-decoration:none;color:var(--red);white-space:nowrap}
.dock a:hover{color:var(--paper)}
.dock a[aria-current]{color:var(--black)}
.dock .dock-mark{padding:5px 10px 5px 6px;line-height:0}
.dock .dock-mark .sig{width:20px;height:20px}
.dock-ind{position:absolute;z-index:0;left:0;top:4px;bottom:4px;width:0;background:var(--red);opacity:0}
@media (prefers-reduced-motion:no-preference){
  .dock{transition:transform 500ms cubic-bezier(.16,1,.3,1),visibility 0s 500ms}
  .dock.on{transition:transform 500ms cubic-bezier(.16,1,.3,1),visibility 0s}
  .dock-ind{transition:transform 450ms cubic-bezier(.76,0,.24,1),width 450ms cubic-bezier(.76,0,.24,1),opacity 200ms}
}
@media (max-width:699px){
  .dock{top:auto;bottom:calc(12px + env(safe-area-inset-bottom));max-width:calc(100vw - 16px);transform:translate(-50%,calc(100% + 40px))}
  .dock.on{transform:translate(-50%,0)}
  .dock .dock-mark{display:none}
  .dock a{padding:11px 7px 9px;font-size:12.5px;letter-spacing:.02em}
}

.tl-pre .tl-bar{transform:scaleX(0);transform-origin:left}
.tl-pre .tl-area svg{clip-path:inset(0 100% 0 0)}
.tl-in .tl-area svg{clip-path:inset(0);transition:clip-path 1400ms cubic-bezier(.76,0,.24,1) 100ms}
.tl-in .tl-bar{transform:none;transition:transform 900ms cubic-bezier(.76,0,.24,1) calc(var(--i) * 50ms + 150ms)}
.portal-ss.pv-pre{clip-path:inset(100% 0 0 0)}
.portal-ss.pv-pre img{transform:scale(1.08);filter:blur(10px)}
.portal-ss.pv-in{clip-path:inset(0);transition:clip-path 1100ms cubic-bezier(.76,0,.24,1)}
.portal-ss.pv-in img{transform:none;filter:none;transition:transform 1600ms cubic-bezier(.16,1,.3,1),filter 1200ms cubic-bezier(.16,1,.3,1)}
.pword .pw{display:inline-block;white-space:nowrap}
.pword .pl{display:inline-block}
.pword.rising{clip-path:inset(-60% -5% 0 -5%)}

/* the project preview that follows the pointer over the rows (fine pointers only) */
.peek{position:fixed;z-index:30;left:0;top:0;width:256px;height:160px;pointer-events:none;overflow:hidden;
  clip-path:inset(100% 0 0 0);transition:clip-path 150ms cubic-bezier(.76,0,.24,1);border:1px solid var(--red)}
.peek.on{clip-path:inset(0);transition-duration:250ms}
.peek img{width:100%;height:100%;object-fit:cover}

@media print{.grain,.intro,.intro-skip,.dock,.peek{display:none}}
