/* Polish layer: portfolio type scale, WCAG AA contrast, one content edge, concentric radii.
   Loaded after site.css. The hero keeps the Kin OS spec values; everything after it reads
   at portfolio scale (body text never below 15px, meta never below 13px). */

:root {
  /* Contrast: secondary and tertiary ink lifted so they pass 4.5:1 on cards as well as on black.
     #b8b8c0 on #28282c ≈ 8.1:1, #9e9ea7 on #28282c ≈ 5.6:1 (on #000: 10.6 and 7.5). */
  --ink-2: #b8b8c0;
  --ink-3: #9e9ea7;

  /* One content edge shared by blocks, screens and footer. */
  --edge: max(24px, calc((100vw - var(--u) * 1320) / 2));

  /* Portfolio type scale (1.25 ratio around a 17px body at the 1470 frame). */
  --f-display: clamp(36px, calc(var(--u) * 58), 76px);
  --f-h3: clamp(20px, calc(var(--u) * 23), 26px);
  --f-lead: clamp(18px, calc(var(--u) * 21), 24px);
  --f-body: clamp(16px, calc(var(--u) * 17), 19px);
  --f-small: clamp(15px, calc(var(--u) * 15), 17px);
  --f-meta: clamp(14px, calc(var(--u) * 14), 15px);
  --f-label: clamp(13px, calc(var(--u) * 13), 14px);
  --lh-body: 1.6;
  --ctl-h: clamp(36px, calc(var(--u) * 40), 46px);
}
.panel { --ink-3: #a3a3ab; }

/* ---------- Shared components ---------- */
.badge { height: auto; min-height: 30px; padding: 6px 12px; font-size: var(--f-meta); }
.chip, button.chip { height: var(--ctl-h); padding: 0 calc(var(--u) * 16); font-size: var(--f-small); border-radius: var(--r-s); }
.chip:has(kbd) { padding-right: 8px; }
.chip kbd { height: 24px; font-size: var(--f-label); }
.chip--main { font-weight: 500; }
.hd__nav a { font-size: var(--f-meta); }
.fineprint { font-size: var(--f-meta); line-height: 1.5; }

/* Eyebrows: badge + quiet label; the label reads as a caps label, not a footnote. */
.screen__eyebrow { gap: 12px; font-size: var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.screen__eyebrow .badge { text-transform: none; letter-spacing: 0; }

/* Display headings: two-tone, the second line still clears AA comfortably. */
.block .screen__title, .about .screen__title, .screen .screen__title {
  font-size: var(--f-display); line-height: 1.04; letter-spacing: -.035em; text-wrap: balance;
}
.screen__sub { color: #8f8f99; }
.block .screen__text, .screen .screen__text, .about .screen__text {
  max-width: 58ch; font-size: var(--f-lead); line-height: 1.55; color: var(--ink-2); text-wrap: pretty;
}
.block__head { gap: 20px; max-width: calc(var(--u) * 980); margin-bottom: clamp(32px, calc(var(--u) * 56), 72px); }
.block { padding: clamp(96px, 14vh, 160px) var(--edge) 0; }
.block--tight { padding-bottom: 0; }

/* Panels: one rhythm for titles, text and notes. */
.panel { gap: 20px; padding: clamp(20px, calc(var(--u) * 28), 32px); }
.panel__title { font-size: var(--f-h3); line-height: 1.25; letter-spacing: -.015em; }
.panel__text { font-size: var(--f-body); line-height: var(--lh-body); }
.panel__note { font-size: var(--f-meta); line-height: 1.5; }
.pane__role { font-size: var(--f-body); }
.pane__role span, .pane__list, .awards li { font-size: var(--f-small); line-height: 1.55; }
.stat__label, .legend, .bars__axis { font-size: var(--f-meta); }
.seg__btn { font-size: var(--f-meta); }

/* ---------- Brands ---------- */
.brands { gap: 12px; }
.brand { min-height: calc(var(--u) * 184); padding: 16px; border-radius: var(--r-l); }
.brand__name { font-size: var(--f-small); }
.brand__meta, .brand__count { font-size: var(--f-label); color: var(--ink-3); }
.brand__logo img { opacity: .9; }

/* ---------- World ---------- */
.world__tab, .fchip, .filters__brand select { height: var(--ctl-h); font-size: var(--f-meta); padding: 0 14px; }
.filters__brand select { padding-right: 34px; }
.world__list p, .filters__status { font-size: var(--f-meta); }

/* ---------- Project cards: concentric radii (20 outer − 10 inset = 10 inner) ---------- */
.pcard { gap: 16px; padding: 10px 10px 20px; border-radius: var(--r-l); }
.pcard__media { border-radius: 10px; }
.pcard__body { gap: 10px; padding: 0 10px; }
.pcard__eyebrow { font-size: var(--f-label); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.pcard__title { font-size: var(--f-h3); line-height: 1.2; }
.featured .pcard__title { font-size: clamp(24px, calc(var(--u) * 30), 36px); letter-spacing: -.025em; }
.pcard__desc { font-size: var(--f-small); line-height: 1.55; }
.featured .pcard:first-child .pcard__desc { font-size: var(--f-body); }
.pcard__meta { font-size: var(--f-meta); line-height: 1.5; gap: 4px 14px; }
.pcard__tags li { padding: 5px 9px; font-size: var(--f-label); color: #e2e2e8; }
.pcard__cta { font-size: var(--f-small); font-weight: 500; }
.featured .pcard:first-child { padding: 10px 10px 10px 10px; gap: 28px; }
.featured .pcard:first-child .pcard__body { padding: 16px 20px 16px 0; gap: 14px; }

/* ---------- Capabilities + flow ---------- */
.cap__no, .flow__no { font-size: clamp(26px, calc(var(--u) * 32), 38px); }
.caps, .flow { gap: 16px; }

/* ---------- Scenes over the point cloud: keep the copy legible, align to the shared edge ---------- */
.screen__head { position: relative; isolation: isolate; }
.screen__head::before {
  content: ""; position: absolute; inset: -48px -64px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .78), rgba(0, 0, 0, .5) 55%, transparent);
}
.screen__col { width: min(calc(var(--u) * 560), 40vw); gap: 48px; }
.screen--left .screen__col { margin-left: var(--edge); }
.screen--right .screen__col { margin-left: calc(100vw - var(--edge) - min(calc(var(--u) * 560), 40vw)); }

/* ---------- About + quotes ---------- */
.about { gap: clamp(32px, calc(var(--u) * 72), 96px); }
.about__photo { border-radius: var(--r-l); }
.quote blockquote { font-size: var(--f-body); line-height: 1.55; }
.quote--wide blockquote { font-size: clamp(20px, calc(var(--u) * 24), 28px); line-height: 1.35; }

/* ---------- Contact ---------- */
#contact { padding-bottom: clamp(96px, 14vh, 160px); }
#contact .contact__card { max-width: none; padding: clamp(28px, calc(var(--u) * 56), 72px); }
.contact__title { font-size: clamp(36px, calc(var(--u) * 64), 84px); line-height: 1.02; letter-spacing: -.04em; }
.contact__body { gap: 28px; }
.contact__body .panel__text { font-size: var(--f-lead); max-width: 52ch; }

/* ---------- Footer ---------- */
.ft { display: block; padding: 0 var(--edge) 32px; font-size: var(--f-small); color: var(--ink-2); }
.ft__card {
  display: grid; gap: clamp(32px, calc(var(--u) * 56), 72px); padding: clamp(28px, calc(var(--u) * 48), 64px);
  border-radius: calc(var(--r-l) + 8px); background: rgba(24, 24, 28, .72);
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.ft__top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, calc(var(--u) * 64), 96px); }
.ft__intro { display: grid; align-content: start; gap: 16px; }
.ft__name { margin: 0; font-size: var(--f-h3); font-weight: 500; color: var(--ink-1); letter-spacing: -.015em; }
.ft__role { margin: 0; color: var(--ink-2); line-height: 1.55; max-width: 36ch; }
.ft__status { display: inline-flex; align-items: center; gap: 10px; width: fit-content; padding: 8px 12px; border-radius: var(--r-pill); background: rgba(124, 248, 250, .08); color: #c9fbfc; font-size: var(--f-meta); }
.ft__status i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(124, 248, 250, .16); }
.ft__ctas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ft__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ft__col h2 { margin: 0 0 14px; font-size: var(--f-label); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ft__col ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ft__col a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--ink-1); text-decoration: none; transition: color var(--dur-ui) var(--ease-out); }
.ft__col a span { color: var(--ink-3); font-size: .86em; transition: transform var(--dur-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .ft__col a:hover { color: var(--lavender); }
  .ft__col a:hover span { transform: translate(2px, -2px); }
}
.ft__mark {
  margin: 0; font-family: var(--font-pixel); font-weight: 400; line-height: .8; white-space: nowrap; overflow: hidden;
  font-size: calc((100vw - var(--edge) * 2 - clamp(28px, calc(var(--u) * 48), 64px) * 2) / 8.5);
  background: linear-gradient(180deg, rgba(252, 252, 252, .9), rgba(252, 252, 252, .18));
  -webkit-background-clip: text; background-clip: text; color: transparent; user-select: none;
}
.ft__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: var(--f-meta); }
.ft__bottom p { margin: 0; }
.ft__bottom a { color: var(--ink-1); }

/* ---------- Case study ---------- */
.cs__crumb { font-size: var(--f-meta); }
.cs-hero__sub { font-size: clamp(22px, calc(var(--u) * 30), 36px); color: var(--ink-2); }
.cs-hero__summary { font-size: var(--f-lead); line-height: 1.6; }
.cs-meta dt, .cs-nav p { font-size: var(--f-label); }
.cs-meta dd { font-size: var(--f-small); }
.cs-high span, .cs-gal figcaption, .cs-quote figcaption, .cs-pn a span { font-size: var(--f-meta); }
.cs-nav a { font-size: var(--f-small); padding: 8px 12px; }
.cs-sec > h2 { font-size: clamp(26px, calc(var(--u) * 36), 44px); line-height: 1.1; letter-spacing: -.03em; }
.cs-sec > h2 small { font-size: var(--f-meta); margin-bottom: 10px; }
.cs-sec p, .cs-list li, .cs-steps span, .cs-feats span, .cs-methods span, .cs-metrics span { font-size: var(--f-body); line-height: var(--lh-body); }
.cs-steps b, .cs-feats b, .cs-methods b { font-size: var(--f-body); }
.cs-note { font-size: var(--f-small); }
.cs-pn a b { font-size: var(--f-body); }
.cs-rel h2 { font-size: var(--f-h3); }
.cs-list li, .cs-steps li, .cs-feats li, .cs-methods li, .cs-metrics div { border-radius: var(--r-m); }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .ft__top { grid-template-columns: minmax(0, 1fr); }
  .screen__col, .screen--left .screen__col, .screen--right .screen__col { width: min(560px, calc(100vw - var(--edge) * 2)); }
  .screen--right .screen__col { margin-left: calc(100vw - var(--edge) - min(560px, calc(100vw - var(--edge) * 2))); }
  .featured .pcard:first-child .pcard__body { padding: 0 10px 10px; }
}

/* ---------- Phones ---------- */
@media (max-width: 767px) {
  :root { --edge: 16px; --f-display: 34px; --f-lead: 18px; --ctl-h: 42px; }
  .block { padding: 88px var(--edge) 0; }
  .screen__col, .screen--right .screen__col, .screen--left .screen__col { width: auto; margin: 0 var(--edge); }
  .screen__head::before { inset: -24px -16px; }
  .brand { min-height: 152px; padding: 12px; }
  .ft__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .ft__card { border-radius: var(--r-l); }
  .ft__bottom { flex-direction: column; }
  .contact__title { font-size: 34px; }
  .featured .pcard__title { font-size: 24px; }
}

/* Case-study hero fixes: cover aligns to the content edge, meta rows align to the top,
   logo tile and tags share one control height. */
.cs-cover figure { margin: 0; }
.cs-cover figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cs-meta div { align-content: start; }
.cs-hero__top { gap: 8px; }
.cs-logo { height: var(--ctl-h); padding: 0 14px; }
.cs-logo img { height: calc(var(--ctl-h) * .5); }
.cs-hero__top .badge { height: var(--ctl-h); min-height: 0; padding: 0 14px; }
.cs-gal figcaption { color: var(--ink-3); }

/* About: balanced columns on tablets, stacked photo-first below that. */
@media (max-width: 1100px) { .about { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
@media (max-width: 900px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .about__photo { max-width: 420px; }
}


/* ---------- Minimal home: tool logos, toolkit, quieter cards ---------- */
.hd__nav a { font-size: var(--f-small); }
.ti { display: inline-block; width: 18px; height: 18px; flex: none; object-fit: contain; vertical-align: -3px; }
.lchip .ti, .badge .ti, .chip .ti { width: 16px; height: 16px; padding: 2px; border-radius: 5px; background: #fff; box-sizing: content-box; }
.lchip { gap: 8px; }

.cap { gap: 14px; }
.cap .panel__text { font-size: var(--f-body); }
.cap__tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.cap__tools li { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 6px; border-radius: var(--r-pill); background: var(--fill-1); font-size: var(--f-meta); color: var(--ink-2); }
.cap__tools .ti { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: #fff; box-sizing: border-box; }

.flow__step { position: relative; }
.flow__icons { position: absolute; top: clamp(20px, calc(var(--u) * 28), 32px); right: clamp(20px, calc(var(--u) * 28), 32px); display: flex; }
.flow__icons .ti { width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: #fff; box-sizing: border-box; box-shadow: 0 0 0 3px rgba(40, 40, 44, 1); }
.flow__icons .ti + .ti { margin-left: -8px; }

.tools { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.tools__group { grid-column: span 2; align-content: start; gap: 18px; }
.tools__group:nth-child(3) { grid-column: span 2; }
.tools__group:nth-child(4), .tools__group:nth-child(5) { grid-column: span 3; }
.tools__title { margin: 0; font-size: var(--f-label); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tools__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--u) * 92), 1fr)); gap: 18px 12px; margin: 0; padding: 0; list-style: none; }
.tool { display: grid; justify-items: center; gap: 10px; text-align: center; }
.tool__icon { display: grid; place-items: center; width: clamp(52px, calc(var(--u) * 60), 68px); aspect-ratio: 1; border-radius: 16px; background: #fafafa;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .06), 0 8px 24px -12px rgba(0, 0, 0, .6); transition: transform 400ms var(--ease-expo); }
.tool__icon img { width: 56%; height: 56%; object-fit: contain; }
.tool__name { font-size: var(--f-meta); line-height: 1.3; color: var(--ink-1); }
@media (hover: hover) and (pointer: fine) { .tool:hover .tool__icon { transform: translateY(-3px) scale(1.04); } }

/* Cards: less text on the home page; detail lives in the case study. */
.pgrid .pcard__meta { display: none; }
.pcard__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.featured .pcard:first-child .pcard__desc { -webkit-line-clamp: 3; }
.pgrid .pcard__tags li:nth-child(n+4) { display: none; }

@media (max-width: 1100px) {
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools__group, .tools__group:nth-child(n) { grid-column: span 1; }
  .tools__group:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .tools { grid-template-columns: minmax(0, 1fr); }
  .tools__group:nth-child(n) { grid-column: auto; }
  .tools__list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 8px; }
  .tool__icon { width: 56px; border-radius: 14px; }
  .tool__name { font-size: 13px; }
}
