/* v1.22 — usability, mobile, and interaction polish.
   No decorative feature showcase: these rules only improve reading and operation. */

:root {
  --tap: 44px;
  --reading: 72ch;
}

html {
  scroll-padding-top: 82px;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

:is(a, button, input, select, textarea) {
  touch-action: manipulation;
}

:is(a, button):focus-visible {
  outline-width: 2px;
  outline-offset: 3px;
}

/* Cross-document transition is progressive enhancement only. */
@view-transition { navigation: auto; }
.v18-brand,
.hub-brand,
.brand-v16 { view-transition-name: dzkrium-brand; }
::view-transition-old(root) { animation: 120ms ease both v22-page-out; }
::view-transition-new(root) { animation: 180ms ease both v22-page-in; }
::view-transition-old(dzkrium-brand),
::view-transition-new(dzkrium-brand) { animation-duration: 180ms; }
@keyframes v22-page-out { to { opacity: .55; } }
@keyframes v22-page-in { from { opacity: .45; } }

/* ---------------- Home ---------------- */
.portfolio-home-v21 .v20-header {
  box-shadow: none;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.portfolio-home-v21 .v20-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
}
.portfolio-home-v21 .v18-brand {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}
.portfolio-home-v21 .v18-nav a {
  min-height: var(--tap);
  position: relative;
}
.portfolio-home-v21 .v18-nav a.is-current::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 2px;
  background: var(--v18-accent);
}
.portfolio-home-v21 .v18-control,
.portfolio-home-v21 .v18-menu,
.portfolio-home-v21 .v20-command {
  min-width: var(--tap);
  width: auto;
  min-height: var(--tap);
  height: var(--tap);
}
.portfolio-home-v21 .v18-control,
.portfolio-home-v21 .v18-menu { width: var(--tap); }
.portfolio-home-v21 .v20-command { padding-inline: 11px; }

.portfolio-home-v21 .v20-hero {
  min-height: calc(100svh - 66px);
}
.portfolio-home-v21 .v20-lead { max-width: 760px; }
.portfolio-home-v21 .v20-intro { max-width: var(--reading); }
.portfolio-home-v21 .v20-primary-link,
.portfolio-home-v21 .v20-quiet-link {
  min-height: 48px;
}

/* Capability explorer: clear selection, no incidental hover switching. */
.portfolio-home-v21 .v20-capability-row {
  transition: background-color .16s ease, box-shadow .16s ease;
}
.portfolio-home-v21 .v20-capability-row:active { background: color-mix(in srgb, var(--v18-accent) 10%, var(--v18-panel)); }
.portfolio-home-v21 .v20-capability-detail {
  transition: opacity .14s ease;
}
.portfolio-home-v21 .v20-capability-detail.is-switching { opacity: .58; }

/* Activity rows are links; make the full row feel clickable without looking like buttons. */
.portfolio-home-v21 .v20-activity-row {
  border-inline: 1px solid transparent;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
@media (hover: hover) {
  .portfolio-home-v21 .v20-activity-row:hover {
    border-inline-color: color-mix(in srgb, var(--v18-accent) 24%, transparent);
    transform: translateX(2px);
  }
}

/* Readability floor. Tiny labels stay labels, useful copy does not. */
.portfolio-home-v21 .v20-about-copy p { max-width: var(--reading); font-size: 16px; }
.portfolio-home-v21 .v20-about-meta dd { font-size: 14px; }
.portfolio-home-v21 .v20-social a { min-height: 96px; }

/* ---------------- Hub pages: Now / Updates / Add-ons ---------------- */
.hub-page { --hub-max: 1240px; }
.hub-header { transition: box-shadow .18s ease, border-color .18s ease; }
.hub-header.is-scrolled { box-shadow: 0 10px 30px rgba(0,0,0,.10); }
.hub-header__inner { min-height: 66px; grid-template-columns: 1fr auto auto; gap: 12px; }
.hub-brand,
.hub-back,
.hub-control,
.hub-top-nav a { min-height: var(--tap); }
.hub-top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.hub-top-nav a {
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  border-bottom: 2px solid transparent;
}
.hub-top-nav a:hover { color: var(--text); }
.hub-top-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brown); }
.hub-actions { margin-left: 8px; }
.hub-control { width: var(--tap); min-width: var(--tap); }
.hub-hero__intro,
.hub-current-item > p,
.hub-addon-item__main > p,
.hub-post > p { font-size: 15px; line-height: 1.85; }
.hub-community-note { font-size: 12px; }
.hub-current-item,
.hub-addon-item,
.hub-post {
  transition: border-color .16s ease, background-color .16s ease;
}
@media (hover: hover) {
  .hub-current-item:hover,
  .hub-addon-item:hover,
  .hub-post:hover { border-color: color-mix(in srgb, var(--brown) 34%, var(--line)); }
}
.hub-addon-item__actions a,
.hub-heart { min-height: var(--tap); }
.hub-footer__nav a {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}

/* ---------------- Project / inquiry pages ---------------- */
.project-page .site-header,
.work-page .site-header {
  min-height: 66px;
  padding-inline: max(20px, calc((100vw - 1240px) / 2));
  height: auto;
  padding-top: max(0px, env(safe-area-inset-top));
}
.project-page .brand,
.work-page .brand,
.project-page .project-back,
.work-page .project-back,
.project-page .control-button,
.work-page .control-button { min-height: var(--tap); }
.project-detail-title p,
.case-row p,
.service-row p,
.process-step p,
.work-hero__copy > p:last-child { font-size: 15px; line-height: 1.85; }
.case-row h2,
.service-row h3,
.process-step h3 { text-wrap: balance; }
.contact-form :is(input, select, textarea) { min-height: 48px; }
.contact-form textarea { min-height: 150px; resize: vertical; }
.site-footer a { min-height: var(--tap); display: inline-flex; align-items: center; }

/* Utility controls */
.dzkrium-back-top {
  min-height: var(--tap);
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 16px));
}
.dzkrium-back-top.is-visible { opacity: .88; }

/* ---------------- Tablet / mobile ---------------- */
@media (max-width: 900px) {
  html { scroll-padding-top: 70px; }

  /* Home header becomes a proper touch UI. */
  .portfolio-home-v21 .v18-header__inner {
    width: min(calc(100% - 24px), var(--v20-max));
    min-height: 62px;
    gap: 10px;
  }
  .portfolio-home-v21 .v20-command kbd { display: none; }
  .portfolio-home-v21 .v20-command { width: var(--tap); padding: 0; justify-content: center; }
  .portfolio-home-v21 .v18-mobile {
    position: fixed;
    top: calc(62px + max(8px, env(safe-area-inset-top)));
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100dvh - 82px - env(safe-area-inset-bottom));
    overflow-y: auto;
    padding: 8px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--v18-panel) 97%, transparent);
    box-shadow: 0 24px 70px rgba(0,0,0,.34);
  }
  .portfolio-home-v21 .v18-mobile a {
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-size: 15px;
  }
  body.menu-open::before {
    content: "";
    position: fixed;
    z-index: 90;
    inset: 62px 0 0;
    background: rgba(0,0,0,.28);
    backdrop-filter: blur(2px);
  }

  .portfolio-home-v21 .v20-hero {
    min-height: 0;
    padding-top: 0;
  }
  .portfolio-home-v21 .v20-hero__copy {
    padding-top: clamp(52px, 9vw, 76px);
    padding-bottom: 42px;
  }
  .v21-hero-brief { margin-bottom: 44px; }

  /* On touch widths the capability selector works like horizontal tabs,
     so the selected explanation is always immediately below the choice. */
  .portfolio-home-v21 .v20-capability-layout { display: block; }
  .portfolio-home-v21 .v20-capability-list {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    border-right: 0;
    border-bottom: 1px solid var(--v18-line);
  }
  .portfolio-home-v21 .v20-capability-list::-webkit-scrollbar { display: none; }
  .portfolio-home-v21 .v20-capability-row {
    flex: 0 0 min(270px, 72vw);
    min-height: 92px;
    scroll-snap-align: start;
    border-right: 1px solid var(--v18-line);
    border-bottom: 0;
  }
  .portfolio-home-v21 .v20-capability-row:last-child { border-right: 0; }
  .portfolio-home-v21 .v20-capability-row.is-active {
    box-shadow: inset 0 -3px 0 var(--v18-accent);
  }
  .portfolio-home-v21 .v20-capability-detail { min-height: 260px; border-top: 0; }

  /* Hub header navigation is useful on desktop, not crammed onto phones. */
  .hub-top-nav { display: none; }
  .hub-header__inner { width: min(calc(100% - 28px), var(--hub-max)); min-height: 62px; grid-template-columns: 1fr auto; }

  .project-page .site-header,
  .work-page .site-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding-inline: 20px;
  }
  .project-page .project-back,
  .work-page .project-back { grid-row: 2; grid-column: 1 / -1; justify-self: start; margin-bottom: 10px; }
  .project-page .header-actions,
  .work-page .header-actions { grid-column: 2; grid-row: 1; }
}

@media (max-width: 680px) {
  .portfolio-home-v20 main,
  .portfolio-home-v20 .v20-footer { width: min(calc(100% - 24px), var(--v20-max)); }

  .portfolio-home-v21 .v20-hero h1 {
    font-size: clamp(48px, 16vw, 68px);
    line-height: .91;
    letter-spacing: -.06em;
  }
  .portfolio-home-v21 .v20-lead { font-size: 20px; line-height: 1.5; }
  .portfolio-home-v21 .v20-intro { font-size: 15px; line-height: 1.82; }
  .portfolio-home-v21 .v20-hero__actions { gap: 10px; }
  .portfolio-home-v21 .v20-primary-link,
  .portfolio-home-v21 .v20-quiet-link { min-height: 50px; }

  .v21-brief-row {
    min-height: 96px;
    grid-template-columns: 68px minmax(0,1fr) 24px;
    padding: 14px 0;
  }
  .v21-brief-row strong { font-size: 16px; }
  .v21-brief-row small { font-size: 12px; line-height: 1.45; }

  .portfolio-home-v21 .v20-section { padding: 56px 0; }
  .portfolio-home-v21 .v20-section-head { margin-bottom: 28px; }
  .portfolio-home-v21 .v20-section-head h2 { font-size: clamp(30px, 9vw, 38px); }
  .portfolio-home-v21 .v20-section-head div:last-child > p { font-size: 15px; line-height: 1.7; }

  .portfolio-home-v21 .v20-capability-row strong { font-size: 16px; }
  .portfolio-home-v21 .v20-capability-row small { font-size: 12px; }
  .portfolio-home-v21 .v20-capability-detail { padding: 24px 18px; }
  .portfolio-home-v21 .v20-capability-detail h3 { font-size: 28px; }
  .portfolio-home-v21 .v20-capability-detail p { font-size: 15px; line-height: 1.75; }

  .portfolio-home-v21 .v20-activity-row {
    min-height: 0;
    grid-template-columns: 52px minmax(0,1fr) 24px;
    gap: 10px;
    padding: 18px 0;
  }
  .portfolio-home-v21 .v20-activity-row > span:first-child { font-size: 10px; }
  .portfolio-home-v21 .v20-activity-row strong { font-size: 17px; }
  .portfolio-home-v21 .v20-activity-row small { font-size: 11px; }
  .portfolio-home-v21 .v20-activity-row p {
    grid-column: 2 / -1;
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
  }

  .portfolio-home-v21 .v20-about-copy p { font-size: 15px; line-height: 1.85; }
  .portfolio-home-v21 .v20-about-meta > div { grid-template-columns: 68px 1fr; gap: 12px; }
  .portfolio-home-v21 .v20-about-meta dd { font-size: 13px; }
  .portfolio-home-v21 .v20-social a { min-height: 82px; }

  /* Hub pages */
  .hub-page { background-size: 40px 40px; }
  .hub-shell,
  .hub-header__inner { width: min(calc(100% - 24px), var(--hub-max)); }
  .hub-header__inner { min-height: 60px; gap: 8px; }
  .hub-brand::after { display: none; }
  .hub-actions { gap: 6px; margin-left: 0; }
  .hub-back,
  .hub-control { min-height: var(--tap); }
  .hub-hero { padding: 50px 0 42px; }
  .hub-hero__eyebrow { margin-bottom: 14px; font-size: 10px; }
  .hub-hero h1 { font-size: clamp(42px, 13vw, 58px); }
  .hub-hero__intro { margin-top: 18px; font-size: 15px; line-height: 1.75; }
  .hub-section { padding: 42px 0 56px; }
  .hub-current-list,
  .hub-addon-list,
  .hub-post-list { gap: 12px; }
  .hub-current-item,
  .hub-addon-item,
  .hub-post { padding: 22px 18px; }
  .hub-current-item__top,
  .hub-addon-item__meta,
  .hub-post__meta { font-size: 10px; }
  .hub-current-item h2,
  .hub-addon-item h2,
  .hub-post h2 { margin-top: 18px; font-size: clamp(25px, 8vw, 34px); }
  .hub-current-item > p,
  .hub-addon-item__main > p,
  .hub-post > p { font-size: 15px; line-height: 1.75; }
  .hub-tags span { font-size: 10px; padding: 7px 8px; }
  .hub-addon-item { gap: 24px; }
  .hub-addon-item__actions a { min-height: 48px; }
  .hub-post__bottom { margin-top: 22px; padding-top: 16px; }
  .hub-heart { min-height: 48px; }
  .hub-footer { min-height: 0; padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); gap: 12px; }
  .hub-footer__nav { gap: 6px 18px; }
  .hub-footer__nav a { min-height: 40px; font-size: 12px; }

  /* Project */
  .project-page .site-shell,
  .work-page .site-shell { border-inline: 0; }
  .project-page .site-header,
  .work-page .site-header { padding-inline: 14px; }
  .project-detail-meta { padding: 26px 16px 0; }
  .project-detail-title { padding: 20px 16px 42px; }
  .project-detail-title h1 { font-size: clamp(42px, 13vw, 58px); }
  .project-detail-title p { margin-top: 20px; font-size: 15px; line-height: 1.75; }
  .project-detail-hero > .project-visual { min-height: 300px; }
  .project-overview { grid-template-columns: 1fr; }
  .project-fact-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .case-row { grid-template-columns: 42px 1fr; gap: 14px; padding: 26px 16px; }
  .case-row p { grid-column: 2; font-size: 15px; }

  /* Work / contact */
  .work-hero__meta { min-height: 72px; padding: 18px 16px; }
  .work-hero__copy { padding: 54px 16px; }
  .work-hero__copy h1 { font-size: clamp(42px, 13vw, 58px); }
  .work-hero__copy > p:last-child { margin-top: 22px; font-size: 15px; line-height: 1.75; }
  .work-page .section { padding-inline: 16px; }
  .service-row { grid-template-columns: 34px 1fr 20px; gap: 10px; padding: 20px 0; }
  .service-row h3 { font-size: 20px; }
  .service-row p { grid-column: 2 / -1; font-size: 15px; }
  .process-step p { font-size: 14px; }
  .contact-section { gap: 36px; }
  .contact-copy > p { font-size: 15px; line-height: 1.75; }
  .button { min-height: 48px; }
}

@media (max-width: 420px) {
  .portfolio-home-v21 .v18-brand { font-size: 13px; }
  .portfolio-home-v21 .v18-brand::after { display: none; }
  .portfolio-home-v21 .v18-actions { gap: 4px; }
  .portfolio-home-v21 .v20-command,
  .portfolio-home-v21 .v18-control,
  .portfolio-home-v21 .v18-menu { width: 42px; min-width: 42px; height: 42px; min-height: 42px; }
  .v21-brief-label { font-size: 9px; }
  .hub-back { width: 42px; min-width: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation-duration: 0s !important; }
  .portfolio-home-v21 .v20-activity-row { transform: none !important; }
}
