/* 125naroom たんなる時計（2026-11-08）。デザイン：reference/design_handoff_125naroom_calendar_tokei
   画面の形は JS が data-layout に入れる：sp＝スマホ縦／pc／desk＝置き時計（タブレット横）／land＝スマホ横。文字盤の大きさも JS */
:root {
  --bg: #faf8f3; --night: #f1ede4; --ink: #2b2a27; --sub: #77736a; --line: #e8e3d8; --y: #e8dc6a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #2b2a27; --night: #24231f; --ink: #f3efe6; --sub: #a9a397; --line: #45433e; color-scheme: dark; }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: "Zen Kaku Gothic New", sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; transition: background 1s ease; overflow: hidden; }
a { color: inherit; text-decoration: none; }
h1, p { margin: 0; }
svg { display: block; }

.app { height: 100svh; max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; outline: none;
  padding: max(44px, calc(env(safe-area-inset-top, 0px) + 12px)) 24px max(22px, env(safe-area-inset-bottom, 0px)); }
.app:focus-visible { outline: 1px solid var(--ink); outline-offset: -8px; }
.head { height: 44px; display: flex; align-items: center; justify-content: space-between; flex: none; }
.head h1 { font-size: 20px; font-weight: 500; letter-spacing: .08em; }
.date { font-family: "Jost", sans-serif; font-size: 14px; letter-spacing: .12em; color: var(--sub); }

.stage { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.analog, .digital { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity 300ms ease; pointer-events: none; }
.digital { flex-direction: column; gap: var(--dgap, 28px); opacity: 0; }
.is-digital .analog { opacity: 0; }
.is-digital .digital { opacity: 1; }

/* 文字盤（--s は JS が入れる直径） */
.dial { position: relative; width: var(--s); height: var(--s); }
.face { position: absolute; inset: 0; width: 100%; height: 100%; }
.face .rim { fill: none; stroke: var(--line); stroke-width: 1; }
.face .t { stroke: var(--line); stroke-width: 1; stroke-linecap: round; }
.face .t.hr { stroke: var(--ink); stroke-width: 1.25; }
.face text { font-family: "Jost", sans-serif; font-weight: 300; fill: var(--ink); }
.hand { position: absolute; inset: 0; }
.hand i { position: absolute; left: 50%; bottom: 50%; background: var(--ink); border-radius: 99px; display: block; }
.hand.h i { width: var(--hw); height: var(--hl); margin-left: calc(var(--hw) / -2); }
.hand.m i { width: var(--mw); height: var(--ml); margin-left: calc(var(--mw) / -2); }
.pin { position: absolute; left: 50%; top: 50%; width: var(--cd); height: var(--cd); margin: calc(var(--cd) / -2) 0 0 calc(var(--cd) / -2); border-radius: 50%; background: var(--ink); display: block; }
/* 秒のまる：中心がふちの線の上。カチカチは 160ms すこし行きすぎて戻る */
.sec { position: absolute; inset: 0; }
.sec i { position: absolute; left: 50%; top: calc(12px - var(--dot) / 2); width: var(--dot); height: var(--dot); margin-left: calc(var(--dot) / -2); border-radius: 50%; background: var(--y); display: block; }
.is-tick .sec { transition: transform 160ms cubic-bezier(.3, 1.5, .5, 1); }

/* 数字 */
.dg { display: flex; align-items: baseline; }
.hm { font-family: "Jost", sans-serif; font-weight: 200; font-size: min(var(--dig, 104px), 24vw); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ss { font-family: "Jost", sans-serif; font-weight: 300; font-size: var(--digs, 28px); margin-left: 10px; color: var(--sub); font-variant-numeric: tabular-nums; width: 1.4em; }
.bar { position: relative; width: var(--barw, 300px); max-width: 90%; height: 20px; }
.bar i { position: absolute; display: block; }
.bar .track { left: 0; right: 0; top: 9.5px; height: 1px; background: var(--line); }
.bar .fill { left: 0; top: 9.25px; height: 1.5px; background: var(--ink); }
.bar .ball { top: 3px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--y); }
.is-tick .bar .fill, .is-tick .bar .ball { transition: left 160ms ease-out, width 160ms ease-out; }
.bar.zero .fill, .bar.zero .ball { transition: none !important; }

.foot { padding-top: 14px; display: flex; justify-content: space-between; align-items: center; flex: none; }
.foot-l { font-size: 11px; letter-spacing: .08em; color: var(--sub); }
.logo img { display: block; height: 13px; width: auto; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) { .logo-light { display: none !important; } .logo-dark { display: block !important; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 夜 22:00〜5:00：背景を少し沈めて、線・文字 60%、黄色 75% */
body.is-night { background: var(--night); }
.dim { transition: opacity 1s ease; }
.is-night .dim { opacity: .6; }
.is-night .sec i, .is-night .bar .ball { opacity: .75; }

/* PC・置き時計・スマホ横 */
.app[data-layout="pc"] { padding: 40px 56px 28px; --dig: 200px; --digs: 48px; --barw: 560px; --dgap: 40px; }
.app[data-layout="desk"] { padding: 40px 56px 32px; --dig: 240px; --digs: 56px; --barw: 640px; --dgap: 48px; }
.app[data-layout="land"] { padding: max(20px, env(safe-area-inset-top, 0px)) max(32px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(32px, env(safe-area-inset-left, 0px)); --dig: 120px; --digs: 32px; --barw: 360px; --dgap: 20px; }
.app[data-layout="desk"] .head, .app[data-layout="land"] .head { display: none; }
