.civilization-clock {
  position: relative;
  margin-top: clamp(68px, 10vw, 128px);
  padding: 34px 0;
  isolation: isolate;
}

.civilization-clock::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -12% -4%;
  background: radial-gradient(ellipse at center, rgba(139, 154, 176, .07), transparent 67%);
  pointer-events: none;
}

.clock-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 43%) minmax(0, 1fr);
  align-items: center;
  column-gap: 30px;
  row-gap: 52px;
}

.clock-dial {
  position: relative;
  grid-column: 2;
  grid-row: 1 / 3;
  width: 100%;
  user-select: none;
}

.clock-dial svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  overflow: visible;
}

.clock-rim { fill: none; stroke: #b7beca; stroke-width: .55; opacity: .25; }
.clock-inner-rim { fill: none; stroke: #b7beca; stroke-width: .4; opacity: .12; }
.clock-ticks { fill: none; stroke: #c9cdd5; stroke-width: .7; opacity: .28; }
.clock-ticks .major { stroke-width: 1; opacity: 1; }
.clock-ticks .minor { opacity: .5; }
.clock-orbit { fill: none; stroke: #c1c9d5; stroke-width: .9; stroke-linecap: round; stroke-dasharray: 33 1023; opacity: .4; }
.clock-digital {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  margin: clamp(18px, 2.5vw, 30px) auto 0;
  color: #d4d7df;
  font-family: "HarmonyOS Sans SC", sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 3.8vw, 48px);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  letter-spacing: -.025em;
  font-synthesis: none;
}
.clock-digit {
  position: relative;
  display: block;
  width: .64em;
  height: 1.2em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  contain: paint;
}
.clock-digit-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.clock-digit-separator {
  display: block;
  width: .38em;
  text-align: center;
  color: #828995;
  transform: translateY(-.055em);
}

.clock-hand {
  transform-origin: 180px 180px;
  animation: civilization-clock-turn var(--hand-duration) linear infinite;
}

.clock-hour { --hand-start: 306deg; --hand-duration: 43200s; }
.clock-minute { --hand-start: 42deg; --hand-duration: 3600s; }
.clock-second { --hand-start: 204deg; --hand-duration: 60s; }
.clock-hour line { stroke: #d4d7dd; stroke-width: 2.8; stroke-linecap: round; }
.clock-minute line { stroke: #a7aeb9; stroke-width: 1.8; stroke-linecap: round; }
.clock-second line { stroke: #94a7c3; stroke-width: .8; stroke-linecap: round; }
.clock-second circle { fill: #bbc8db; }
.clock-orbit { transform-origin: 180px 180px; animation: civilization-clock-orbit 150s linear infinite; }

.clock-node circle:first-child {
  fill: #0a0b0e;
  stroke: #7b8494;
  stroke-width: .7;
  transition: stroke 1.4s ease, opacity 1.4s ease;
  opacity: .45;
}

.clock-node circle:last-child {
  fill: #7b8494;
  transition: fill 1.4s ease, filter 1.4s ease;
}

.clock-node.is-current circle:first-child { stroke: #c7d2e3; opacity: .9; }
.clock-node.is-current circle:last-child { fill: #d3dce9; filter: drop-shadow(0 0 4px #8e9fb8); }

.clock-principle {
  position: relative;
  min-width: 0;
  padding: 12px 0;
}

.clock-principle:nth-of-type(odd) { text-align: right; }

.clock-principle:nth-of-type(1) { grid-column: 1; grid-row: 1; }
.clock-principle:nth-of-type(2) { grid-column: 3; grid-row: 1; }
.clock-principle:nth-of-type(3) { grid-column: 1; grid-row: 2; }
.clock-principle:nth-of-type(4) { grid-column: 3; grid-row: 2; }

.clock-principle::after {
  content: "";
  position: absolute;
  top: 27px;
  left: calc(100% + 8px);
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, rgba(164, 175, 193, .32), rgba(164, 175, 193, .05));
}

.clock-principle:nth-of-type(even)::after {
  left: auto;
  right: calc(100% + 8px);
  transform: scaleX(-1);
}

.clock-principle h3 {
  margin: 0;
  color: #c4c7d0;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -.025em;
  transition: color 1.4s ease;
}

.clock-principle p {
  margin: 16px 0 0;
  color: #999ca7;
  font-size: 14px;
  line-height: 1.95;
}

.clock-principle.is-current h3 { color: #f0f1f5; }

.civilization-clock.is-paused .clock-hand,
.civilization-clock.is-paused .clock-orbit { animation-play-state: paused; }

@keyframes civilization-clock-turn {
  from { transform: rotate(var(--hand-start)); }
  to { transform: rotate(calc(var(--hand-start) + 360deg)); }
}
@keyframes civilization-clock-orbit { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .clock-layout { column-gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(270px, 40%) minmax(0, 1fr); }
  .clock-principle p { font-size: 13px; }
  .clock-principle::after { width: 20px; }
}

@media (max-width: 720px) {
  .civilization-clock { padding: 0; }
  .clock-layout {
    position: relative;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 30px;
    row-gap: 30px;
    align-items: start;
  }
  .clock-layout::before {
    content: "";
    position: absolute;
    top: calc(min(90vw, 370px) + 96px);
    bottom: 8px;
    left: 50%;
    width: 1px;
    background: linear-gradient(rgba(151, 164, 184, .3), rgba(151, 164, 184, .07));
  }
  .clock-dial { grid-column: 1 / 3; grid-row: 1; width: min(100%, 390px); margin-inline: auto; }
  .clock-principle:nth-of-type(1) { grid-column: 1; grid-row: 2; }
  .clock-principle:nth-of-type(2) { grid-column: 2; grid-row: 2; }
  .clock-principle:nth-of-type(3) { grid-column: 1; grid-row: 3; }
  .clock-principle:nth-of-type(4) { grid-column: 2; grid-row: 3; }
  .clock-principle { padding-top: 8px; }
  .clock-principle::after { top: 21px; left: auto; right: -15px; width: 10px; }
  .clock-principle:nth-of-type(even)::after { right: auto; left: -15px; }
  .clock-principle h3 { font-size: 18px; }
  .clock-principle p { margin-top: 12px; line-height: 1.85; }
  }

@media (prefers-reduced-motion: reduce) {
  .civilization-clock .clock-hand { animation: none; transform: rotate(var(--hand-start)); }
  .civilization-clock .clock-orbit { animation: none; }
}

@media print {
  .civilization-clock, .clock-principle { opacity: 1 !important; transform: none !important; animation: none !important; }
  .clock-principle h3, .clock-principle p { color: #222; }
}
