/* ===================== ПОДКЛЮЧЕНИЕ ШРИФТОВ ===================== */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Roboto+Mono:wght@400;500&display=swap');

@font-face {
  font-family: DSEG7;
  src: url('fonts/DSEG7Classic-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: DSEG14;
  src: url('fonts/DSEG14Classic-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Digital-7';
  src: url('fonts/digital-7.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ===================== ПЕРЕМЕННЫЕ ===================== */
:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --text: #202521;
  --muted: #727a72;
  --line: #dce1d8;
  --green: #315a32;
  --accent: #b5ef7b;
  --panel: #e9ede5;
}

/* ===================== БАЗА ===================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, Arial, sans-serif;
  transition: background .45s, color .45s;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
  color: inherit;
}

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

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

button {
  border: 0;
}

button:disabled {
  opacity: .5;
  cursor: wait;
}

.skip {
  position: fixed;
  top: -100px;
  left: 16px;
  background: var(--accent);
  padding: 15px;
  z-index: 10;
}

.skip:focus {
  top: 8px;
}

/* ===================== ШАПКА ===================== */
.header {
  height: 98px;
  margin: 0 5%;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 25px;
}

.brand {
  display: inline-block;
}

.brand img {
  width: 120px;
  display: block;
  max-width: 100%;
  height: auto;
}

.header-line {
  height: 24px;
  width: 1px;
  background: var(--line);
}

.header-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}

.collection {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
}

.collection span {
  font-size: 14px;
  margin-left: 5px;
}

.locale {
  margin-left: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
}

.flag {
  display: inline-block;
  width: 18px;
  height: 12px;
  background: linear-gradient(#347bd2 50%, #f0d54b 50%);
  border-radius: 2px;
  flex-shrink: 0;
}

main {
  max-width: 1600px;
  margin: auto;
  padding: 0 5%;
}

/* ===================== EYEBROW ===================== */
.eyebrow {
  padding-top: 29px;
  display: flex;
  justify-content: space-between;
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}

/* ===================== HERO ===================== */
.hero {
  min-height: 680px;
  display: grid;
  grid-template-columns: 1.03fr 1fr;
  align-items: center;
  gap: 4%;
  padding: 15px 0 42px;
}

.product-stage {
  min-width: 0;
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.stage-word {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  font-size: clamp(65px, 8vw, 118px);
  font-weight: 800;
  letter-spacing: -6px;
  color: var(--line);
  opacity: .55;
  white-space: nowrap;
}

/* ===================== ЧАСЫ (ИЗОБРАЖЕНИЕ) ===================== */
.watch {
  position: relative;
  width: min(100%, 620px);
  aspect-ratio: 1;
  z-index: 1;
}

.watch img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(5px 18px 12px #0002);
  mix-blend-mode: multiply;
}

.watch {
  isolation: auto;
  mix-blend-mode: multiply;
}

.watch img {
  filter: none;
}

.watch-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.lcd {
  fill: #0e2415;
  font: 500 67px 'Roboto Mono', monospace;
  font-family: DSEG7, monospace;
  font-size: 75px;
  font-weight: 600;
  letter-spacing: 0;
}

.small-lcd {
  fill: #0c2211;
  font: 500 33px 'Roboto Mono', monospace;
/*  font-family: DSEG7, monospace; */
  font-family: 'Digital-7', monospace;
  font-size: 50px;
  font-weight: 500;
  letter-spacing: 0;
}

.seconds-lcd {
  font-family: DSEG7, monospace;
  font-size: 43px;
  fill: #0e2415;
  font-weight: 500;
}

.casio-site {
    fill: #101e14;
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 2px;
}

.weekday-lcd {
/*  font-family: DSEG14, monospace; */
  font-family: 'Digital-7', monospace;
  font-size: 32px;
  font-weight: 600;
  fill: #0c2211;
}

.lcd-glow {
  opacity: 0;
  fill: #81ff71;
  mix-blend-mode: screen;
  transition: opacity .5s;
}

/* ===================== HOTSPOTS ===================== */
.hotspot {
  position: absolute;
  background: transparent;
  border-radius: 30%;
  min-width: 32px;
  min-height: 32px;
  transition: box-shadow .2s;
}

.hotspot:hover,
.hotspot:focus-visible {
  box-shadow: 0 0 0 2px #a0db7199, 0 0 25px #b5ef7b66;
  background: #b5ef7b11;
}

.mode-spot {
  left: 20%;
  top: 53%;
  width: 10%;
  height: 12%;
  transform: rotate(-28deg);
}

.reset-spot {
  left: 68%;
  top: 24%;
  width: 10%;
  height: 11%;
  transform: rotate(-32deg);
}

.start-spot {
  left: 69%;
  top: 53%;
  width: 10%;
  height: 12%;
  transform: rotate(30deg);
}

.light-spot {
  left: 44%;
  top: 70%;
  width: 12%;
  height: 8%;
}

/* ===================== ПОДПИСЬ ПОД ЧАСАМИ ===================== */
.product-caption {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    gap: 12px;
    padding: 0 10px;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 1px;
    color: var(--muted);
    position: relative;
    z-index: 2;
    font-size: 12px;
}

.mini-line {
  width: 25px;
  height: 1px;
  background: var(--muted);
}

.caption-dot {
  color: #919b8a;
}

/* ===================== ПАНЕЛЬ ЧАСОВ ===================== */
.clock-panel {
  max-width: 580px;
  padding-top: 6px;
}

.location {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 24px;
}

h1 {
  font-size: clamp(38px, 4.1vw, 64px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -2.7px;
  margin: 0 0 32px;
}

h1 span {
  color: #81897d;
}

/* ===================== ТАБЫ ===================== */
.tabs {
  display: flex;
  gap: 27px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 23px;
}

.tabs button {
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 0 14px;
  position: relative;
}

.tabs button[aria-selected=true] {
  color: var(--text);
}

.tabs button[aria-selected=true]:after {
  content: '';
  position: absolute;
  bottom: -1px;
  height: 2px;
  left: 0;
  right: 0;
  background: var(--text);
}

/* ===================== ВРЕМЯ ===================== */
.time-line {
  display: flex;
  align-items: baseline;
  gap: 15px;
  font-family: 'Roboto Mono', monospace;
  font-variant-numeric: tabular-nums;
  line-height: 1.16;
  white-space: nowrap;
  font-family: DSEG7, monospace;
  gap: 18px;
  line-height: 1.4;
  padding-top: 8px;
}

#main-time {
  font-size: clamp(58px, 7.4vw, 106px);
  font-weight: 400;
  letter-spacing: -7px;
  font-size: clamp(74px, 8.2vw, 118px);
  letter-spacing: 0;
  font-weight: 400;
}

#main-seconds {
  font-size: clamp(32px, 3.7vw, 54px);
  color: var(--green);
  letter-spacing: -3px;
  font-size: clamp(40px, 4vw, 58px);
  letter-spacing: 0;
}

/* ===================== ДАТА ===================== */
.date-line {
  font-size: 16px;
  color: var(--muted);
  margin: 13px 0 24px;
  text-transform: capitalize;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 18px;
  margin: 14px 0 28px;
  line-height: 1.7;
  text-transform: none;
}

#main-weekday {
/*  font-family: DSEG14, monospace; */
  font-family: 'Digital-7', monospace;
  font-size: 40px;
  color: var(--muted);
}

#main-date {
/*  font-family: DSEG7, monospace; */
  font-family: 'Digital-7', monospace;
  font-size: 46px;
  color: var(--text);
}

#mode-description {
  font-size: 18px;
}

/* ===================== СИНХРОНИЗАЦИЯ ===================== */
.sync-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  min-height: 30px;
  margin: 0 0 25px;
}

.sync-state {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
}

.sync-state i {
  width: 6px;
  height: 6px;
  background: #bca36a;
  border-radius: 50%;
  flex-shrink: 0;
}

.sync-state.ok i {
  background: #4b8337;
}

.sync-state.ok {
  color: var(--green);
}

.icon-button {
  font-size: 23px;
  background: none;
  padding: 0 5px;
  line-height: 30px;
}

.zone {
  margin-left: auto;
  color: var(--muted);
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
}

/* ===================== КНОПКИ ДЕЙСТВИЙ ===================== */
.actions {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  min-height: 50px;
  border-radius: 5px;
  padding: 0 13px;
}

.actions svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.light-toggle {
  background: var(--panel);
  flex: 1;
}

.switch {
  margin-left: 5px;
  background: #c2cbbc;
  border-radius: 16px;
  width: 30px;
  height: 18px;
  padding: 3px;
  flex-shrink: 0;
}

.switch i {
  display: block;
  height: 12px;
  width: 12px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
}

.fullscreen-button {
  background: transparent;
  border: 1px solid var(--line);
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 17px 0 0;
  font-size: 13px;
}

/* ===================== НИЖНЯЯ ПОЛОСА ===================== */
.bottom-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 29px 0;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
}

.precision {
  display: flex;
  gap: 17px;
  align-items: center;
}

.crosshair {
  font-size: 38px;
  color: var(--muted);
  font-weight: 400;
}

h2 {
  font-size: 15px;
  margin: 0 0 7px;
  font-weight: 700;
}

.precision p {
  font-size: 12px;
  line-height: 1.8;
  margin: 0;
  color: var(--muted);
  max-width: 590px;
  font-size: 13px;
}

.catalog-link {
  display: flex;
  align-items: center;
  gap: 36px;
  border-left: 1px solid var(--line);
  padding-left: 36px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
}

.catalog-link small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  margin-top: 6px;
}

.arrow {
  display: grid;
  place-items: center;
  background: var(--accent);
  width: 42px;
  height: 42px;
  color: #24371d;
  border-radius: 50%;
  font-size: 23px;
  transition: transform .2s;
}

.catalog-link:hover .arrow {
  transform: translate(2px, -2px);
}

/* ===================== ФУТЕР ===================== */
footer {
  max-width: 1600px;
  margin: auto;
  min-height: 83px;
  padding: 22px 5%;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

footer > span:first-child {
  font-weight: 800;
  letter-spacing: 1px;
}

footer button {
  color: var(--muted);
  background: none;
  font-size: 12px;
  padding: 10px 0;
  font-size: 13px;
}

footer button span {
  margin-left: 10px;
}

/* ===================== ЭЛЕМЕНТЫ УПРАВЛЕНИЯ ===================== */
.run-controls {
  display: flex;
  gap: 10px;
  margin: 10px 0 17px;
}

.run-controls button {
  padding: 11px 25px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
}

.primary {
  background: var(--accent);
  color: #24371d;
}

.secondary {
  background: var(--panel);
}

.timer-settings {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0 16px;
}

.timer-settings label {
  font-size: 12px;
  color: var(--muted);
}

.timer-settings span {
  padding-top: 15px;
}

.timer-settings input {
  display: block;
  margin-top: 6px;
  width: 80px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 4px;
  font-family: 'Roboto Mono', monospace;
  font-size: 18px;
}

.announcement {
  font-size: 13px;
  color: var(--green);
  margin: 0 0 12px;
}

.announcement:empty {
  display: none;
}

[hidden] {
  display: none !important;
}

/* ===================== ТЁМНАЯ ТЕМА ===================== */
.dark {
  color-scheme: dark;
  --bg: #121814;
  --text: #e9ede5;
  --muted: #9ca79a;
  --line: #303b31;
  --green: #b5ef7b;
  --accent: #b5ef7b;
  --panel: #263527;
}

.dark .brand {
  color: #f3f5f0;
}

.dark h1 span {
  color: #8a9b83;
}

.dark .watch img {
  filter: drop-shadow(0 12px 24px #0007);
  filter: none;
}

.dark .lcd-glow {
  opacity: .35;
}

.dark .switch {
  background: #b5ef7b;
}

.dark .switch i {
  transform: translateX(12px);
  background: #263d22;
}

.dark .stage-word {
  opacity: .4;
  color: #a4b19b;
}

.dark .watch {
  filter: drop-shadow(0 0 40px #94ce5710);
  filter: none;
}

.dark .lcd {
  fill: #07130a;
}

.dark .product-stage {
  background: #c5cebd;
  border-radius: 10px;
  padding-bottom: 10px;
}

.dark .product-caption {
  color: #43513c;
}

/* ===================== ДИАЛОГИ ===================== */
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  max-width: 540px;
  width: calc(100% - 40px);
  padding: 38px;
}

dialog::backdrop {
  background: #0008;
  backdrop-filter: blur(5px);
}

dialog h2 {
  font-size: 25px;
  margin: 16px 0 20px;
}

dialog p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
}

.dialog-kicker {
  font-size: 12px;
  letter-spacing: 2px;
}

.close-dialog {
  position: absolute;
  right: 15px;
  top: 10px;
  background: transparent;
  font-size: 28px;
  padding: 4px 10px;
}

/* ===================== FOCUS MODE ===================== */
.focus-mode .header,
.focus-mode .eyebrow,
.focus-mode .bottom-strip,
.focus-mode footer,
.focus-mode .hint {
  display: none;
}

.focus-mode .hero {
  min-height: 100dvh;
}

.focus-mode #main-time {
  font-size: clamp(66px, 9vw, 140px);
  font-size: clamp(74px, 9vw, 130px);
}

.focus-mode h1 {
  font-size: 40px;
}

.focus-mode .watch {
  width: 100%;
}

/* ===================== АДАПТИВ ===================== */
@media (min-width: 1600px) {
  .hero {
    min-height: 760px;
  }
  .watch {
    width: 680px;
    max-width: 110%;
  }
}

@media (min-width: 701px) and (max-width: 1100px) {
  #main-time {
    font-size: 7.4vw;
  }
  #main-seconds {
    font-size: 3.8vw;
  }
  .time-line {
    gap: 12px;
  }
  #main-date {
    font-size: 22px;
  }
  #main-weekday {
    font-size: 22px;
  }
}

@media (max-width: 1050px) {
  .hero {
    gap: 1%;
    grid-template-columns: 1fr 1fr;
    min-height: 610px;
  }
  .header {
    height: 84px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .actions button {
    flex: 1;
    white-space: nowrap;
  }
  .zone {
    display: none;
  }
  h1 {
    font-size: 44px;
  }
  .catalog-link {
    gap: 15px;
    padding-left: 20px;
  }
  .time-line {
    gap: 12px;
  }
  #main-time {
    letter-spacing: -5px;
  }
  .clock-panel {
    padding: 20px 0;
  }
  .product-caption {
    font-size: 10px;
  }
  .watch {
    width: 112%;
    max-width: 600px;
  }
}

@media (max-width: 700px) {
  .header {
    height: 73px;
    gap: 15px;
    margin: 0 6%;
  }
  .brand {
    font-size: 29px;
  }
  .header-label,
  .header-line,
  .locale {
    display: none;
  }
  .collection {
    font-size: 12px;
  }
  .collection span {
    margin-left: 3px;
    font-size: 12px;
  }
  .eyebrow {
    font-size: 10px;
    padding-top: 22px;
  }
  .hero {
    display: flex;
    flex-direction: column;
    padding: 26px 0 30px;
    gap: 0;
    min-height: 0;
  }
  .clock-panel {
    order: 1;
    width: 100%;
    max-width: none;
    padding: 0;
  }
  .product-stage {
    order: 0;
    align-self: center;
    width: 100%;
    max-width: 450px;
  }
  .watch {
    width: 100%;
    max-width: none;
  }
  .stage-word {
    font-size: 85px;
  }
  .location {
    margin-bottom: 17px;
    font-size: 11px;
  }
  h1 {
    font-size: 35px;
    letter-spacing: -2px;
    margin-top: 22px;
  }
  .tabs {
    gap: 30px;
    margin-bottom: 18px;
  }
  #main-time {
    font-size: clamp(62px, 17vw, 106px);
    letter-spacing: -5px;
    font-size: clamp(59px, 18vw, 105px);
    letter-spacing: 0;
  }
  #main-seconds {
    font-size: clamp(34px, 10vw, 54px);
    font-size: clamp(29px, 8.7vw, 49px);
    letter-spacing: 0;
  }
  .time-line {
    justify-content: flex-start;
    gap: 14px;
    gap: 12px;
  }
  .date-line {
    font-size: 15px;
    margin: 12px 0 17px;
    gap: 14px;
  }
  #main-date {
    font-size: clamp(19px, 5.5vw, 27px);
  }
  #main-weekday {
    font-size: clamp(18px, 5.3vw, 25px);
  }
  .sync-row {
    margin-bottom: 16px;
  }
  .zone {
    display: block;
    font-size: 10px;
  }
  .actions {
    flex-wrap: nowrap;
  }
  .actions button {
    font-size: 12px;
    padding: 0 10px;
    gap: 7px;
  }
  .hint {
    font-size: 11px;
  }
  .bottom-strip {
    flex-direction: column;
    align-items: stretch;
    padding: 23px 0;
    gap: 22px;
  }
  .precision {
    gap: 12px;
  }
  .precision p {
    font-size: 12px;
  }
  .catalog-link {
    padding: 20px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    justify-content: space-between;
  }
  .product-caption {
    margin-top: 0;
    font-size: 10px;
  }
  footer {
    flex-wrap: wrap;
    gap: 8px;
    padding: 18px 6%;
  }
  footer > span:nth-child(2) {
    display: none;
  }
  main {
    padding: 0 6%;
  }
  .focus-mode .hero {
    justify-content: center;
    padding-top: 30px;
  }
  .focus-mode .product-stage {
    max-width: 350px;
  }
  .focus-mode h1 {
    display: none;
  }
  .focus-mode #main-time {
    font-size: 20vw;
    font-size: 18vw;
  }
}

/* Stopwatch: a complete MM:SS:mmm readout on both displays. */
.stopwatch-mode #main-time {
  font-size: clamp(28px, 4.2vw, 62px);
  letter-spacing: 0;
}

.stopwatch-mode .time-line {
  overflow-x: auto;
}

.stopwatch-mode #watch-digital {
  font-size: 48px;
}

.stopwatch-mode #watch-seconds {
  display: none;
}

@media (max-width: 700px) {
  .stopwatch-mode #main-time {
    font-size: clamp(24px, 8.5vw, 60px);
  }
}

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
