/* ============================================================
   Inner pages (Project/*.html, Resume/resume.html) in the home
   page's look (design board 43). Loaded after style.css and
   home.css. home.css supplies the pieces these pages share with
   the home page: the nav (.top-nav), section heads (.sec-head),
   buttons (.btn), label / value rows (.facts), the two columns
   (.cols, .main), the log rows of the All work page (.year,
   .log, .entry), the gold rule under a title (.name-rule), the
   footer's links (.foot-links, .foot-note).
   This file adds what only an inner page has:
     .page    tokens, and where the page's map sits
     .pmap    the page's own mountain as a line map behind
              everything: full strength in the heading, faint below
     .ptop    heading: nav, the summit's label, back link, title
     .side    right column: facts, tools, buttons
     .prose   case-study text, lists, pictures
     .rs      the resume's rows
     .pfoot   footer
   Breakpoints: 969px (one column, as on the home page), 819px
   (the nav wraps), 705 to 560px (the nav breaks after the name),
   620px, 559px (no summit label), 520px, 359px. The side column
   sticks only in a window at least 970px wide and 880px tall.
   These pages have no script.
   ============================================================ */

/* ---------- page ---------- */
.page{
  position:relative;z-index:0;
  /* the same values as .home in home.css */
  --line:rgba(16,18,20,.16);
  --rule:rgba(16,18,20,.35);
  --t0:#EDF2F2;--t1:#D3E5EA;--t2:#9CCADB;--t3:#3F86AE;--t4:#0E2A47;
  /* map: every mountain's data has the same frame, 1197 by 897, with the summit .5414 of the
     width across and .2406 of the width down. It lands 54.1vw across, as on the home page,
     and 150px down. */
  --mw:max(100.3vw,1100px);
  --ml:calc(54.1vw - .5414*var(--mw));
  --mt:calc(150px - .2406*var(--mw));
  font-variant-numeric:normal;   /* tabular figures widen the commas and colons of running text */
  -webkit-font-smoothing:auto;
}

/* the mountain: one tile (the map over its own mirror) repeated down the page. Its image is set
   on the element, in the page. Full strength behind the heading, then down to the home page's 40%. */
.pmap{
  position:absolute;left:0;top:0;right:0;bottom:0;z-index:-1;pointer-events:none;
  background-repeat:repeat-y;background-size:var(--mw) auto;background-position:var(--ml) var(--mt);
  -webkit-mask-image:linear-gradient(180deg,#000 200px,rgba(0,0,0,.4) 420px);
  mask-image:linear-gradient(180deg,#000 200px,rgba(0,0,0,.4) 420px);
}

/* ---------- heading ---------- */
.ptop{position:relative;display:flex;flex-direction:column;min-height:420px}
/* page colour behind the nav */
.ptop::before{
  content:"";position:absolute;left:0;top:0;right:0;height:150px;pointer-events:none;
  background:linear-gradient(180deg,var(--bg) 0,var(--bg) 46px,rgba(246,247,245,0) 150px);
}
/* his name leads the nav and is the way home */
.top-nav a.nav-name{
  margin:0 auto 0 0;padding-right:24px;
  font:600 15px/1 "Schibsted Grotesk",system-ui,sans-serif;letter-spacing:-.01em;text-transform:none;
}
.top-nav a[aria-current="page"]{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:7px}

/* the summit and its label */
.psummit{position:absolute;left:calc(var(--ml) + .5414*var(--mw));top:150px;width:0;height:0}
.pk{
  position:absolute;left:-3px;top:-3px;width:6px;height:6px;
  border-radius:50%;background:var(--gold);border:1px solid var(--bg);
}
.ptag{
  position:absolute;left:10px;top:-10px;padding:2px 6px;white-space:nowrap;background:var(--bg);
  font-family:var(--mono);font-size:11px;line-height:16px;letter-spacing:.08em;color:var(--sec);
}

.ptitle{position:relative;margin-top:auto;padding:124px var(--gx) 44px}
.pback{
  display:inline-flex;align-items:center;gap:8px;min-height:44px;   /* gap: the arrow is an item of its own */
  font:500 11px/1 var(--mono);letter-spacing:.14em;text-transform:uppercase;
}
/* small grey type over the heading's full-strength lines gets the page colour behind it, like the summit's label */
.peyebrow{
  width:fit-content;margin:8px 0 0 -6px;padding:2px 6px;background:var(--bg);
  font-family:var(--mono);font-size:11px;line-height:16px;letter-spacing:.14em;text-transform:uppercase;color:var(--sec);
}
.ptitle h1{
  margin-top:10px;max-width:22ch;
  font-size:clamp(34px,5.6vw,72px);font-weight:600;line-height:1.02;letter-spacing:-.025em;text-wrap:balance;
}
.ptitle h1.long{font-size:clamp(31px,4.5vw,58px);line-height:1.05}   /* a case study's title runs to two lines */
.pmeta{margin-top:16px;max-width:70ch;font-size:15px;color:var(--ink)}

/* ---------- two columns: text left, facts right ---------- */
.page .cols{padding-top:56px;border-top:1px solid var(--line)}
.side{flex:0 0 300px;min-width:0;padding-left:24px;border-left:1px solid var(--line)}
/* the column stays put only in a window tall enough to show all of it (the tallest is about 820px) */
@media (min-width:970px) and (min-height:880px){
  .side{position:sticky;top:24px}
}
.side .rail-head{padding-left:0}
.side .rail-gap{margin-top:28px}
.side .facts{margin:0 0 28px}
.side .facts > div:first-child{border-top:0}
.side .facts dt,.side .facts dd{flex:1 1 100%}
.side .facts dt{line-height:16px}
.side .facts dd{overflow-wrap:anywhere}   /* a long address wraps inside its column */
.side .facts dd a{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.fnote{display:block;font-size:13px;line-height:19px;color:var(--sec)}
.fsw{display:inline-block;width:14px;height:10px;margin-right:8px;border:1px solid var(--rule)}
/* the tints are pale by design: their outline carries the 3:1 */
.page .fsw,.page .e-dot{border-color:rgba(16,18,20,.55)}
.tools{list-style:none;display:flex;flex-wrap:wrap;gap:6px;padding:14px 0 0;margin-bottom:28px}
.tools li{
  padding:5px 9px;border:1px solid var(--line);border-radius:2px;background:var(--bg);
  font-family:var(--mono);font-size:11px;line-height:16px;
}
.side-links{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:28px}   /* the gap to the text when the column sits above it */
.side-links .btn{gap:8px;padding:9px 18px;line-height:1.45}   /* a long label may take two lines */
.side .rail-note{margin:14px 0 20px}
/* the All work page's legend: a discipline, its tint, how many entries */
.legend{list-style:none;margin-bottom:4px}
.legend li{
  display:flex;align-items:center;gap:10px;min-height:40px;
  border-bottom:1px solid var(--line);font-size:14.5px;font-weight:600;
}
.legend .fsw{margin-right:0}
.legend .n{margin-left:auto;font-family:var(--mono);font-size:12px;font-weight:400}

/* ---------- case-study text ---------- */
.prose > h2{
  max-width:26ch;margin-bottom:22px;
  font-size:clamp(24px,2.7vw,32px);font-weight:600;letter-spacing:-.018em;line-height:1.14;text-wrap:balance;
}
.prose > h3{margin:44px 0 12px;font-size:18px;font-weight:600;letter-spacing:-.01em;line-height:1.3}
.prose > p{max-width:66ch;margin-bottom:16px;font-size:16px;line-height:1.65;text-wrap:pretty}
.prose code{
  padding:1px 3px;border-radius:2px;background:rgba(16,18,20,.055);
  font-family:var(--mono);font-size:.86em;overflow-wrap:anywhere;
}
.prose p a,.dash a{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
/* a list whose marks are dashes, as in the home page's pop-ups */
.dash{list-style:none;max-width:66ch;margin-bottom:16px}
.dash li{position:relative;margin-bottom:9px;padding-left:22px;font-size:15px;line-height:1.6;text-wrap:pretty}
.dash li::before{
  content:"—";content:"—" / "";   /* second form: a decoration, not read out */
  position:absolute;left:0;color:var(--sec);
}
/* a titled list (key decisions, what I contributed) */
.pts{margin:44px 0 28px}
.pts .sec-head{margin-bottom:18px}
/* pictures: each opens the full file. One or two columns of at least 340px (never three: the
   width stops at 1040px); a figure spans two grid rows (picture, caption) so the captions of one
   row start on one line; an odd one out takes the whole last row; a tall phone screenshot stops
   at 520px. */
.figs{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));
  gap:20px 16px;max-width:1040px;margin:26px 0 30px;
}
/* a grid of phone screenshots: two abreast already from 516px */
.figs.tall{grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));max-width:760px}
.figs > figure:last-child:nth-child(odd){grid-column:1/-1}
.figs figure{min-width:0;display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:8px}
.figs:has(> figure:only-child){display:block;max-width:820px}
.figs a{display:block;align-self:end}
.figs img{width:auto;max-width:100%;height:auto;max-height:520px;border:1px solid var(--line);background:var(--bg)}
.figs figcaption{font-family:var(--mono);font-size:11px;line-height:17px;color:var(--sec)}
.prose > p.status{
  display:inline-block;max-width:none;margin:14px 0 0;padding:8px 12px;
  border:1px solid var(--line);border-radius:2px;background:var(--bg);
  font-family:var(--mono);font-size:11px;line-height:16px;letter-spacing:.06em;
}
/* previous / all / next */
.pn{
  display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px 32px;
  margin-top:72px;padding-top:8px;border-top:1px solid var(--ink);
}
.pn a{display:flex;flex-direction:column;justify-content:center;gap:4px;min-height:56px;min-width:0}
.pn .pn-next{text-align:right}
.pn-l{font-family:var(--mono);font-size:11px;line-height:16px;letter-spacing:.14em;text-transform:uppercase;color:var(--sec)}
.pn-t{font-size:15px;font-weight:600;line-height:1.3}
.pn .pn-all{justify-self:center;font:500 11px/1 var(--mono);letter-spacing:.14em;text-transform:uppercase}

/* ---------- resume ---------- */
.rs > section + section{margin-top:56px}
.rs-item{padding:18px 0;border-bottom:1px solid var(--line)}
.rs-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:2px 24px}
.rs-title{font-size:16px;font-weight:600;letter-spacing:-.01em;line-height:1.35}
.rs-when{font-family:var(--mono);font-size:11px;line-height:21px;color:var(--sec);white-space:nowrap}
.rs-sub{margin-top:2px;font-size:14px;line-height:1.5;color:var(--sec)}
.rs-item .dash{margin:10px 0 0}
.rs-item .dash li{font-size:14.5px;line-height:1.55}
.rs .facts{margin-top:0}
.rs .facts > div:first-child{border-top:0}
.rs .facts dt{flex-basis:168px}

/* ---------- footer ---------- */
.pfoot{padding:36px var(--gx) 48px;border-top:1px solid var(--ink)}
.pfoot .foot-links{margin-top:0}
.pfoot .foot-note{margin-top:14px}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width:969px){
  .page .cols{padding-top:36px}
  .side{flex:0 0 auto;padding-left:0;border-left:0}
  .side .facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));column-gap:24px}
  .side .facts > div{align-content:flex-start}   /* a short value keeps to the top beside a taller neighbour */
  .side .facts > div:first-child{border-top:1px solid var(--line)}
  .side .facts.wide{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}   /* addresses: no break inside one */
}
/* under 820px the name and seven links no longer fit on one line: they wrap, so none is out of sight */
@media (max-width:819px){
  .page .top-nav{flex-wrap:wrap;gap:0 22px;overflow:visible;-webkit-mask-image:none;mask-image:none}
  .page .top-nav a.nav-name{margin-right:0;padding-right:10px}
}
/* a forced line break keeps the last link from sitting alone on a row: name and four links, then three */
@media (min-width:560px) and (max-width:705px){
  .page .top-nav::after{content:"";order:1;flex-basis:100%}
  .page .top-nav a:nth-child(n+6){order:2}
}
@media (max-width:620px){
  .pn{grid-template-columns:1fr}
  .pn .pn-all{justify-self:start;grid-row:3}
  .pn .pn-next{text-align:left}
}
@media (max-width:559px){
  /* the nav takes two or three lines here and the label would crowd it: the map stays, its label goes */
  .psummit{display:none}
  .ptop{min-height:0}
  .ptitle{padding-top:40px}
  /* and the page colour reaches down behind all of the nav's lines */
  .ptop::before{height:210px;background:linear-gradient(180deg,var(--bg) 0,var(--bg) 140px,rgba(246,247,245,0) 210px)}
}
/* the smallest phones: three lines of three, three and two */
@media (max-width:359px){
  .page .top-nav{gap:0 18px}
  .page .top-nav::before,.page .top-nav::after{content:"";flex-basis:100%}
  .page .top-nav::before{order:1}
  .page .top-nav a:nth-child(n+4){order:2}
  .page .top-nav::after{order:3}
  .page .top-nav a:nth-child(n+7){order:4}
}
@media (max-width:520px){
  .rs .facts dt{flex-basis:100%}
}
@media print{
  .pmap,.top-nav,.psummit,.pback,.pn,.pfoot,.skip{display:none !important}
  .ptop{min-height:0}
  .ptop::before{display:none}
  .ptitle{padding:0 0 12pt}
  /* a printed page still says whose it is and where its code lives */
  .ptitle::after{content:"Hikmet Bisen · hikmetbisen.com";display:block;margin-top:6pt;font:9pt var(--mono)}
  .page .cols{display:block;padding:12pt 0 0;border-top:0}
  .side{padding:0 0 12pt;border:0}
  .side-links .btn{display:block;min-height:0;padding:0;border:0;background:none;color:#000;letter-spacing:0;text-transform:none}
  .side-links .btn[href^="http"]::after{content:" " attr(href)}
  .side-links .btn[download]{display:none}
  .rs > section + section{margin-top:18pt}
  .sec-head,.prose > h2,.prose > h3,.rs-head,.yh{break-after:avoid}
  .rs-item,.figs figure,.dash li,.log li{break-inside:avoid}
  .year{display:block}
  .prose > p.status{break-before:avoid}
  .figs img{max-height:3.2in}   /* two pictures to a printed page */
}
