/**
 * Portfolio presentation — design system (single source of truth)
 *
 * Layers: tokens → slide-grid shell → shot-frame / shot-grid → content blocks
 * Layouts: content | solo | duo | split | title | contact
 *
 * Rebuild: node scripts/build-portfolio-html.mjs
 */

:root {
  /*
   * Design tokens · ultra-minimal dark deck
   * Ref: Notfatfox, v-bonstudio, Burak Canpolat, Olga Solomatina, designedbymasha (Web Guru Awards)
   */

  /* —— 1. Color · dark deck + legacy navy (design_ref ink/navy, не forest shell) —— */
  --color-bg: #141414;
  --color-bg-soft: #1a1a1a;
  --color-bg-elevated: #1f1f1f;
  --color-bg-card: rgba(255, 255, 255, 0.035);

  --color-text: #ffffff;
  --color-text-secondary: #b8b8b8;
  --color-text-muted: #9a9a9a;
  --color-text-tertiary: #666666;

  --color-accent: #314180;
  --color-accent-hover: #243954;
  --color-accent-deep: #02080e;

  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: #333333;
  --color-border-hover: rgba(255, 255, 255, 0.16);

  /* —— 2. Typography —— */
  --font-family: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-heavy: 800;

  --font-size-xs: 12px;
  --font-size-sm: 13px;
  --font-size-base: 15px;
  --font-size-md: 17px;
  --font-size-lg: clamp(15px, 1.5vw, 20px);
  --font-size-xl: clamp(17px, 2.2vw, 22px);
  --font-size-h2: clamp(28px, 4vw, 52px);
  --font-size-display: clamp(36px, 5.5vw, 64px);

  --line-height-tight: 0.98;
  --line-height-title: 1.02;
  --line-height-body: 1.45;

  --letter-spacing-tight: -0.04em;
  --letter-spacing-heading: -0.03em;
  --letter-spacing-caps: 0.14em;
  --letter-spacing-caps-sm: 0.1em;

  /* —— 3. Spacing · 8px grid —— */
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 22px;
  --space-5: 28px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 88px;

  /* —— 4. Layout —— */
  --layout-max: 1440px;
  --layout-grid-cols: 12;
  --layout-grid-gap: var(--space-4);
  --layout-zone-gap: var(--space-5);

  --layout-pad-x: var(--space-9);
  --layout-pad-y: var(--space-8);
  --layout-pad-bottom: var(--space-10);
  --layout-footer-x: var(--space-9);
  --layout-footer-y: 24px;
  /* fixed footer-ui: offset + nav buttons (44px) + gap */
  --footer-chrome-h: calc(var(--layout-footer-y) + 44px + var(--space-3));
  /* touch scroll tail — inside .slide-body after all content */
  --scroll-footer-extra: 100px;

  --measure-body: 44ch;
  --measure-head: 52ch;
  --measure-title: 14ch;
  --measure-tagline: 28ch;
  --measure-h2: 18ch;

  /* —— 5. Components —— */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --btn-pad-y: 14px;
  --btn-pad-x: 22px;
  --btn-font-size: 14px;
  --btn-gap: var(--space-2);

  --brand-mark-size: 10px;
  --brand-gap: 10px;

  --card-gap: var(--space-3);
  --split-gap: var(--layout-grid-gap);

  /* —— 6. Media · shot frames —— */
  --shot-aspect: 16 / 10;
  --shot-max-h: clamp(260px, 50vh, 460px);
  --shot-max-w-solo: min(100%, 880px);
  --shot-bar-h: 36px;
  --shot-radius: var(--radius-md);

  --shadow-shot: 0 28px 80px rgba(0, 0, 0, 0.55);
  --shadow-photo: 0 24px 64px rgba(0, 0, 0, 0.45);
  --shadow-accent: 0 4px 20px rgba(255, 82, 0, 0.35);

  /* —— 7. Motion —— */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
}

/* —— Base —— */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
}

.page-root {
  min-height: 100vh;
  min-height: 100dvh;
}

.slide {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: var(--layout-pad-y) var(--layout-pad-x) var(--layout-pad-bottom);
  overflow: hidden;
  animation: rise 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Legacy SPA deck (index-seed.html) */
.deck {
  height: 100%;
  position: relative;
  cursor: pointer;
}

.deck .slide {
  position: absolute;
  inset: 0;
  display: none;
  min-height: 0;
  overflow: hidden;
}

.deck .slide.is-on {
  display: flex;
  flex-direction: column;
}

/* —— Slide grid shell —— */
.slide-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--layout-grid-cols), 1fr);
  gap: var(--layout-grid-gap);
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  min-height: 0;
}

.slide-head {
  grid-column: 1 / -1;
}

.slide-head .topbar {
  margin-bottom: var(--layout-zone-gap);
}

.slide-head h1,
.slide-head h2 {
  margin-bottom: var(--space-1);
}

.slide-head .lead {
  max-width: var(--measure-head);
  margin-top: var(--space-2);
  margin-bottom: 0;
}

.slide-body {
  grid-column: 1 / -1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.layout-solo .slide-body,
.layout-duo .slide-body,
.layout-split .slide-body {
  flex: 1;
}

@media (min-width: 961px) {
  .layout-solo .slide-body,
  .layout-duo .slide-body,
  .layout-split .slide-body {
    justify-content: center;
  }

  .layout-solo .slide-grid {
    grid-template-columns: repeat(var(--layout-grid-cols), 1fr);
    align-items: center;
    flex: 1;
  }

  .layout-solo .slide-head {
    grid-column: 1 / span 4;
    align-self: center;
  }

  .layout-solo .slide-head h2,
  .layout-solo .slide-head .lead {
    max-width: none;
  }

  .layout-solo .slide-body {
    grid-column: 5 / -1;
    align-items: center;
  }

  .layout-solo .shot-grid--solo,
  .layout-solo .shot-grid--solo .shot-frame {
    width: 100%;
    max-width: none;
  }
}

.slide.layout-title {
  display: flex;
  flex-direction: column;
  padding-bottom: var(--layout-pad-bottom);
  overflow: hidden;
}

.slide.layout-title .title-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  gap: 0;
}

.slide.layout-title .title-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.slide.layout-title .title-header-role {
  font-size: var(--font-size-sm);
  letter-spacing: var(--letter-spacing-caps-sm);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.slide.layout-title .title-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(var(--space-6), 8vh, var(--space-10)) 0;
  min-height: 0;
}

.slide.layout-title .title-eyebrow {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.slide.layout-title .title-display {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-display);
  font-weight: var(--font-weight-heavy);
  letter-spacing: var(--letter-spacing-tight);
  line-height: var(--line-height-title);
  max-width: var(--measure-title);
}

.slide.layout-title .title-tagline {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-body);
  color: var(--color-text-secondary);
  max-width: var(--measure-tagline);
  margin-bottom: var(--space-5);
}

.slide.layout-title .title-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--btn-gap);
}

.slide.layout-title .title-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.slide.layout-title .title-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* —— Contact slide (hero layout) —— */
.slide.layout-contact {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  padding-bottom: var(--layout-pad-bottom);
  overflow: hidden;
}

.slide.layout-contact .contact-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-height: 0;
}

.slide.layout-contact .contact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.slide.layout-contact .contact-hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  letter-spacing: var(--letter-spacing-caps-sm);
  text-transform: uppercase;
}

.slide.layout-contact .contact-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(240px, 0.72fr);
  gap: var(--space-7);
  align-items: center;
  min-height: 0;
}

.slide.layout-contact .contact-title {
  font-size: clamp(30px, 4.6vw, 58px);
  font-weight: var(--font-weight-heavy);
  letter-spacing: var(--letter-spacing-heading);
  line-height: var(--line-height-tight);
  max-width: 16ch;
  margin-bottom: var(--space-5);
}

.slide.layout-contact .contact-points {
  list-style: none;
  margin-bottom: var(--space-5);
}

.slide.layout-contact .contact-points li {
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
  font-size: var(--font-size-md);
  line-height: 1.35;
  color: var(--color-text-secondary);
}

.slide.layout-contact .contact-points li:first-child {
  border-top: none;
  padding-top: 0;
}

.slide.layout-contact .contact-photo {
  position: relative;
  margin: 0;
  align-self: center;
  max-width: 360px;
  width: 100%;
}

.slide.layout-contact .contact-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  box-shadow: var(--shadow-photo);
  filter: saturate(0.92) contrast(1.04);
}

.slide.layout-contact .contact-caption {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slide.layout-contact .contact-caption strong {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-heavy);
}

.slide.layout-contact .contact-caption span {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.slide.dark,
.slide.paper,
.slide.green {
  background: var(--color-bg);
  color: var(--color-text);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* —— Topbar —— */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
  font-size: var(--font-size-xs);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
}

.brand,
.slide.layout-title .title-brand,
.slide.layout-contact .contact-mark,
.mark {
  display: inline-flex;
  align-items: center;
  gap: var(--brand-gap);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-caps-sm);
  text-transform: uppercase;
}

.brand i,
.slide.layout-title .title-brand i,
.slide.layout-contact .contact-mark i,
.mark i {
  width: var(--brand-mark-size);
  height: var(--brand-mark-size);
  background: var(--color-accent);
  display: inline-block;
  flex-shrink: 0;
}

.nav-hint {
  opacity: 0.55;
}

/* —— Headings —— */
h1, h2 {
  font-family: var(--font-family);
  font-weight: var(--font-weight-heavy);
  letter-spacing: var(--letter-spacing-heading);
  line-height: var(--line-height-tight);
}

h1 {
  font-size: var(--font-size-display);
  max-width: var(--measure-title);
  margin-bottom: var(--space-1);
}

h2 {
  font-size: var(--font-size-h2);
  max-width: var(--measure-h2);
  margin-bottom: var(--space-1);
}

.lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-body);
  max-width: var(--measure-head);
  color: var(--color-text-muted);
  margin: var(--space-2) 0 var(--space-3);
}

.dark .lead,
.green .lead,
.paper .lead {
  color: var(--color-text-muted);
}

/* —— Hero: budget block —— */
.budget-hint {
  margin-top: var(--space-5);
  max-width: 52ch;
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--color-text-secondary);
}

.budget-hint-title {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  font-size: var(--font-size-md);
}

.budget-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.budget-list li {
  padding-left: 0;
  line-height: 1.4;
}

.budget-list a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.budget-terms {
  margin-top: var(--space-4);
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  max-width: 52ch;
}

.budget-footnote {
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  color: var(--color-text-muted);
  max-width: 48ch;
}

/* —— Text slide (NDA etc.) —— */
.text-body {
  margin-top: var(--space-3);
  max-width: var(--measure-body);
  font-size: var(--font-size-md);
  line-height: var(--line-height-body);
  color: var(--color-text-secondary);
}

.text-body p {
  margin-bottom: var(--space-4);
}

.text-body p:last-child {
  margin-bottom: 0;
}

/* —— Links in copy —— */
.card p a,
.card-examples a,
.lead a,
.pain a,
.list a,
.contact-line a,
.budget-hint a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-line {
  margin-top: var(--space-5);
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
}

/* —— Cards —— */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--card-gap);
  margin-top: var(--space-1);
}

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  color: var(--color-text);
}

.card .n {
  font-family: var(--font-family);
  font-size: 28px;
  font-weight: var(--font-weight-heavy);
  color: var(--color-accent);
  margin-bottom: 6px;
  display: block;
}

.card b {
  display: block;
  font-size: var(--font-size-md);
  margin-bottom: var(--space-1);
}

.card p {
  font-size: 14px;
  line-height: var(--line-height-body);
  color: var(--color-text-muted);
}

.card-examples {
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  color: var(--color-text-muted);
}

.card-examples-label {
  color: var(--color-text);
  font-weight: 600;
}

.grid-cards--tri {
  grid-template-columns: repeat(3, 1fr);
}

/* —— Lists —— */
.grid-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--split-gap);
  margin-top: var(--space-1);
}

.pain, .list {
  list-style: none;
}

.pain li, .list li {
  padding: 14px 0;
  border-top: 1px solid var(--color-border);
  font-size: var(--font-size-md);
  line-height: 1.35;
}

.dark .pain li,
.dark .list li,
.green .pain li,
.green .list li,
.paper .pain li,
.paper .list li {
  border-color: var(--color-border);
}

.pain li:last-child,
.list li:last-child {
  border-bottom: 1px solid var(--color-border);
}

.ok {
  color: var(--color-accent);
  font-weight: var(--font-weight-bold);
  margin-right: var(--space-1);
}

/* —— Shot system —— */
.shot-frame {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
  border-radius: var(--shot-radius);
  overflow: hidden;
  box-shadow: var(--shadow-shot);
  background: var(--color-bg-soft);
}

.shot-frame__chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--shot-bar-h);
  padding: 0 12px;
  background: var(--color-bg-elevated);
  flex-shrink: 0;
}

.shot-frame__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  display: block;
}

.shot-frame__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: var(--shot-aspect);
  max-height: var(--shot-max-h);
  background: var(--color-bg-soft);
}

.shot-frame__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.shot-frame--center .shot-frame__img {
  object-position: center center;
}

.shot-frame__cap {
  margin-top: var(--space-2);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.shot-grid {
  width: 100%;
}

.shot-grid--solo {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
}

.shot-grid--solo .shot-frame {
  width: 100%;
  max-width: var(--shot-max-w-solo);
}

.shot-grid--duo {
  display: grid;
  grid-template-columns: repeat(var(--layout-grid-cols), 1fr);
  gap: var(--layout-grid-gap);
  align-items: start;
}

.shot-grid--duo .shot-frame {
  grid-column: span 6;
}

.shot-grid--split {
  display: grid;
  grid-template-columns: repeat(var(--layout-grid-cols), 1fr);
  gap: var(--layout-grid-gap);
  align-items: center;
}

.shot-grid__copy {
  grid-column: span 4;
  font-size: var(--font-size-md);
  line-height: 1.4;
  max-width: 36ch;
}

.shot-grid--split .shot-frame {
  grid-column: span 8;
}

.foot {
  margin-top: var(--space-5);
  font-size: 14px;
  opacity: 0.7;
}

/* —— Buttons (pill, Otsechka-inspired) —— */
.btn-row {
  margin-top: var(--space-5);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--btn-font-size);
  text-decoration: none;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast), filter var(--duration-fast);
}

.btn-primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-border-strong);
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

.contact-links {
  margin-top: var(--space-5);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.contact-links a,
.contact-links .contact-copy {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--btn-font-size);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast), filter var(--duration-fast);
}

.contact-links a {
  color: var(--color-text);
}

.contact-links a.contact-email:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

.contact-links .contact-copy {
  color: var(--color-text-secondary);
}

.contact-links .contact-copy:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

.contact-links .contact-copy.is-copied {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.contact-links a:first-child {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

/* —— Nav grid —— */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5) var(--space-6);
  margin-top: var(--space-1);
}

.nav-group-title {
  font-size: var(--font-size-sm);
  letter-spacing: var(--letter-spacing-caps-sm);
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
  color: var(--color-accent);
  margin-bottom: var(--brand-gap);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-jump {
  display: inline;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav-jump:hover {
  color: var(--color-accent);
}

.nav-note {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: 2px;
  font-weight: 400;
  text-decoration: none;
}

/* —— Footer chrome —— */
.footer-ui {
  position: fixed;
  left: var(--layout-footer-x);
  right: var(--layout-footer-x);
  bottom: calc(var(--layout-footer-y) + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  pointer-events: none;
  color: var(--color-text);
}

.pager {
  font-variant-numeric: tabular-nums;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.12em;
  opacity: 0.55;
}

.nav-arrows {
  display: flex;
  gap: var(--space-1);
  pointer-events: auto;
}

.nav-arrows a,
.nav-arrows button,
.nav-arrows .nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-text);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  text-decoration: none;
}

.nav-arrows .is-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: var(--brand-gap);
  pointer-events: auto;
}

.tg-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
  transition: transform var(--duration-fast), filter var(--duration-fast);
}

.tg-fab:hover {
  filter: brightness(1.08);
  transform: scale(1.05);
}

.tg-fab:active {
  transform: scale(0.96);
}

/* —— Desktop · fixed viewport deck (no page scroll) —— */
@media (hover: hover) and (pointer: fine) {
  html, body {
    height: 100%;
    overflow: hidden;
  }

  .page-root,
  .deck {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .slide {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    overflow: hidden;
  }
}

/* —— Mobile & tablet (touch) —— */
@media (max-width: 960px), (hover: none), (pointer: coarse) {
  :root {
    --layout-pad-x: 24px;
    --layout-pad-y: 28px;
    --layout-pad-bottom: 0;
    --layout-footer-x: 24px;
    --scroll-footer-spacer: calc(
      var(--footer-chrome-h) + var(--scroll-footer-extra) + env(safe-area-inset-bottom, 0px)
    );
  }

  html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .page-root,
  .deck {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    touch-action: pan-y;
  }

  .page-root {
    display: flex;
    flex-direction: column;
  }

  .slide,
  .deck .slide.is-on {
    flex: 1;
    min-height: 0;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    scroll-padding-bottom: var(--scroll-footer-spacer);
  }

  .scroll-footer-spacer {
    flex-shrink: 0;
    width: 100%;
    min-height: 120px;
    height: var(--scroll-footer-spacer, 120px);
    pointer-events: none;
  }

  /* let slide content define full scroll height (hero/content pages too) */
  .slide .slide-grid {
    flex: 0 0 auto;
    align-content: start;
    min-height: auto;
  }

  .slide .slide-body {
    flex: 0 0 auto;
    align-self: start;
    min-height: auto;
  }

  .layout-solo .slide-head,
  .layout-solo .slide-body {
    grid-column: 1 / -1;
  }

  .layout-solo .slide-grid,
  .layout-split .slide-grid {
    flex: 0 0 auto;
    align-content: start;
  }

  .layout-solo .slide-body,
  .layout-duo .slide-body,
  .layout-split .slide-body {
    flex: 0 0 auto;
    align-self: start;
  }

  .shot-grid--solo {
    justify-items: stretch;
    margin-top: var(--space-2);
  }

  .shot-grid--split {
    align-items: start;
  }

  .slide.layout-title .title-main {
    padding: var(--space-5) 0;
  }

  .slide.layout-title .title-display {
    max-width: none;
    font-size: clamp(28px, 8vw, 40px);
  }

  .slide.layout-title .title-tagline {
    max-width: none;
    font-size: var(--font-size-lg);
  }

  .slide.layout-title,
  .slide.layout-contact {
    overflow-x: hidden;
    overflow-y: auto;
  }

  :root {
    --shot-max-h: clamp(220px, 42vh, 380px);
  }

  .shot-grid--duo .shot-frame,
  .shot-grid--split .shot-frame,
  .shot-grid__copy {
    grid-column: 1 / -1;
  }

  .shot-grid__copy {
    max-width: none;
  }

  .slide.layout-title {
    display: flex;
    flex-direction: column;
    padding-bottom: var(--layout-pad-bottom);
  }

  .slide.layout-contact {
    display: flex;
  }

  .slide.layout-contact .contact-main {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .slide.layout-contact .contact-title {
    max-width: none;
    font-size: clamp(26px, 7vw, 36px);
  }

  .slide.layout-contact .contact-photo {
    max-width: 280px;
    margin: 0 auto;
  }

  .slide.layout-contact .contact-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .slide.layout-title .title-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .slide.layout-title .title-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-cards,
  .grid-cards--tri,
  .grid-split,
  .nav-grid {
    grid-template-columns: 1fr;
  }

  .shot-frame__viewport {
    max-height: none;
    aspect-ratio: auto;
  }

  .shot-frame__img {
    height: auto;
    max-height: var(--shot-max-h);
    object-fit: contain;
  }

  .budget-hint,
  .budget-footnote {
    font-size: var(--font-size-base);
    max-width: none;
  }
}
