/* Shared finishing layer for the public site. Page-specific layouts remain local. */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 76px;
}

body {
  overflow-x: hidden;
}

.ssq-base {
  overflow-wrap: break-word;
}

.ssq-base[lang="ja"] {
  font-family: "Space Grotesk", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif !important;
  line-break: strict;
  overflow-wrap: anywhere;
  word-break: normal !important;
}

/* CJK display type sets tighter than Latin; zero tracking for ko/ja only. */
.ssq-base[lang="ko"] h1,
.ssq-base[lang="ko"] h2,
.ssq-base[lang="ko"] h3,
.ssq-base[lang="ja"] h1,
.ssq-base[lang="ja"] h2,
.ssq-base[lang="ja"] h3 {
  letter-spacing: 0 !important;
}

.ssq-base p {
  text-wrap: pretty;
}

.ssq-base .t-label {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ssq-base .cta {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1.4;
  max-width: 100%;
  min-height: 46px;
  text-align: center;
  white-space: normal;
}

.ssq-base .cta:active {
  transform: translateY(1px);
}

/* Faint plotting grid gives the dark hero headers physical depth. */
.ssq-base header.theme-terminal {
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.4px) !important;
  background-size: 26px 26px !important;
}

/* Live caret after the hero prompt line. */
.ssq-base .prompt-line::after {
  animation: ssq-caret 1.15s step-end infinite;
  background: var(--accent-fill);
  content: "";
  display: inline-block;
  height: 14px;
  margin-left: 7px;
  vertical-align: text-bottom;
  width: 7px;
}

@keyframes ssq-caret {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ssq-base .prompt-line::after {
    animation: none;
  }
}

.ssq-base :is(a, button, summary):focus-visible {
  outline: 2px solid var(--accent-fill);
  outline-offset: 3px;
}

.ssq-base section[id],
.ssq-base header[id] {
  scroll-margin-top: 76px;
}

.ssq-base {
  --fg-faint: #656B75;
}

.ssq-base .theme-terminal,
.ssq-base.theme-terminal {
  --fg-faint: #888E98;
}

/* Repeated content is identified by a clear index; icons are reserved for actions and diagrams. */
.ssq-base .svccard .svcrow > div:first-child > div:first-child > [data-lucide],
.ssq-base .edcard > div:first-child > div:first-child,
.ssq-base .pcard > div:first-child > div:first-child,
.ssq-base .ecard > div:first-child > div:first-child,
.ssq-base #scope .g-4 > div > div:first-child > [data-lucide] {
  display: none !important;
}

.ssq-base .edcard > div:first-child,
.ssq-base .pcard > div:first-child,
.ssq-base .ecard > div:first-child {
  justify-content: flex-start !important;
}

.ssq-base .svccard .svcrow > div:first-child > div:first-child > .t-data,
.ssq-base .edcard > div:first-child > .t-data,
.ssq-base .pcard > div:first-child > .t-data,
.ssq-base .ecard > div:first-child > .t-data {
  color: var(--accent) !important;
  font-size: 12px !important;
  letter-spacing: 0.08em !important;
}

.ssq-base #business .g-3 {
  counter-reset: business-card;
}

.ssq-base #business .bizcard {
  counter-increment: business-card;
}

.ssq-base #business .bizcard > div:first-child > div:first-child {
  display: none !important;
}

.ssq-base #business .bizcard > div:first-child::before {
  color: var(--accent);
  content: "0" counter(business-card);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.ssq-base #domains .stagger {
  counter-reset: scope-row;
}

.ssq-base #domains .scoperow {
  counter-increment: scope-row;
}

.ssq-base #domains .scoperow > [data-lucide] {
  display: none !important;
}

.ssq-base #domains .scoperow::before {
  color: var(--accent);
  content: "0" counter(scope-row);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.ssq-base #why .g-3,
.ssq-base #what-counts .g-4 {
  counter-reset: pif-card;
}

.ssq-base #why .pifcard,
.ssq-base #what-counts .pifcard {
  counter-increment: pif-card;
}

.ssq-base #why .pifcard > [data-lucide],
.ssq-base #what-counts .pifcard > [data-lucide] {
  display: none !important;
}

.ssq-base #why .pifcard::before,
.ssq-base #what-counts .pifcard::before {
  color: var(--accent);
  content: "0" counter(pif-card);
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .ssq-base nav > div {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .ssq-base header > div,
  .ssq-base section > div,
  .ssq-base footer > div {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .ssq-base header > div {
    padding-bottom: 64px !important;
    padding-top: 72px !important;
  }

  .ssq-base section > div {
    padding-bottom: 72px !important;
    padding-top: 72px !important;
  }

  .ssq-base header .t-display {
    font-size: 40px !important;
    line-height: 1.2 !important;
  }

  .ssq-base[lang="ja"] header .t-display {
    font-size: 38px !important;
    line-height: 1.3 !important;
  }

  .ssq-base section .t-h1 {
    font-size: 28px !important;
    line-height: 1.35 !important;
  }

  .ssq-base section .t-display {
    font-size: 31px !important;
    line-height: 1.35 !important;
  }

  .ssq-base header .t-body-lg {
    font-size: 16px !important;
    line-height: 1.75 !important;
  }

  .ssq-base header .cta {
    width: 100%;
  }

  .ssq-base .t-label {
    font-size: 10px !important;
    letter-spacing: 0.12em !important;
    line-height: 1.6 !important;
  }

  .ssq-base .ssq-node {
    gap: 6px !important;
    padding: 8px 10px !important;
  }

  .ssq-base .ssq-node span {
    font-size: 11px !important;
  }

  .ssq-base .ig-rnode[style*="padding"] {
    gap: 5px !important;
    padding: 7px 9px !important;
  }

  .ssq-base .ig-rnode[style*="padding"] span {
    font-size: 10px !important;
  }

  .ssq-base footer [style*="align-items:flex-end"] {
    align-items: flex-start !important;
  }

  .ssq-base #architecture .t-body-sm[style*="min-width"] {
    min-width: 0 !important;
  }

  .ssq-base #architecture > div > div[style*="flex-wrap"] {
    display: grid !important;
    gap: 12px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 24px !important;
  }

  .ssq-base #architecture > div > div[style*="flex-wrap"] > .t-data {
    padding-top: 0 !important;
  }
}

@media (max-width: 360px) {
  .ssq-base[lang="ja"] header .t-display {
    font-size: 34px !important;
    line-height: 1.28 !important;
  }

  .ssq-base .ssq-node {
    gap: 4px !important;
    padding: 6px 7px !important;
  }

  .ssq-base .ssq-node span {
    font-size: 9.5px !important;
  }

  .ssq-base .ssq-node [data-lucide] {
    height: 13px !important;
    width: 13px !important;
  }

  .ssq-base .ig-rnode[style*="padding"] {
    gap: 4px !important;
    padding: 6px 7px !important;
  }

  .ssq-base .ig-rnode[style*="padding"] span {
    font-size: 8.5px !important;
  }
}
