/* Homepage refinements. Shared styles and the experimental page stay independent. */
:root {
  --header-height: 80px;
  --on-dark: #f5f4f0;
  --muted-on-dark: #bec0c2;
  --accent-ink: #80540b;
  --focus: #95600b;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
}

html[data-theme="dark"], body:has(.theme-toggle:checked) {
  --accent-ink: #e7ae4e;
  --focus: #e7ae4e;
}

html { scroll-padding-top: calc(var(--header-height) + 24px); }
body { line-height: 1.7; }
img { max-width: 100%; }
.wrap { width: 100%; }
.services > *, .case > *, .about > *, .steps > *,
.tech-grid > *, .section-head > *, .contact-grid > *, .direction > * {
  min-width: 0;
}
h1, h2, h3 { text-wrap: balance; }
h2 { line-height: 1.16; }
h3 { font-size: clamp(24px, 2.2vw, 28px); line-height: 1.25; }
p, li, .email, .stack { overflow-wrap: anywhere; }
.mono, .label { font-size: 12px; letter-spacing: .045em; }
a, summary, .theme-switch { -webkit-tap-highlight-color: transparent; }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}
/* Fragment targets receive focus for reading order, without a page-sized ring. */
[tabindex="-1"]:focus { outline: none; }
.theme-toggle:focus-visible ~ header .theme-switch {
  outline-color: var(--focus);
}
.hero-shell a:focus-visible, .contact a:focus-visible,
.directions a:focus-visible, footer a:focus-visible {
  outline-color: #e7ae4e;
}
.direction:focus-visible { outline-offset: -5px; }
.skip:focus { left: 16px; top: 12px; }
header .wrap { height: var(--header-height); gap: 24px; }
header nav { gap: 24px; font-size: 14px; }
header nav a { display: inline-flex; align-items: center; min-height: 44px; }
.logo { flex-shrink: 0; min-height: 44px; }
.logo img { width: 92px; }
.theme-switch { min-width: 44px; min-height: 44px; justify-content: center; }
.theme-switch span:first-child, .hidden-signal { color: var(--accent-ink); }
.hidden-signal:hover { color: #17191c; }
.header-actions { gap: 20px; }
.header-contact {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  font-weight: 700;
  white-space: nowrap;
}
.header-contact:hover { border-color: var(--accent-ink); color: var(--accent-ink); }

.hero { padding-top: var(--space-6); color: var(--on-dark); }
.hero .label { color: var(--muted-on-dark); margin-bottom: 24px; }
.hero h1 { max-width: 920px; font-size: clamp(40px, 4.6vw, 66px); line-height: 1.12; }
.hero h1 em { color: var(--on-dark); }
.hero-copy { max-width: 600px; font-size: 18px; line-height: 1.75; }
.hero .motif { right: 5%; top: 100px; opacity: .65; }
.actions { gap: 28px; margin-top: var(--space-4); }
.button { min-height: 52px; padding: 14px 24px; font-size: 15px; }
.button:active, .mobile-contact:active { background: #edb65b; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; }
.hero-bottom { margin: 36px 0 24px; font-size: 13px; flex-wrap: wrap; }
.directions { color: var(--on-dark); }
.direction { grid-template-columns: 40px minmax(0, 1fr) 24px; padding: 28px 24px; gap: 16px; }
.direction .mono { white-space: nowrap; }
.direction h2 { font-size: 23px; line-height: 1.3; text-wrap: initial; }
.direction p { font-size: 14px; line-height: 1.65; }
section { padding: 88px 0; }
.section-head { margin-bottom: var(--space-5); }
.section-head p { font-size: 17px; }
.services { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.service { display: flex; flex-direction: column; padding: 32px; }
.service .mono { color: var(--accent-ink); margin-bottom: 24px; }
.service p { margin: 20px 0; }
.service li { font-size: 15px; }
.service li::before { color: var(--accent-ink); }
.service a { margin-top: auto; display: inline-flex; align-items: center; min-height: 44px; }
.service-support {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  gap: 24px;
  align-items: center;
  background: transparent;
  border-top: 1px solid var(--line);
  padding: 24px 32px;
}
.service-support .mono { margin: 0; }
.service-support h3 { font-size: 23px; text-wrap: initial; }
.service-support p { margin: 12px 0 0; font-size: 15px; }
.service-support a { margin: 0; }
.case {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  background: transparent;
  border: 0;
  padding: 0 0 40px;
}
.case + .case { margin-top: 0; padding-top: 40px; border-top: 1px solid var(--line); }
.case-visual { padding: 28px 24px 48px; }
.case-content { padding: 8px 0; }
.case-content p { font-size: 16px; }
.case-content a, .tech-card a { display: inline-flex; align-items: center; min-height: 44px; }
.visual-caption { left: 24px; right: 24px; bottom: 16px; font-size: 10px; line-height: 1.6; }
.sinitsa-visual .visual-caption { color: #536274; }
.preview-topline span, .sinitsa-preview-head > .next-class > span { color: #5c6877; }
html[data-theme="dark"] .sinitsa-visual .visual-caption,
body:has(.theme-toggle:checked) .sinitsa-visual .visual-caption { color: var(--muted-on-dark); }
.flow-row { gap: 8px; }
.flow-node { min-width: 0; padding: 16px 8px; }
#about .about-copy { background: transparent; border: 0; padding: 0; }
.portrait-wrap { max-width: 270px; }
.portrait-wrap img { height: auto; aspect-ratio: 1; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.facts span { display: block; font-size: 13px; }
.steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.step { background: transparent; border: 0; border-top: 2px solid var(--amber); padding: 24px 0 0; }
.step .mono { color: var(--accent-ink); }
.step h3 { font-size: 20px; overflow-wrap: anywhere; text-wrap: initial; }
.step p { font-size: 15px; }
.tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.tech-card { border-top: 1px solid var(--line); background: var(--paper); }
.tech-card p { font-size: 15px; }
.extra a { display: inline-flex; align-items: center; min-height: 44px; }
.contact { color: var(--on-dark); }
.contact p, .contact .label { color: var(--muted-on-dark); }
.contact-links { gap: 16px; }
.contact-links .button { min-width: 180px; }
.contact-links .outline { color: var(--on-dark); border-color: #81868a; }
.email { max-width: 100%; font-size: clamp(22px, 2.8vw, 36px); }
.contact .fine { font-size: 14px; }
footer { font-size: 12px; }
.footer-top { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 1100px) {
  .theme-switch-text { display: none; }
  .service-support { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .service-support a { grid-column: 2; justify-self: start; }
  .case { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .case-visual { min-height: 340px; }
  .sinitsa-preview, .flow { max-width: 560px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
}

@media (max-width: 800px) {
  :root { --header-height: 72px; }
  .wrap { padding: 0 24px; }
  .header-contact { display: none; }
  .header-actions { gap: 16px; }
  .theme-switch { margin: 0; }
  .mobile-menu summary { min-width: 72px; font-size: 14px; }
  .mobile-menu nav { top: var(--header-height); padding: 12px 24px 20px; max-height: calc(100dvh - var(--header-height) - 72px); overflow-y: auto; }
  .mobile-menu nav a { min-height: 48px; }
  .mobile-menu nav a:last-child { color: var(--accent-ink); }
  .hero { padding-top: 40px; }
  .hero .motif { display: none; }
  .signal-hero-top, .signal-hero-motif, .signal-hero-edge { top: 0; right: 0; }
  .hero-copy { font-size: 17px; }
  .direction { grid-template-columns: 32px minmax(0, 1fr); padding: 24px 20px; gap: 12px; }
  .direction h2 { font-size: 21px; }
  section { padding: 64px 0; }
  .section-head { gap: 16px; margin-bottom: 32px; }
  .services { gap: 16px; }
  .service { padding: 24px; }
  .service-support { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .service-support a { grid-column: auto; }
  .case { padding: 0 0 32px; }
  .case + .case { padding-top: 32px; }
  .about { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .about-copy h2 { font-size: clamp(32px, 4.5vw, 40px); }
  .portrait-wrap { max-width: 220px; }
  .mobile-contact { min-height: 60px; color: #17191c; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .floating-top { bottom: calc(8px + env(safe-area-inset-bottom)); width: 44px; height: 44px; z-index: 17; }
  body:has(.floating-top.is-visible) .mobile-contact span { visibility: hidden; }
  .contact-links .button { min-width: 160px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .logo img { width: 82px; }
  .hero { padding-top: 32px; }
  .hero .label { font-size: 11px; align-items: flex-start; gap: 10px; }
  .hero .dot { margin-top: 6px; flex: 0 0 7px; }
  .hero h1 { font-size: clamp(34px, 9.8vw, 43px); }
  .hero-copy { margin-top: 24px; font-size: 16px; }
  .actions { align-items: stretch; flex-direction: column; gap: 12px; margin-top: 24px; }
  .actions .text-link { align-self: flex-start; }
  .hero-bottom { margin: 24px 0; font-size: 12px; gap: 8px; }
  .directions, .services, .tech-grid { grid-template-columns: minmax(0, 1fr); }
  .direction { padding: 24px 0; }
  .direction p { font-size: 14px; }
  .section-head p { font-size: 16px; }
  .service h3 br { display: none; }
  .case-visual { padding: 24px 16px 52px; min-height: 300px; }
  .visual-caption { left: 16px; right: 16px; }
  .flow { font-size: 11px; }
  .flow-row { gap: 5px; }
  .flow-node { padding: 14px 5px; }
  .flow-note { line-height: 1.8; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .facts > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 16px; }
  .facts strong { font-size: 26px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .step h3 { margin-top: 12px; }
  .tech-card { padding: 24px; }
  .contact-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .contact-links .button { min-width: 0; padding: 14px 16px; gap: 12px; }
  .email { font-size: clamp(19px, 5.8vw, 25px); }
  .hidden-signal { animation: none; }
}


/* UI consistency pass: one action-link style, readable captions, a calmer mobile CTA. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Decorative glyphs stay visible but are not announced. */
.service li::before { content: '↗' / ''; }

.section-head .label::before, .about-copy .label::before { content: '●' / ''; }

.about-copy .label::before { color: var(--amber); font-size: 8px; margin-right: 10px; vertical-align: 1px; }

.service a, .case-content a, .tech-card a { font-size: 14px; font-weight: 700; }

/* Inline-block keeps the underline continuous through the arrow; padding keeps a 44px target. */
.text-link, .service a, .case-content a, .tech-card a, .extra a, .footer-top {
  display: inline-block;
  padding-block: 10px;
  line-height: 24px;
}

.service a { align-self: flex-start; }

.visual-caption { font-size: 12px; }

.flow { font-size: 13px; }

.flow-note { font-size: 12px; }

/* The process diagram is compact; it no longer stretches into an empty dark panel. */
.dark-visual { align-self: start; min-height: 300px; }

.contact-actions { grid-column: 2; }

.email { padding-block: 4px; }

.contact .fine { margin-top: 8px; line-height: 1.7; }

.mobile-contact:focus-visible { outline-offset: -6px; }

@media (max-width: 1100px) {
  .dark-visual { min-height: 280px; }
}

@media (max-width: 800px) {
  .contact-actions { grid-column: auto; }

  .mobile-contact { transition: transform .2s, visibility .2s; }

  /* Hidden while the hero CTA or the contact section is already on screen. */
  .mobile-contact.is-hidden { transform: translateY(100%); visibility: hidden; }
}

@media (max-width: 560px) {
  .flow { font-size: 12px; }

  .dark-visual { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-contact { transition: none; }
}
