/* Inner-page templates for codset.com. Builds on scrollcraft.css (tokens, reset) and site.css (homepage components).
   Layout concept: a quiet editorial column system on the cool paper ground, one photographic plate per page,
   hard cut to the night ground only for the closing band. */

main.inner { padding-top: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); }
.inner .sc-wrap { min-width: 0; }
.crumbs { padding-block: var(--sc-5) 0; font-size: 0.82rem; color: var(--sc-ink-soft); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--sc-ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--sc-ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--sc-ink); }

/* hero: copy left, one plate right */
.ihero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(2rem, 5vw, 5.5rem); align-items: end; padding-block: clamp(2rem, 5vw, 4.5rem) clamp(3rem, 6vw, 6rem); }
.ihero h1 { font-size: clamp(2.3rem, 1.3rem + 3.3vw, 4.6rem); line-height: 1; letter-spacing: -0.04em; font-weight: 600; margin: var(--sc-4) 0 var(--sc-5); text-wrap: balance; }
.ihero .lead { font-size: var(--sc-t-lg); line-height: 1.45; color: var(--sc-ink-soft); margin: 0; max-width: 44ch; }
.ihero .actions { display: flex; flex-wrap: wrap; gap: var(--sc-3); margin-top: var(--sc-6); }
.ihero .top { display: flex; align-items: center; gap: var(--sc-4); flex-wrap: wrap; }
.ihero figure { margin: 0; border-radius: var(--sc-r-lg); overflow: hidden; box-shadow: var(--sc-e3); aspect-ratio: 4 / 5; max-height: 72svh; background: #C9D1DA; max-width: 100%; }
.ihero figure img { width: 100%; height: 100%; object-fit: cover; }
.flag.is-on { opacity: 1; transform: none; }

/* generic section rhythm: more air above a heading than below */
.isec { padding-block: clamp(3rem, 6vw, 6rem); border-top: 1px solid var(--line); }
.isec__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: var(--sc-5) var(--sc-8); align-items: end; margin-bottom: var(--sc-7); }
.isec__head h2 { font-size: var(--sc-t-2xl); line-height: 1.02; letter-spacing: -0.03em; font-weight: 580; margin: 0; max-width: 18ch; text-wrap: balance; }
.isec__head p { margin: 0; color: var(--sc-ink-soft); }

.build { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--sc-7); }
.build li { padding: var(--sc-5) 0; border-top: 1px solid var(--line); min-width: 0; }
.build b { display: block; font-family: var(--sc-font-display); font-variation-settings: "wdth" var(--wd); font-size: var(--sc-t-lg); font-weight: 560; letter-spacing: -0.02em; margin-bottom: 6px; }
.build span { color: var(--sc-ink-soft); font-size: var(--sc-t-sm); }

/* a case teaser, horizontal */
.teaser { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 0; background: var(--sc-surface); border: 1px solid var(--line); border-radius: var(--sc-r-lg); overflow: hidden; box-shadow: var(--sc-e2), var(--sc-edge); text-decoration: none; color: var(--sc-ink); }
.teaser img { width: 100%; height: 100%; object-fit: cover; min-height: 18rem; }
.teaser > div { padding: clamp(1.5rem, 3vw, 2.75rem); display: flex; flex-direction: column; justify-content: center; gap: var(--sc-4); min-width: 0; }
.teaser h3 { font-size: var(--sc-t-2xl); line-height: 1.06; letter-spacing: -0.03em; margin: 0; font-weight: 580; text-wrap: balance; }
.teaser p { margin: 0; color: var(--sc-ink-soft); max-width: 50ch; }
.teaser .more { color: var(--sc-accent); font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .teaser:hover { border-color: var(--line-strong); } .teaser:hover .arrow { transform: translateX(3px); } }

/* sequence: four steps, numbered because the order is the information */
.seq { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sc-5); counter-reset: s; }
.seq li { counter-increment: s; border-top: 2px solid var(--sc-ink); padding-top: var(--sc-4); min-width: 0; }
.seq li::before { content: "Step " counter(s); font-family: var(--sc-font-mono); font-size: var(--sc-t-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sc-accent); }
.seq h3 { font-size: var(--sc-t-lg); letter-spacing: -0.02em; margin: var(--sc-3) 0 var(--sc-2); font-weight: 580; }
.seq p { margin: 0; color: var(--sc-ink-soft); font-size: var(--sc-t-sm); }

/* stage-aware rows */
.stagerows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.stagerows li { display: grid; grid-template-columns: 10rem minmax(0, 1fr) auto; gap: var(--sc-5); align-items: baseline; padding: var(--sc-5) var(--sc-4); border-bottom: 1px solid var(--line); border-radius: var(--sc-r-md); transition: background-color 240ms var(--sc-ease-out); }
.stagerows b { font-family: var(--sc-font-display); font-variation-settings: "wdth" var(--wd); font-size: var(--sc-t-lg); font-weight: 560; }
.stagerows p { margin: 0; color: var(--sc-ink-soft); }
.stagerows .you { font-family: var(--sc-font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 5px 8px; border-radius: var(--sc-r-sm); background: var(--sc-accent); color: var(--sc-accent-ink); visibility: hidden; }
.stagerows li.is-you, .stagerows li.is-on { background: var(--sc-surface); box-shadow: var(--sc-e1); }
.stagerows li.is-on .you { display: inline-block; visibility: visible; }
.stagerows li.is-on p { color: var(--sc-ink); }
.stagerows li.is-you .you { visibility: visible; }
.stagerows li:not(.is-you):not(.is-on) .you { display: none; }
.stagerows .you { justify-self: start; }
.stagerows li.is-you p { color: var(--sc-ink); }

/* FAQ */
.faq { border-top: 1px solid var(--line-strong); max-width: 56rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: var(--sc-4); padding: var(--sc-5) 0; font-weight: 560; font-size: var(--sc-t-lg); letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sc-font-mono); color: var(--sc-accent); transition: transform 200ms var(--sc-ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 var(--sc-5); color: var(--sc-ink-soft); max-width: 62ch; }

/* related links */
.related { display: flex; flex-wrap: wrap; gap: var(--sc-3); }
.related a { display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--sc-r-md); text-decoration: none; color: var(--sc-ink); font-size: var(--sc-t-sm); }
.related a:hover { border-color: var(--sc-ink); }

/* closing band, the one hard cut to night */
.closeband { padding-block: clamp(4rem, 8vw, 7rem); }
.closeband .sc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sc-6); align-items: end; }
.closeband h2 { font-size: var(--sc-t-3xl); line-height: 0.98; letter-spacing: -0.04em; font-weight: 600; margin: 0 0 var(--sc-4); max-width: 14ch; }
.closeband p { margin: 0; color: var(--sc-ink-soft); max-width: 44ch; }
.foot { margin-top: 0; }

/* case page facts */
.facts { margin: var(--sc-6) 0 0; display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 10px var(--sc-4); font-size: var(--sc-t-sm); border-top: 1px solid var(--line); padding-top: var(--sc-5); max-width: 36rem; }
.facts dt { font-family: var(--sc-font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sc-ink-soft); padding-top: 3px; }
.facts dd { margin: 0; }
.prose { max-width: 62ch; }
.prose p { margin: 0 0 var(--sc-4); font-size: var(--sc-t-lg); line-height: 1.5; }
.result { font-family: var(--sc-font-display); font-variation-settings: "wdth" var(--wd); font-size: var(--sc-t-xl); letter-spacing: -0.02em; line-height: 1.2; margin: 0; max-width: 30ch; }
.result small { display: block; font-family: var(--sc-font-mono); font-variation-settings: normal; font-size: var(--sc-t-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sc-ink-soft); margin-top: var(--sc-3); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sc-4); }
.pager a { display: block; padding: var(--sc-5); border: 1px solid var(--line); border-radius: var(--sc-r-lg); text-decoration: none; color: var(--sc-ink); background: var(--sc-surface); }
.pager a span { display: block; color: var(--sc-ink-soft); font-size: 0.8rem; margin-bottom: 6px; }
.pager a b { font-family: var(--sc-font-display); font-variation-settings: "wdth" var(--wd); font-size: var(--sc-t-lg); font-weight: 560; }
.pager a:last-child { text-align: right; }

/* teams configurator */
.config { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.roles { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.roles li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--sc-5); align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.roles .rate { font-variant-numeric: tabular-nums; color: var(--sc-ink-soft); font-size: var(--sc-t-sm); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--sc-r-md); }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; color: var(--sc-ink); font-size: 1.1rem; cursor: pointer; border-radius: var(--sc-r-md); }
.stepper button:disabled { opacity: 0.3; cursor: not-allowed; }
.stepper output { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.opts { margin-top: var(--sc-6); display: grid; gap: var(--sc-5); }
.opts fieldset { border: 0; margin: 0; padding: 0; }
.opts legend { font-weight: 560; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--sc-r-md); overflow: hidden; flex-wrap: wrap; }
.seg label { padding: 10px 14px; cursor: pointer; font-size: var(--sc-t-sm); min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--sc-ink); color: var(--sc-canvas); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--sc-accent); outline-offset: -2px; }
.summary { position: sticky; top: calc(var(--bar-h) + 24px); background: var(--sc-surface); border: 1px solid var(--line); border-radius: var(--sc-r-lg); padding: clamp(1.25rem, 2.5vw, 2rem); box-shadow: var(--sc-e3), var(--sc-edge); }
.summary .total { font-family: var(--sc-font-display); font-variation-settings: "wdth" 116; font-size: var(--sc-t-3xl); font-weight: 560; letter-spacing: -0.04em; line-height: 1; margin: var(--sc-3) 0 6px; font-variant-numeric: tabular-nums; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 10px var(--sc-4); margin: var(--sc-5) 0; padding-top: var(--sc-4); border-top: 1px solid var(--line); font-size: var(--sc-t-sm); }
.summary dt { color: var(--sc-ink-soft); }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.compare { margin-top: var(--sc-5); padding-top: var(--sc-4); border-top: 1px solid var(--line); }
.compare label { font-size: 0.8rem; font-weight: 500; display: block; margin-bottom: 6px; }
.compare input { width: 100%; padding: 11px 12px; border-radius: var(--sc-r-md); border: 1px solid var(--line-strong); background: var(--sc-canvas); color: var(--sc-ink); font-variant-numeric: tabular-nums; }
.compare p { margin: 10px 0 0; font-size: var(--sc-t-sm); color: var(--sc-ink-soft); min-height: 2.8em; }
.compare p b { color: var(--sc-ink); }
.summary .btn { width: 100%; justify-content: center; margin-top: var(--sc-4); }
.proto-note { font-family: var(--sc-font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--sc-ink-soft); padding: 10px var(--sc-gutter); border-bottom: 1px solid var(--line); background: var(--sc-surface); }
.proto-note a { color: var(--sc-ink); }

@media (max-width: 960px) {
  .ihero, .isec__head, .teaser, .config, .closeband .sc-wrap { grid-template-columns: minmax(0, 1fr); }
  .ihero figure { aspect-ratio: 4 / 3; max-height: none; }
  .seq { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary { position: static; }
}
@media (max-width: 620px) {
  .build, .seq, .pager { grid-template-columns: minmax(0, 1fr); }
  .stagerows li { grid-template-columns: minmax(0, 1fr) auto; }
  .stagerows p { grid-column: 1 / -1; }
  .roles li { grid-template-columns: minmax(0, 1fr) auto; }
  .roles .rate { grid-column: 1; grid-row: 2; }
  .roles .stepper { grid-row: 1 / span 2; grid-column: 2; }
  .pager a:last-child { text-align: left; }
}

/* hubs */
.hubrows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.hubrow { display: grid; grid-template-columns: 11rem minmax(0, 1fr) minmax(0, 0.9fr); gap: var(--sc-6); padding: var(--sc-6) 0; border-bottom: 1px solid var(--line); align-items: start; }
.hubrow img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--sc-r-md); box-shadow: var(--sc-e1); }
.hubrow h2 { font-size: var(--sc-t-2xl); line-height: 1.02; letter-spacing: -0.03em; font-weight: 580; margin: var(--sc-2) 0 var(--sc-3); }
.hubrow h2 a { color: inherit; text-decoration: none; }
.hubrow h2 a:hover { text-decoration: underline; text-decoration-color: var(--sc-accent); text-underline-offset: 0.12em; }
.hubrow .lead { margin: 0; color: var(--sc-ink-soft); max-width: 46ch; }
.hubrow ul { list-style: none; margin: 0; padding: 0; }
.hubrow ul li { padding: 9px 0 9px 18px; border-top: 1px solid var(--line); position: relative; font-size: var(--sc-t-sm); }
.hubrow ul li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 7px; height: 1px; background: var(--sc-accent); }
.hubrow .textlink { display: inline-flex; gap: 6px; margin-top: var(--sc-4); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--sc-7); }
.chips button { font: 500 0.82rem/1 var(--sc-font-text); padding: 10px 14px; min-height: 40px; border-radius: var(--sc-r-md); border: 1px solid var(--line-strong); background: transparent; color: var(--sc-ink); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--sc-ink); color: var(--sc-canvas); border-color: var(--sc-ink); }
.sector { margin-bottom: var(--sc-8); }
.sector h2 { font-size: var(--sc-t-xl); letter-spacing: -0.02em; font-weight: 560; margin: 0 0 var(--sc-5); padding-bottom: var(--sc-3); border-bottom: 1px solid var(--line-strong); }
.exgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: var(--sc-6) var(--sc-5); }
.exgrid .exhibit { width: auto; }
.exgrid .exhibit figure { max-height: none; }
.exgrid .exhibit[hidden] { display: none; }
.sector[hidden] { display: none; }
/* notes for content that must be confirmed before launch */
.todo { border: 1px dashed var(--sc-accent); border-radius: var(--sc-r-md); padding: var(--sc-4) var(--sc-5); color: var(--sc-ink); background: color-mix(in oklab, var(--sc-accent) 6%, transparent); font-size: var(--sc-t-sm); max-width: 62ch; margin: 0 0 var(--sc-5); }
.todo b { color: var(--sc-accent); font-family: var(--sc-font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.prose ul { margin: 0 0 var(--sc-5); padding-left: 1.1em; }
.prose li { margin-bottom: 8px; font-size: var(--sc-t-base); }
.prose h2 { font-size: var(--sc-t-xl); letter-spacing: -0.02em; margin: var(--sc-7) 0 var(--sc-3); }
.tablewrap { overflow-x: auto; }
.itable { width: 100%; border-collapse: collapse; font-size: var(--sc-t-sm); min-width: 34rem; }
.itable th, .itable td { text-align: left; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.itable th { font-family: var(--sc-font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sc-ink-soft); font-weight: 500; }
.itable td a { color: var(--sc-ink); }
.contact-direct { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--sc-5); margin-top: var(--sc-7); }
.contact-direct div { border-top: 1px solid var(--line-strong); padding-top: var(--sc-4); }
.contact-direct span { display: block; }
@media (max-width: 860px) {
  .hubrow { grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--sc-4); }
  .hubrow ul { grid-column: 1 / -1; }
}
mark.confirm { background: color-mix(in oklab, var(--sc-accent) 14%, transparent); color: var(--sc-ink); padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }
.inner .close { padding-top: var(--sc-6); }

/* ------------------------------------------------------------------ blog -- */
.post { display: grid; grid-template-columns: minmax(0, 62ch) minmax(240px, 340px); gap: var(--sc-8); align-items: start; justify-content: space-between; }
.post .vid { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--bar-h) + var(--sc-5)); margin: 0; }
.post .prose { grid-column: 1; grid-row: 1; }
.vid__btn { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #0D1116; border-radius: var(--sc-r-lg); overflow: hidden; cursor: pointer; aspect-ratio: 9 / 16; box-shadow: var(--sc-e2); }
.vid__btn img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--sc-ease-out), opacity 300ms; }
.vid__btn:hover img { transform: scale(1.02); opacity: 0.92; }
.vid__play { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; display: grid; place-items: center; border-radius: 50%; background: var(--sc-accent); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.35); transition: transform 200ms var(--sc-ease-out); }
.vid__play svg { width: 28px; height: 28px; margin-left: 3px; }
.vid__btn:hover .vid__play, .vid__btn:focus-visible .vid__play { transform: scale(1.08); }
.vid iframe { display: block; width: 100%; aspect-ratio: 9 / 16; border: 0; border-radius: var(--sc-r-lg); background: #000; }
.vid figcaption { margin-top: var(--sc-4); }
.vid__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sc-2); }
.vid__links a { padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--sc-r-md); text-decoration: none; color: var(--sc-ink); font-size: var(--sc-t-sm); }
.vid__links a:hover { border-color: var(--sc-ink); }
.prose .faq { margin-top: var(--sc-4); }
.bcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--sc-7) var(--sc-6); }
.bcard { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: var(--sc-5); align-items: start; padding-top: var(--sc-5); border-top: 1px solid var(--line-strong); }
.bcard__img img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--sc-r-md); box-shadow: var(--sc-e1); }
.bcard h2 { font-size: 1.3rem; line-height: 1.15; letter-spacing: -0.02em; font-weight: 580; margin: var(--sc-2) 0 var(--sc-3); }
.bcard h2 a { color: inherit; text-decoration: none; }
.bcard h2 a:hover { text-decoration: underline; text-decoration-color: var(--sc-accent); text-underline-offset: 0.12em; }
.bcard p { margin: 0; color: var(--sc-ink-soft); font-size: var(--sc-t-sm); }
@media (max-width: 900px) {
  .post { grid-template-columns: minmax(0, 1fr); gap: var(--sc-6); }
  .post .vid { grid-column: 1; grid-row: 1; position: static; max-width: 340px; width: 100%; }
  .post .prose { grid-row: 2; }
}
.cta-box { margin: var(--sc-8) 0 var(--sc-5); padding: var(--sc-6); background: var(--sc-surface); border-radius: var(--sc-r-lg); box-shadow: var(--sc-e1), var(--sc-edge); border-left: 3px solid var(--sc-accent); }
.cta-box h2 { margin: 0 0 var(--sc-3) !important; }
.cta-box p { font-size: var(--sc-t-base) !important; color: var(--sc-ink-soft); }
.cta-box__actions { display: flex; flex-wrap: wrap; gap: var(--sc-3); margin-top: var(--sc-4); }
