@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600;700;800&display=swap");

:root {
  font-family: "DM Sans", "Noto Sans JP", sans-serif;
  color: #292a28;
  background: #f8f7f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --paper: #f8f7f4;
  --ink: #292a28;
  --muted: #898984;
  --red: #d94b42;
  --line: #e9e7e1;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

.topbar {
  height: 76px;
  padding: 0 clamp(20px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid #eeece7;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--red);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: .04em; }
.header-caption { color: #aaa8a2; font-size: 9px; font-weight: 700; letter-spacing: .17em; }

.clock-page { width: min(1050px, calc(100% - 48px)); margin: 0 auto; padding: 70px 0 32px; }
.clock-intro { text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0; color: #aaa8a2; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #e35a4e; box-shadow: 0 0 0 3px rgba(227,90,78,.12); }
.clock-intro h1 { margin: 15px 0 7px; font-size: clamp(29px, 4vw, 44px); font-weight: 700; letter-spacing: .025em; }
.clock-intro h1 span { color: var(--red); }
.intro-copy { margin: 0; color: #898780; font-size: 12px; }

.clock-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 390px);
  align-items: center;
  gap: clamp(45px, 9vw, 120px);
  width: min(850px, 100%);
  margin: 53px auto 0;
}
.clock-wrap { position: relative; width: min(100%, 390px); margin: 0 auto; aspect-ratio: 1; }
.clock-shadow { position: absolute; inset: 17px 12px 2px 24px; border-radius: 50%; background: #b7a394; filter: blur(25px); opacity: .17; }
.clock-face { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
.dial { fill: #fff; stroke: #e5e1d8; stroke-width: 1; }
.dial-inner { fill: none; stroke: #f0eee9; stroke-width: 1; }
.dial-ticks { stroke: #a9a69f; stroke-width: 1.2; stroke-linecap: round; }
.dial-ticks .hour-tick { stroke: #77756f; stroke-width: 2.2; }
.dial-numerals { fill: #6d6b65; font-family: Georgia, "Noto Serif", serif; font-size: 11px; font-weight: 700; text-anchor: middle; }
.hand { fill: none; stroke-linecap: round; transform-origin: 120px 120px; transition: transform .18s cubic-bezier(.25,.8,.35,1); }
.hand-hour { stroke: #292a28; stroke-width: 5; }
.hand-minute { stroke: #484943; stroke-width: 3.5; }
.hand-second { stroke: var(--red); stroke-width: 1.5; }
.hand-cap { fill: #292a28; }
.hand-cap-center { fill: var(--red); }
.clock-ring-label {
  position: absolute;
  left: 50%;
  bottom: 7%;
  transform: translateX(-50%);
  color: #b9b4ab;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .2em;
  white-space: nowrap;
}

.clock-details { width: 100%; }
.time-panel { padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.panel-label { display: flex; align-items: center; gap: 11px; margin: 0 0 7px; color: #77756f; font-size: 11px; font-weight: 700; }
.panel-label span { color: #aaa8a2; font-size: 8px; font-weight: 600; letter-spacing: .14em; }
.digital-time { display: block; color: var(--ink); font-size: clamp(45px, 6vw, 63px); font-weight: 500; letter-spacing: .045em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.date-line { margin: 7px 0 0; color: #8b8982; font-size: 11px; }
.sound-panel { display: flex; align-items: center; gap: 13px; min-height: 78px; border-bottom: 1px solid var(--line); }
.sound-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #f0eee8; color: #87847d; }
.sound-icon svg,.button-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sound-copy { display: flex; flex: 1; flex-direction: column; gap: 4px; }
.sound-copy strong { font-size: 11px; font-weight: 700; }
.sound-copy span { color: #99978f; font-size: 9px; line-height: 1.5; }
.sound-state { color: #aaa8a2; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.sound-panel.is-on .sound-icon { color: var(--red); background: #f7e8e5; }
.sound-panel.is-on .sound-state { color: var(--red); }

.sound-toggle {
  width: 100%;
  min-height: 51px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 23px;
  padding: 0 17px;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  box-shadow: 0 5px 14px rgba(217,75,66,.17);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.sound-toggle:hover { background: #c94139; transform: translateY(-1px); box-shadow: 0 7px 18px rgba(217,75,66,.23); }
.sound-toggle:active { transform: translateY(0); }
.button-icon { display: grid; place-items: center; }
.icon-muted,.sound-toggle[aria-pressed="true"] .icon-volume { display: none; }
.sound-toggle[aria-pressed="true"] .icon-muted { display: block; }
.button-arrow { margin-left: auto; font-size: 16px; font-weight: 400; }
.sound-toggle[aria-pressed="true"] { background: #393936; box-shadow: 0 5px 14px rgba(41,42,40,.14); }
.sound-toggle[aria-pressed="true"]:hover { background: #292a28; }
.browser-note { margin: 10px 0 0; color: #a5a29a; font-size: 9px; text-align: center; line-height: 1.6; }
.browser-note.is-error { color: #b23d34; }
.hourly-test-button { display: block; margin: 13px auto 0; padding: 7px 10px; border: 1px solid #e2dfd7; border-radius: 5px; background: transparent; color: #77756f; font-size: 9px; cursor: pointer; transition: background .15s, border-color .15s; }
.hourly-test-button:hover { border-color: #c9b9a6; background: #f0eee8; }
.password-dialog { width: min(390px, calc(100% - 32px)); max-width: none; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--ink); }
.password-dialog::backdrop { background: rgba(31,29,26,.58); backdrop-filter: blur(3px); }
.password-card { display: flex; flex-direction: column; gap: 11px; position: relative; padding: 30px; border-radius: 9px; background: #fff; box-shadow: 0 20px 70px #0003; }
.password-card h2 { margin: 0; font-size: 20px; }
.password-description { margin: 0; color: #85837d; font-size: 11px; }
.password-card label { margin-top: 3px; color: #5f5d57; font-size: 10px; font-weight: 700; }
.password-card input { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #e8e6e0; border-radius: 5px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.password-card input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.password-error { min-height: 16px; margin: 0; color: #b23d34; font-size: 10px; }
.password-submit { min-height: 42px; margin-top: 2px; border: 0; border-radius: 5px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.password-close { position: absolute; top: 12px; right: 15px; padding: 2px 6px; border: 0; background: transparent; color: #898780; font-size: 23px; line-height: 1; cursor: pointer; }

.clock-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 54px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #aaa8a2;
  font-size: 9px;
}
.clock-footer span:first-child { display: flex; align-items: center; gap: 7px; }
.clock-footer i { width: 5px; height: 5px; border-radius: 50%; background: #8db59f; }
.clock-footer span:last-child { font-size: 8px; font-weight: 700; letter-spacing: .14em; }

.hourly-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050505;
}
.hourly-overlay[hidden] { display: none; }
.hourly-overlay video { display: block; width: 100%; height: 100%; object-fit: contain; background: #050505; }
.hourly-play-button { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); min-width: 150px; padding: 14px 22px; border: 1px solid rgba(255,255,255,.7); border-radius: 6px; background: rgba(25,25,25,.85); color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.hourly-play-button[hidden] { display: none; }
.hourly-play-button:focus-visible { outline-color: #fff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body.hourly-active { overflow: hidden; }

@media (max-width: 700px) {
  .topbar { height: 64px; padding: 0 18px; }
  .brand-mark { width: 34px; height: 34px; font-size: 22px; }
  .brand-name { font-size: 14px; }
  .clock-page { width: min(100% - 36px, 480px); padding-top: 44px; }
  .clock-intro h1 { margin-top: 13px; }
  .intro-copy { font-size: 11px; }
  .clock-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 32px; }
  .clock-wrap { width: min(78vw, 320px); }
  .clock-details { width: min(100%, 390px); margin: 0 auto; }
  .digital-time { font-size: clamp(48px, 13vw, 62px); }
  .clock-footer { margin-top: 38px; }
  .clock-footer span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
