/* Contrail Studio · Idea 1 · THE LOG · mobile first */
:root {
  --chalk: #EEEAE2; --stratos: #22303F; --accent: #FF5A1F;
  --field: var(--chalk); --ink: var(--stratos);
  --margin: 24px; --paper: calc(100vw - 48px);
  --band: 96px;                 /* the type-free ruled band that carries one climb */
  --rise: 0.0875;               /* tan 5° */
  --trail-w: clamp(1.5px, 0.46vw, 3px);
  --dpr: 1;
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", "SF Mono", Menlo, Consolas, monospace;
  --h1: 32px; --h1lh: 38px; --offer: 17px; --offerlh: 26px; --remark: 16px; --remarklh: 22px; --monosz: 11px;
  --rowgap: 14px;
}
* { box-sizing: border-box; }
html { background: var(--field); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-weight: 400; font-size: var(--remark); line-height: var(--remarklh); background: var(--field); color: var(--ink); overflow-x: hidden; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, .btn:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
h1, p, figure, figcaption { margin: 0; }
.mono { font-family: var(--mono); font-weight: 400; font-size: var(--monosz); line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; }

.paper { width: var(--paper); margin: 0 auto; position: relative; }
.sec { position: relative; display: flow-root; }
.rule { border: 0; border-top: 1px solid var(--ink); margin: 0; }

/* top */
.top { display: flex; align-items: flex-end; justify-content: space-between; padding: 20px 0 14px; border-bottom: 1px solid var(--ink); }
.wordmark img { width: 132px; height: auto; }
.log { text-align: right; }

/* hero */
.hero-text { padding: 28px 0 0; }
.h1 { font-weight: 300; font-size: var(--h1); line-height: var(--h1lh); letter-spacing: -0.01em; max-width: 12ch; }
.offer { margin-top: 12px; font-size: var(--offer); line-height: var(--offerlh); max-width: 30ch; }
.plate-hero { margin-top: 20px; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: var(--field); }
.plate-hero video { width: 100%; height: 100%; object-fit: cover; }
.hero .thead { margin-top: 16px; }

/* table */
.thead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0 8px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.thead .cols { display: none; }
.thead .cols .ill { display: inline; }
.row { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "code date" "route time" "remark remark"; column-gap: 16px; row-gap: 4px; padding: 12px 0 14px; border-bottom: 1px solid var(--ink); clip-path: inset(0 var(--clip, 0%) 0 0); }
.row .code { grid-area: code; } .row .date { grid-area: date; text-align: right; } .row .route { grid-area: route; } .row .time { grid-area: time; text-align: right; }
.row .remark { grid-area: remark; margin-top: 6px; font-size: var(--remark); line-height: var(--remarklh); max-width: 42ch; }
.rows .thead { margin-top: 0; }

/* climbs: one 5° line per screen, drawn edge to edge across the whole viewport */
.climb { position: absolute; left: 50%; transform: translateX(-50%); width: 100vw; height: var(--band); top: 0; pointer-events: none; overflow: visible; z-index: 3; }
.climb polyline { stroke: var(--accent); stroke-width: var(--trail-w); stroke-linecap: butt; }
.rows > .climb + .thead, .rows > .climb + .row, #desk > .climb + .plate, #screens > .climb + .thead, #work > .climb + .thead { margin-top: var(--band); }
.climb-plate { top: auto; }           /* positioned by main.js over the plate's sky band */
.climb-row { display: none; top: 44px; }  /* desktop only, below the group head */

/* plates */
.plate { position: relative; overflow: hidden; background: var(--field); }
.plate img { width: 100%; height: auto; clip-path: inset(0 var(--clip, 0%) 0 0); will-change: clip-path; }
.plate figcaption { padding: 10px 0 0; }
.gblock { position: relative; padding-top: calc(var(--band) + 12px); padding-bottom: 28px; }
.gblock .plate { width: 100%; }
.ground .thead { margin-bottom: 0; }

/* desk: one locked shot, one variable, a hard cut */
.plate-desk { margin-top: var(--band); width: 100%; }
.plate-desk img { aspect-ratio: 3 / 2; }
.plate-desk .b, .plate-desk .capb { display: none; }
.plate-desk.cut .a, .plate-desk.cut .capa { display: none; }
.plate-desk.cut .b, .plate-desk.cut .capb { display: block; }
.plate-desk figcaption span { display: block; }
#desk { padding-bottom: 36px; }

/* frames */
#screens .thead { margin-top: var(--band); }
.frames { position: relative; display: flex; align-items: flex-start; gap: 36px; padding: 28px 0 40px; }
.frame { position: relative; }
.frame-a { width: 144px; height: 256px; }
.frame-b { width: 180px; height: 101px; margin-top: 48px; }
.fr { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fr rect { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: var(--draw, 1); }
.wire { position: absolute; inset: 0; clip-path: inset(0 var(--clip, 100%) 0 0); }
.w { position: absolute; border: 1px solid var(--ink); }
.wire-a .w-dot { left: 10px; top: 12px; width: 18px; height: 18px; border-radius: 50%; }
.wire-a .w-rule { height: 0; border-width: 1px 0 0; }
.wire-a .r1 { left: 36px; top: 16px; width: 60px; } .wire-a .r2 { left: 36px; top: 24px; width: 40px; }
.wire-a .w-tile { top: 48px; width: 38px; height: 38px; } .wire-a .t1 { left: 10px; } .wire-a .t2 { left: 53px; } .wire-a .t3 { left: 96px; }
.wire-a .r3 { left: 10px; top: 104px; width: 100px; } .wire-a .r4 { left: 10px; top: 114px; width: 72px; }
.wire-b .w-rule { height: 0; border-width: 1px 0 0; }
.wire-b .nav { left: 8px; top: 8px; width: 164px; } .wire-b .h1a { left: 8px; top: 22px; width: 90px; } .wire-b .h1b { left: 8px; top: 30px; width: 64px; }
.wire-b .w-block { left: 104px; top: 20px; width: 68px; height: 38px; }
.wire-b .c1 { left: 8px; top: 70px; width: 48px; } .wire-b .c2 { left: 66px; top: 70px; width: 48px; } .wire-b .c3 { left: 124px; top: 70px; width: 48px; }
.wire-b .w-btn { left: 8px; top: 82px; width: 48px; height: 12px; }
.frame .cap { position: absolute; left: 0; top: calc(100% + 8px); white-space: nowrap; }

/* last row and foot */
.last { min-height: 100vh; min-height: 100svh; }
.last .thead { margin-top: max(40px, calc(100vh - 420px)); }  /* the button never shares a viewport with the WORK line */
.row-last .remark { margin-top: 8px; }
.btn { display: inline-block; background: var(--accent); color: var(--ink); font-family: var(--sans); font-weight: 400; font-size: 17px; line-height: 44px; height: 44px; padding: 0 18px; }
.foot { padding: 40px 0 56px; }
.foot .wm { width: 160px; height: auto; }
.foot .contact { margin-top: 16px; }
.foot .remark-end { margin-top: 20px; font-size: 17px; line-height: 26px; }

/* reduced motion: the finished page */
.reduced .row, .reduced .plate img, .reduced .wire { clip-path: none !important; }
.reduced .climb polyline { stroke-dashoffset: 0 !important; }
.reduced .fr rect { stroke-dashoffset: 0 !important; }

/* short phones: keep the half-written first row inside the first screen */
@media (max-width: 899px) and (max-height: 700px) { .plate-hero { aspect-ratio: 1 / 1; } }

/* desktop */
@media (min-width: 900px) {
  :root { --paper: min(1200px, 100vw - 96px); --band: 192px; --h1: 44px; --h1lh: 52px; --offer: 18px; --offerlh: 28px; --remark: 17px; --remarklh: 26px; --monosz: 12px; }
  .top { padding: 32px 0 16px; }
  .wordmark img { width: 160px; }
  .hero-grid { display: grid; grid-template-columns: 1fr 400px; column-gap: 48px; align-items: start; padding-top: 48px; }
  .hero-text { padding: 16px 0 0; max-width: 480px; }
  .plate-hero { margin-top: 0; width: 400px; }
  .hero .thead { margin-top: 48px; }
  .thead { display: grid; grid-template-columns: 96px 120px 248px 96px 544px; column-gap: 24px; align-items: baseline; }
  .thead > span:first-child { grid-column: 1 / 3; }
  .thead .cols { display: contents; }
  .thead .cols i { font-style: normal; }
  .thead .cols i:nth-child(1), .thead .cols i:nth-child(2) { display: none; }
  .thead .cols .ill { display: block; grid-column: 3 / 6; text-align: right; }
  .row { grid-template-columns: 96px 120px 248px 96px 544px; grid-template-areas: "date code route time remark"; column-gap: 24px; padding: 18px 0; }
  .row .date, .row .time { text-align: left; }
  .row .remark { margin-top: -3px; max-width: 62ch; }
  .plate-desk { width: 720px; }
  .frames { gap: 42px; padding: 40px 0 56px; }
  .frame-a { width: 270px; height: 480px; }
  .frame-b { width: 640px; height: 360px; margin-top: 60px; }
  .wire-a .w-dot { left: 20px; top: 24px; width: 28px; height: 28px; }
  .wire-a .r1 { left: 60px; top: 30px; width: 120px; } .wire-a .r2 { left: 60px; top: 44px; width: 80px; }
  .wire-a .w-tile { top: 90px; width: 72px; height: 72px; } .wire-a .t1 { left: 20px; } .wire-a .t2 { left: 99px; } .wire-a .t3 { left: 178px; }
  .wire-a .r3 { left: 20px; top: 194px; width: 200px; } .wire-a .r4 { left: 20px; top: 212px; width: 140px; }
  .wire-b .nav { left: 24px; top: 24px; width: 592px; } .wire-b .h1a { left: 24px; top: 70px; width: 300px; } .wire-b .h1b { left: 24px; top: 92px; width: 220px; }
  .wire-b .w-block { left: 360px; top: 60px; width: 256px; height: 144px; }
  .wire-b .c1 { left: 24px; top: 250px; width: 160px; } .wire-b .c2 { left: 240px; top: 250px; width: 160px; } .wire-b .c3 { left: 456px; top: 250px; width: 160px; }
  .wire-b .w-btn { left: 24px; top: 290px; width: 96px; height: 28px; }
  .climb-row { display: block; }
  .gblock > .climb-plate { display: none; }
  .gwrap { display: grid; grid-template-columns: repeat(4, 288px); column-gap: 16px; padding-top: calc(var(--band) + 60px); }
  .gblock { padding: 0 0 40px; }
  .gblock .plate { width: 288px; }
  .foot { padding: 56px 0 72px; }
}
