:root {
  --c-base: #f4f4f4;
  --c-main: #333333;
  --c-accent: #333333;
  --c-soft: #f1f1f1;
  --c-line: rgba(51, 51, 51, 0.14);
  --c-muted: rgba(51, 51, 51, 0.68);
  --font-jp: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-en: "Avenir Next Arabic", "Avenir Next", system-ui, sans-serif;
  --space-page: clamp(20px, 5vw, 72px);
  --radius: 0;
  --shadow: 0 18px 40px rgba(51, 51, 51, 0.08);
}

* {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  border-radius: 0 !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--c-main);
  background: var(--c-base);
  font-family: var(--font-jp);
  letter-spacing: 0.05em;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid #333;
  outline-offset: 3px;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--c-main);
  color: #fff;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 244, 244, 0.94);
  border-bottom: 0;
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 92px;
  padding: 14px var(--space-page);
}

.brand,
.nav-links,
.utility-links {
  display: flex;
  align-items: center;
}

.nav-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 44px;
  font-family: var(--font-en);
  font-weight: 300;
}

.brand img {
  display: block;
  width: 104px;
  height: auto;
}

.brand span {
  color: var(--c-muted);
  font-family: var(--font-en);
  font-size: 13.65px;
  font-weight: 300;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 18px;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.logo-text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--c-muted);
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.logo-text-link:hover {
  color: var(--c-main);
}

.page-tabs {
  grid-column: 1 / -1;
}

.nav-links {
  gap: 0;
}

.nav-links a,
.utility-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--c-muted);
  font-size: 14px;
  font-weight: 400;
}

.page-tabs {
  width: fit-content;
  padding: 3px;
  border-radius: 999px;
  background: rgba(51, 51, 51, 0.08);
}

.page-tabs a {
  min-height: 34px;
  border-radius: 999px;
  font-size: 12px;
}

.utility-links {
  gap: 8px;
}

.utility-links a {
  font-family: var(--font-en);
}

.nav-links a:hover,
.utility-links a:hover {
  color: var(--c-main);
}

.nav-links a.active,
.utility-links a.active {
  color: var(--c-main);
}

.page-tabs a.active {
  background: #fff;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--c-muted);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 10em;
  margin: 0;
  font-family: var(--font-en);
  font-weight: 500;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 1.08;
  letter-spacing: 0.05em;
}

.nowrap {
  white-space: nowrap;
}

h2 {
  margin: 0;
  font-family: var(--font-en), var(--font-jp);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.16;
  letter-spacing: 0.05em;
}

h3 {
  margin: 0 0 16px;
  font-family: var(--font-en), var(--font-jp);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.35;
}

.en-heading {
  font-family: var(--font-en);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 600;
}

.btn.primary {
  background: var(--c-main);
  color: #fff;
}

.btn.secondary {
  background: #fff;
  color: var(--c-main);
}

.step {
  display: block;
  color: var(--c-muted);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
}

.section {
  padding: 88px var(--space-page);
  border-top: 0;
}

.section-first {
  border-top: 0;
  padding-top: 72px;
  background: var(--c-base);
}

.page-brand {
  background: var(--c-base);
}

.page-brand h1 {
  font-weight: 400;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 36px;
}

.section-heading.heading-with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  max-width: none;
}

.section-heading.heading-with-action > div {
  max-width: 820px;
}

.section-heading.heading-with-action > div:has(h1:only-child) {
  display: none;
}

.top-copy {
  flex: 0 0 auto;
  margin-top: 8px;
}

.compact-heading {
  margin-bottom: 18px;
}

.section-heading p:last-child {
  margin: 16px 0 0;
  color: var(--c-muted);
  font-size: 17px;
}

.guide-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.guide-strip article {
  min-height: 230px;
  padding: 22px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.guide-strip h2,
.example-card h2 {
  margin: 8px 0 12px;
  font-size: 22px;
  line-height: 1.32;
}

.guide-strip p {
  margin: 0;
  color: var(--c-muted);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.rule-card,
.palette-block {
  border-radius: var(--radius);
  background: #fff;
}

.rule-card {
  padding: 22px;
}

.rule-card h2,
.palette-block h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.35;
}

.rule-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.2em;
  color: var(--c-muted);
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.example-card {
  padding: 22px;
  border-radius: var(--radius);
  background: #fff;
}

.example-card.good {
  box-shadow: inset 6px 0 0 #333;
}

.example-card.bad {
  box-shadow: inset 6px 0 0 #999;
}

.example-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 1.2em;
  color: var(--c-muted);
}

.visual-rule-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.visual-card {
  min-height: 310px;
  padding: 22px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.visual-card h2 {
  margin-bottom: 16px;
  font-size: 22px;
}

.visual-card p {
  margin: 14px 0 0;
  color: var(--c-muted);
}

.poster-demo,
.margin-demo,
.align-demo,
.alignment-rule-demo,
.z-reading-demo,
.photo-demo,
.compare-demo,
.hierarchy-demo {
  min-height: 190px;
  border-radius: var(--radius);
  background: #f3f3f3;
}

.poster-demo {
  position: relative;
  padding: 24px;
}

.poster-title {
  width: 62%;
  padding: 16px;
  border-radius: 6px;
  background: #333;
  color: #fff;
  font-family: var(--font-en);
  font-size: 36px;
  font-weight: 500;
  line-height: 1;
}

.poster-sub {
  width: 42%;
  margin-top: 14px;
  padding: 10px;
  border-radius: 6px;
  background: #fff;
  color: var(--c-muted);
  font-family: var(--font-en);
  font-size: 13px;
}

.poster-cta {
  position: absolute;
  right: 24px;
  bottom: 24px;
  padding: 10px 14px;
  border-radius: 6px;
  background: #333;
  color: #fff;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 500;
}

.hierarchy-demo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 24px;
}

.hierarchy-demo span {
  display: block;
}

.h-main {
  font-size: 34px;
  font-weight: 600;
}

.h-sub {
  font-size: 23px;
  font-weight: 400;
}

.h-note {
  color: var(--c-muted);
  font-size: 15px;
}

.principles-demo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: 190px;
  padding: 12px;
  background: #f3f3f3;
}

.principle-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  min-height: 78px;
  padding: 10px;
  background: #fff;
}

.principle-panel strong {
  color: var(--c-main);
  font-size: 13px;
  font-weight: 600;
}

.principle-visual {
  position: relative;
  min-height: 48px;
}

.proximity-panel .principle-visual {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  gap: 3px;
}

.proximity-panel span {
  width: 8px;
  height: 8px;
  background: #333;
}

.proximity-panel span:nth-child(4) {
  grid-column: 5;
}

.proximity-panel span:nth-child(5),
.proximity-panel span:nth-child(6) {
  background: #999;
}

.alignment-panel .principle-visual {
  display: grid;
  align-content: center;
  gap: 6px;
  border-left: 2px solid #333;
  padding-left: 8px;
}

.alignment-panel span {
  display: block;
  height: 8px;
  background: #333;
}

.alignment-panel span:nth-child(1) {
  width: 68%;
}

.alignment-panel span:nth-child(2) {
  width: 48%;
}

.alignment-panel span:nth-child(3) {
  width: 78%;
}

.repetition-panel .principle-visual {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 6px;
}

.repetition-panel span {
  height: 30px;
  background: #333;
}

.contrast-panel .principle-visual {
  display: flex;
  align-items: end;
  gap: 10px;
}

.contrast-panel span:first-child {
  width: 42px;
  height: 42px;
  background: #333;
}

.contrast-panel span:last-child {
  width: 16px;
  height: 16px;
  background: #999;
}

.margin-demo {
  display: grid;
  place-items: center;
  padding: 22px;
  box-shadow: inset 0 0 0 2px rgba(51, 51, 51, 0.18);
}

.margin-inner {
  display: grid;
  place-items: center;
  width: 78%;
  min-height: 110px;
  border-radius: 6px;
  background: #333;
  color: #fff;
  font-family: var(--font-en);
  font-weight: 500;
}

.align-demo {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 30px 28px;
}

.align-demo span {
  display: block;
  height: 28px;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 8px 0 0 #555;
}

.align-demo span:nth-child(1) { width: 82%; }
.align-demo span:nth-child(2) { width: 62%; }
.align-demo span:nth-child(3) { width: 74%; }

.alignment-rule-demo {
  position: relative;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 26px 28px 26px 42px;
  background:
    linear-gradient(90deg, transparent 0 40px, rgba(51, 51, 51, 0.18) 40px 42px, transparent 42px),
    linear-gradient(90deg, transparent 0 72%, rgba(51, 51, 51, 0.12) 72% calc(72% + 2px), transparent calc(72% + 2px)),
    #f3f3f3;
}

.alignment-rule-demo span {
  position: relative;
  z-index: 1;
  display: block;
  background: #333;
}

.alignment-kicker {
  width: 26%;
  height: 10px;
}

.alignment-title {
  width: 72%;
  height: 30px;
}

.alignment-body {
  width: 58%;
  height: 16px;
  background: #777 !important;
}

.alignment-button {
  width: 28%;
  height: 28px;
  margin-top: 8px;
}

.alignment-guide {
  position: absolute;
  top: 18px;
  bottom: 18px;
  border-left: 2px dashed rgba(51, 51, 51, 0.28);
}

.alignment-guide-left {
  left: 42px;
}

.alignment-guide-mid {
  left: 72%;
}

.z-flow-demo {
  position: relative;
}

.z-flow-demo::before {
  content: "";
  position: absolute;
  inset: 42px 42px;
  background:
    linear-gradient(90deg, transparent 0 8%, #777 8% 92%, transparent 92%),
    linear-gradient(140deg, transparent 0 44%, #777 44% 56%, transparent 56%),
    linear-gradient(90deg, transparent 0 8%, #777 8% 92%, transparent 92%);
  background-position: top left, center, bottom left;
  background-repeat: no-repeat;
  background-size: 100% 5px, 100% 5px, 100% 5px;
}

.z-flow-demo span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px !important;
  height: 34px;
  border-radius: 50%;
  background: #333;
  box-shadow: none;
  color: #fff;
  font-family: var(--font-en);
}

.z-flow-demo span:nth-child(2) {
  justify-self: end;
}

.z-flow-demo span:nth-child(3) {
  justify-self: end;
}

.z-reading-demo {
  position: relative;
  background: #f3f3f3;
}

.z-reading-demo svg {
  position: absolute;
  inset: 20px 24px;
  z-index: 2;
  width: calc(100% - 48px);
  height: calc(100% - 40px);
}

.z-reading-demo path {
  fill: none;
  stroke: #777;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 5;
}

.z-node {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: #333;
  color: #fff;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 600;
}

.z-node-1 {
  top: 30px;
  left: 30px;
}

.z-node-2 {
  top: 30px;
  right: 30px;
}

.z-node-3 {
  bottom: 44px;
  left: 58px;
}

.z-node-4 {
  right: 28px;
  bottom: 44px;
}

.z-block {
  position: absolute;
  z-index: 1;
  display: block;
  background: #fff;
}

.z-block-head {
  top: 32px;
  left: 76px;
  width: 78px;
  height: 28px;
}

.z-block-cta {
  right: 76px;
  bottom: 46px;
  width: 74px;
  height: 28px;
}

.photo-demo {
  position: relative;
  display: grid;
  place-items: center;
}

.photo-face {
  width: 96px;
  height: 118px;
  border-radius: 48px 48px 34px 34px;
  background: #b8b8b8;
  box-shadow: 0 0 0 8px #fff;
}

.zoom-loupe {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  box-shadow: inset 0 0 0 3px #555;
  border-radius: 50%;
  background: #fff;
  color: #555;
  font-family: var(--font-en);
  font-weight: 500;
}

.compare-demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px;
}

.ok-mini,
.ng-mini {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  background: #fff;
}

.ok-mini {
  color: #333;
  font-weight: 600;
}

.ng-mini {
  color: #777;
  font-weight: 600;
}

.ok-mini strong,
.ng-mini strong {
  font-family: var(--font-en);
  font-size: 14px;
}

.ok-layout,
.ng-layout {
  min-height: 122px;
  border-radius: 6px;
}

.ok-layout {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 18px;
  background: #f1f1f1;
}

.ok-main {
  display: grid;
  place-items: center;
  width: 78%;
  min-height: 56px;
  border-radius: 6px;
  background: #333;
  color: #fff;
}

.ok-sub {
  width: 40%;
  height: 18px;
  border-radius: 5px;
  background: #cfcfcf;
}

.ng-layout {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 7px;
  padding: 10px;
  background: #f1f1f1;
}

.ng-layout span {
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #777;
  color: #fff;
  font-size: 12px;
}

.definition-card {
  display: flex;
  flex-direction: column;
}

.font-specimen {
  padding: 18px;
  border-radius: var(--radius);
  background: #fff;
}

.font-specimen + .font-specimen {
  margin-top: 12px;
}

.font-specimen span,
.type-row span,
.spacing-frame span {
  display: block;
  margin-bottom: 8px;
  color: var(--c-muted);
  font-size: 13px;
}

.weight-sample {
  padding: 12px 0;
  border-top: 0;
}

.weight-sample:first-of-type {
  border-top: 0;
}

.weight-sample small {
  display: block;
  margin-bottom: 6px;
  color: var(--c-muted);
  font-family: var(--font-en);
  font-size: 12px;
}

.weight-sample p {
  margin: 0;
  color: var(--c-main);
  font-size: 22px;
  line-height: 1.35;
}

.weight-regular p {
  font-weight: 400;
}

.weight-medium p {
  font-weight: 500;
}

.weight-semibold p {
  font-weight: 600;
}

.weight-bold p {
  font-weight: 700;
}

.font-specimen.en {
  font-family: var(--font-en);
}

.type-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  padding: 16px;
  border-radius: var(--radius);
  background: #fff;
}

.type-row + .type-row {
  margin-top: 12px;
}

.type-row strong {
  display: block;
  font-weight: 600;
  line-height: 1.3;
}

.hero-type strong {
  font-size: 34px;
}

.sub-type strong {
  font-size: 24px;
}

.note-type strong {
  font-size: 16px;
}

.spacing-stage {
  flex: 1;
  padding: 18px;
  border-radius: var(--radius);
  background: #fff;
}

.spacing-frame {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 190px;
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 2px rgba(51, 51, 51, 0.18);
}

.spacing-object {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin-top: 18px;
  border-radius: var(--radius);
  background: #333;
  color: #fff;
  font-weight: 600;
}

.spacing-scale {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.spacing-scale span {
  display: flex;
  align-items: center;
  min-height: 28px;
  color: var(--c-muted);
  font-family: var(--font-en);
  font-size: 13px;
}

.spacing-scale span::before {
  content: "";
  width: var(--space-width);
  height: 16px;
  margin-right: 10px;
  border-radius: 4px;
  background: #777;
}

.color-pattern-card {
  grid-column: 1 / -1;
}

.font-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.card-heading-row h2 {
  margin-bottom: 0;
}

.ghost-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid currentColor;
  background: transparent;
  color: var(--c-muted);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.ghost-link-button:hover {
  color: var(--c-main);
}

.color-pattern-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.color-pattern {
  display: grid;
  grid-template-columns: 70fr 25fr 5fr;
  align-content: center;
  min-height: 64px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.color-pattern strong {
  display: grid;
  place-items: center;
  min-height: 64px;
  border-radius: 0;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.color-pattern strong:nth-of-type(1) {
  background: var(--base);
  color: var(--c-main);
}

.color-pattern strong:nth-of-type(2) {
  background: var(--main);
  color: #fff;
}

.color-pattern strong:nth-of-type(3) {
  background: var(--accent);
  color: #fff;
  overflow: hidden;
  text-indent: -999px;
  white-space: nowrap;
}

.color-pattern[data-copied="true"],
.swatches button[data-copied="true"],
.gradient-card[data-copied="true"] {
  outline: 3px solid #333;
  outline-offset: 3px;
}

.markdown-panel {
  margin-top: 28px;
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.page-global:has(#image-prompt.active) .image-markdown {
  display: none;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 0;
}

.panel-heading .eyebrow {
  margin-bottom: 6px;
}

.panel-heading h2 {
  font-size: 24px;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  font-weight: 500;
}

.copy-button[data-copied="true"] {
  background: var(--c-main);
  color: #fff;
}

.markdown-panel pre {
  max-height: 420px;
  margin: 0;
  padding: 22px;
  overflow: auto;
  background: #28252a;
  color: #f7f2f5;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.markdown-panel code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.prompt-panel pre {
  max-height: 620px;
}

.brand-section {
  background: #f1f1f1;
}

.check-mark {
  background: #777;
}

.check-summary {
  align-self: end;
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(247, 242, 245, 0.06);
}

.check-summary strong {
  display: block;
  margin-bottom: 12px;
  font-size: 20px;
}

.check-summary ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.3em;
  color: rgba(247, 242, 245, 0.72);
}

.check-section {
  padding-top: 72px;
  padding-bottom: 88px;
}

.palette-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.palette-block {
  padding: 20px;
}

.swatches {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.swatches button {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  min-height: 42px;
  padding: 0 10px 0 0;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--c-main);
  cursor: pointer;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 400;
}

.swatches button::before {
  content: "";
  width: 42px;
  height: 42px;
  margin: 0 10px 0 0;
  border-radius: 6px 0 0 6px;
  background: var(--swatch);
}

.gradient-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.gradient-palette-block .gradient-row {
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 0;
}

.theme-tabs {
  display: flex;
  gap: 0;
  width: fit-content;
  margin-bottom: 18px;
  padding: 3px;
  background: rgba(51, 51, 51, 0.08);
}

.theme-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  color: var(--c-muted);
  font-family: var(--font-en);
  font-size: 13px;
}

.theme-tabs a.active,
.theme-tabs a:hover {
  background: #fff;
  color: var(--c-main);
}

.theme-grid {
  display: block;
}

.theme-block {
  display: none;
  padding: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.theme-block.active {
  display: block;
}

.theme-block h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.theme-block p {
  margin: 0 0 18px;
  color: var(--c-muted);
}

.theme-palette {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.theme-palette button {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 42px auto auto;
  align-items: end;
  min-height: 104px;
  padding: 0 10px 10px;
  border: 0;
  background: #f4f4f4;
  color: var(--c-main);
  cursor: pointer;
  text-align: left;
}

.theme-palette button::before {
  content: "";
  height: 42px;
  margin: 0 -10px 8px;
  background: var(--swatch);
}

.theme-palette .theme-gradient::before {
  background: var(--gradient);
}

.theme-palette .theme-gradient {
  grid-column: auto;
  grid-template-columns: 1fr;
  min-height: 104px;
}

.google-gradient {
  --gradient: linear-gradient(90deg, #1a73e8, #34a853, #fbbc04, #ea4335);
}

.google-soft-gradient {
  --gradient: linear-gradient(90deg, #ffffff, #e8f0fe, #e6f4ea);
}

.claude-gradient {
  --gradient: linear-gradient(90deg, #f7f0e8, #d97745, #3d342f);
}

.claude-soft-gradient {
  --gradient: linear-gradient(90deg, #fffaf4, #f3dfcc, #d97745);
}

.codex-gradient {
  --gradient: radial-gradient(circle at 28% 22%, #dfd8ff 0 14%, #9d8cff 36%, #6269ff 62%, #2348ff 100%);
}

.codex-soft-gradient {
  --gradient: linear-gradient(135deg, #ffffff 0%, #c9d2ff 42%, #5369ff 100%);
}

.theme-palette span,
.theme-palette strong {
  display: flex;
  align-items: center;
  padding: 0;
  font-family: var(--font-en);
}

.theme-palette span {
  color: var(--c-muted);
  font-size: 12px;
}

.theme-palette strong {
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.prompt-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.prompt-image-card {
  display: grid;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-main);
  cursor: pointer;
  text-align: left;
}

.prompt-image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.prompt-image-card span {
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 400;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: var(--space-page);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 22, 0.62);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(760px, 88vh);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-panel pre {
  max-height: 560px;
  margin: 0;
  padding: 22px;
  overflow: auto;
  background: #28252a;
  color: #f7f2f5;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.gradient-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 164px;
  padding: 18px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.gradient-card strong,
.gradient-card span {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.28);
}

.gradient-card strong {
  font-family: var(--font-en);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.15;
}

.gradient-card span {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 400;
}

.page-slide {
  --shiftai-primary: #a51e6d;
  --shiftai-secondary: #039578;
  --shiftai-grad: linear-gradient(90deg, #ff5757, #8c52ff);
}

.slide-guide-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.slide-guide-card {
  min-height: 300px;
  padding: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.slide-guide-card.wide {
  grid-column: span 2;
}

.slide-guide-card.full {
  grid-column: 1 / -1;
  min-height: auto;
}

.slide-guide-card h2 {
  margin: 8px 0 16px;
  font-size: 24px;
}

.slide-guide-card p {
  margin: 16px 0 0;
  color: var(--c-muted);
}

.slide-card-label {
  color: var(--shiftai-primary);
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slide-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.slide-flow span,
.verify-strip span,
.required-dom-map span {
  display: grid;
  place-items: center;
  min-height: 58px;
  padding: 10px;
  background: #f6e9f0;
  color: var(--shiftai-primary);
  font-weight: 700;
  text-align: center;
}

.slide-flow span {
  position: relative;
}

.slide-flow span:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -8px;
  z-index: 1;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 10px solid var(--shiftai-primary);
  transform: translateY(-50%);
}

.slide-mini-frame {
  display: flex;
  flex-direction: column;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(51, 51, 51, 0.14);
}

.slide-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22%;
  padding: 0 16px;
  background: var(--shiftai-grad);
  color: #fff;
}

.slide-mini-header strong,
.slide-mini-header span {
  font-size: 12px;
  font-weight: 700;
}

.slide-mini-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 14px;
  flex: 1;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(165, 30, 109, 0.06), transparent 44%),
    #fff;
}

.slide-mini-copy {
  display: grid;
  place-items: center;
  background: #f6e9f0;
  color: var(--shiftai-primary);
  font-weight: 700;
}

.slide-mini-visual {
  display: grid;
  align-content: center;
  gap: 8px;
}

.slide-mini-visual span {
  display: block;
  height: 22px;
  background: #333;
}

.slide-mini-visual span:nth-child(2) {
  width: 72%;
  background: var(--shiftai-primary);
}

.slide-mini-visual span:nth-child(3) {
  width: 46%;
  background: #d6d6d6;
}

.asset-grid,
.layout-mini-grid,
.component-demo-grid,
.verify-strip {
  display: grid;
  gap: 8px;
}

.asset-grid {
  grid-template-columns: 1fr;
}

.asset-tile {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px;
  background: #f6e9f0;
}

.asset-tile strong {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.asset-icon {
  display: block;
  width: 44px;
  height: 34px;
  background: #fff;
}

.asset-icon.dark {
  background: #333;
}

.asset-icon.grad {
  background: linear-gradient(90deg, #e6033d, #673ba0);
}

.asset-icon.pattern {
  background:
    repeating-linear-gradient(45deg, rgba(165, 30, 109, 0.18) 0 6px, transparent 6px 12px),
    #fff;
  box-shadow: inset 0 0 0 1px rgba(51, 51, 51, 0.16);
}

.shiftai-swatch-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.shiftai-swatch-row span {
  min-height: 96px;
  padding: 14px;
  background: var(--swatch);
  color: #fff;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.layout-mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.layout-mini {
  min-height: 82px;
  padding: 14px;
  background: #f6e9f0;
  color: var(--shiftai-primary);
}

.layout-mini strong,
.layout-mini span {
  display: block;
}

.layout-mini strong {
  font-family: var(--font-en);
  font-size: 24px;
  line-height: 1.1;
}

.layout-mini span {
  margin-top: 8px;
  color: var(--c-main);
  font-size: 13px;
}

.component-demo-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.number-badge-demo,
.question-badge-demo,
.highlight-demo,
.accent-line-demo,
.check-demo {
  min-height: 96px;
  padding: 14px;
  background: #f6e9f0;
}

.number-badge-demo,
.question-badge-demo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.number-badge-demo b,
.question-badge-demo b {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--shiftai-primary);
  color: #fff;
  font-family: var(--font-en);
}

.number-badge-demo span,
.question-badge-demo span,
.check-demo {
  font-weight: 700;
}

.highlight-demo {
  display: grid;
  place-items: center;
  background: var(--shiftai-primary);
  color: #fff;
  font-weight: 700;
}

.accent-line-demo {
  display: flex;
  align-items: center;
  border-left: 4px solid var(--shiftai-primary);
  color: var(--c-main);
  font-weight: 700;
}

.check-demo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-demo span {
  width: 18px;
  height: 18px;
  background: var(--shiftai-primary);
}

.required-dom-map {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.fail-list-visual {
  display: grid;
  gap: 8px;
}

.fail-list-visual span {
  min-height: 42px;
  padding: 8px 12px;
  background: #f1f1f1;
  color: var(--c-main);
  font-weight: 700;
}

.verify-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.slide-markdown pre {
  max-height: 640px;
}

.link-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.link-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 168px;
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.link-card:hover {
  color: var(--c-main);
}

.link-card.official {
  background: #fff;
}

.link-label {
  color: var(--c-muted);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.link-card h2 {
  margin: 18px 0 auto;
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.32;
}

.link-card p {
  margin: 24px 0 0;
  color: var(--c-muted);
  font-family: var(--font-en);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.logo-gradient {
  background: linear-gradient(135deg, #e6033d, #673ba0);
}

.accent-gradient {
  background: linear-gradient(135deg, #ff5757, #8c52ff);
}

.brand-gradient {
  background: linear-gradient(135deg, #c06299, #a51e6d);
}

.sub-gradient {
  background: linear-gradient(135deg, #32bed2, #039578);
}

.footer {
  padding: 28px var(--space-page);
  border-top: 0;
  color: var(--c-muted);
}

.footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .guide-strip,
  .visual-rule-board,
  .slide-guide-board,
  .theme-grid,
  .font-board {
    grid-template-columns: 1fr;
  }

  .slide-guide-card.wide,
  .slide-guide-card.full {
    grid-column: auto;
  }

  .slide-flow,
  .component-demo-grid,
  .required-dom-map,
  .verify-strip,
  .link-board {
    grid-template-columns: 1fr;
  }

  .slide-flow span:not(:last-child)::after {
    display: none;
  }

  .color-pattern-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-palette {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .palette-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rules-grid,
  .gradient-row,
  .check-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .nav-links,
  .utility-links {
    width: 100%;
    overflow-x: auto;
  }

  .top-links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    width: 100%;
    overflow-x: auto;
  }

  h1 {
    font-size: 40px;
  }

  .rules-grid,
  .gradient-row,
  .example-grid,
  .check-hero {
    grid-template-columns: 1fr;
  }

  .swatches,
  .theme-palette,
  .shiftai-swatch-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .palette-layout,
  .color-pattern-map,
  .swatches {
    grid-template-columns: 1fr;
  }

  .prompt-gallery {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-with-action {
    flex-direction: column;
  }

  .card-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .check-hero .top-copy {
    position: static;
  }

  .footer {
    flex-direction: column;
  }

  .link-card {
    min-height: 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
