@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/instrument-serif.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/manrope.woff2") format("woff2");
}

:root {
  /* Cozzi Studio palette and type */
  --espresso: #2A1810; --mocha: #5B3A28; --cream: #F3EDE5; --amber-soft: #D9A066;
  --fg: #F1E8DF; --fg-muted: #BBA99F; --line: rgba(241, 232, 223, 0.16);
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: 16px;
}
*, *::before, *::after { box-sizing: border-box; }

/* The page never scrolls: it is pinned to the screen, on every device. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  position: fixed; inset: 0; width: 100%; margin: 0; touch-action: pinch-zoom;
  background: var(--espresso); color: var(--fg);
  font-family: var(--font-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
h1, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber-soft); outline-offset: 3px; }

.btn {
  --btn-bg: var(--cream); --btn-fg: var(--espresso);
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: .9rem 2rem; border-radius: 999px; border: 1px solid var(--btn-bg);
  background: var(--btn-bg); color: var(--btn-fg); font-size: .875rem; font-weight: 600; letter-spacing: .04em;
  overflow: hidden; isolation: isolate; touch-action: manipulation;
  transition: color .45s var(--ease-out), border-color .45s var(--ease-out), opacity .2s;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--amber-soft);
  border-radius: inherit; transform: translateY(101%); transition: transform .45s var(--ease-out);
}
.btn:hover:not(:disabled)::before, .btn:focus-visible::before { transform: none; }
.btn:hover:not(:disabled), .btn:focus-visible { border-color: var(--amber-soft); color: var(--espresso); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--fg); border-color: var(--line); }
.btn:disabled { opacity: .35; cursor: default; }
.btn[hidden] { display: none; }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--fg); touch-action: manipulation; transition: border-color .2s, opacity .2s;
}
.icon-btn:hover:not(:disabled) { border-color: var(--amber-soft); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Page */
#watchPage {
  display: grid; place-items: center; align-content: center; gap: 10px; height: 100%;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) max(12px, env(safe-area-inset-bottom));
}
.watch-head { display: flex; align-items: center; justify-content: center; gap: 14px; }
.watch-head h1 { min-width: 9.5rem; font-family: var(--font-display); font-weight: 400; font-size: 1.75rem; line-height: 1; text-align: center; letter-spacing: -.01em; }
.watch-head .icon-btn { width: 36px; height: 36px; }
.watch-now { text-align: center; }
.watch-now__time { font-family: var(--font-display); font-size: 2.5rem; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.watch-now__time span { display: inline-block; text-align: center; }
.watch-now__time .dig { width: .48em; }
.watch-now__time .sep { width: .24em; }
.watch-now__date { margin-top: 6px; font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--amber-soft); font-variant-numeric: tabular-nums; }
.watch-stage { position: relative; width: min(calc(100vw - 32px), calc(100vh - 286px), 760px); width: min(calc(100vw - 32px), calc(100dvh - 286px), 760px); aspect-ratio: 1; }
.watch-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.watch-foot .btn { min-height: 44px; padding: 0 28px; }
#watchSound .sound-off { display: none; }
#watchSound[aria-pressed=false] .sound-on { display: none; }
#watchSound[aria-pressed=false] .sound-off { display: inline; }

/* Crown control: a ribbed roller you slide with a finger or the mouse */
.watch-set { display: grid; justify-items: center; gap: 6px; width: min(calc(100vw - 32px), 340px); }
.watch-set p { font-size: .8125rem; font-weight: 500; color: var(--fg-muted); text-align: center; transition: color .25s; }
.watch-set.active p { color: var(--amber-soft); }
.crown-wheel {
  --roll: 0px;
  position: relative; width: 100%; height: 44px; border-radius: 8px; border: 1px solid var(--line);
  cursor: grab; touch-action: none; overflow: hidden;
  background-image:
    linear-gradient(90deg, rgba(20, 10, 6, .94), rgba(20, 10, 6, .1) 26%, rgba(20, 10, 6, .1) 74%, rgba(20, 10, 6, .94)),
    repeating-linear-gradient(90deg, #E9E9E5 0 2px, #6E6E6C 2px 5px, #2E2E2E 5px 9px),
    linear-gradient(180deg, #3A3A3A, #D8D8D4 45%, #4C4C4C);
  background-size: auto, 9px 100%, auto;
  background-position: 0 0, var(--roll) 0, 0 0;
  background-blend-mode: normal, multiply, normal;
  opacity: 0; visibility: hidden; transform: translateY(5px);
  transition: opacity .25s, transform .3s var(--ease-out), visibility .25s;
}
.crown-wheel::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--amber-soft); opacity: .85; }
.watch-set.active .crown-wheel { opacity: 1; visibility: visible; transform: none; }
.crown-wheel.grabbed { cursor: grabbing; }

/* Watch */
.watch {
  position: relative; width: 100%; height: 100%;
  --w-dial-a: #1B1B1E; --w-dial-b: #060607; --w-ray: #fff;
  --w-rehaut: #131315; --w-rehaut-ink: #F1EFEA;
  --w-sub-a: #F4F2EE; --w-sub-b: #BDBBB6; --w-sub-ink: #17171A; --w-sub-hand: #141416;
  --w-guil-a: #fff; --w-guil-b: #8D8B87;
  --w-hand-a: #FFFFFF; --w-hand-b: #A7A7A4; --w-hand-c: #E9E9E5;
  --w-chrono: #F4F2EC; --w-ink: #F4F2EC; --w-ink-soft: #C9C7C2;
}
.watch[data-theme=panda] {
  --w-dial-a: #FCFBF8; --w-dial-b: #DAD8D2; --w-ray: #000;
  --w-rehaut: #E9E7E1; --w-rehaut-ink: #17171A;
  --w-sub-a: #2A2A2D; --w-sub-b: #09090B; --w-sub-ink: #F1EFEA; --w-sub-hand: #F4F2EC;
  --w-guil-a: #fff; --w-guil-b: #3E3E41;
  --w-hand-a: #3A3A3D; --w-hand-b: #0E0E10; --w-hand-c: #2A2A2D;
  --w-chrono: #B5702A; --w-ink: #17171A; --w-ink-soft: #4A4A4C;
}
.watch.off { visibility: hidden; }
#diver {
  position: absolute; inset: 0;
  --d-bezel: #EDEAE0; --d-track: #F1EFEA;
  --d-lume-a: #FFFEF8; --d-lume-b: #D9D6CA; --d-hand-lume: #F7F4E8;
  --d-ring-a: #F4F4F0; --d-ring-b: #8F8F8C; --d-ring-c: #E0E0DC;
}
#diver[data-theme=gilt] {
  --d-bezel: #E3C690; --d-track: #E3C690;
  --d-lume-a: #F4E0B4; --d-lume-b: #D8BC84; --d-hand-lume: #F0DBAA;
  --d-ring-a: #EFD8A8; --d-ring-b: #A5854C; --d-ring-c: #D9BD86;
}
#watchBase, #watchTop, #diverBase, #diverBezel, #diverTop { position: absolute; inset: 0; }
.watch svg { display: block; width: 100%; height: 100%; overflow: visible; }
#watchTop, #diverBezel, #diverTop { pointer-events: none; }

/* Lume dial: the whole watch sits under a dark layer, and only the glowing parts rise above it */
#diverDim, #diverLume, #diverLumeHands { position: absolute; inset: 0; display: none; pointer-events: none; }
#diverDim { inset: -6%; background: #000; opacity: .84; }
#diver[data-theme=lume] #diverDim, #diver[data-theme=lume] #diverLume, #diver[data-theme=lume] #diverLumeHands { display: block; }
#diverLume { filter: drop-shadow(0 0 4px #4CFF95) drop-shadow(0 0 12px rgba(53, 224, 122, .75)); }
body { transition: background-color .4s ease; }
body.night { background: #000; }
.watch-head, .watch-now, .watch-set, .watch-foot { transition: opacity .4s ease; }
body.night .watch-head, body.night .watch-foot { opacity: .5; }
body.night .watch-now { opacity: .75; }
body.night .watch-set { opacity: .6; }
body.night .watch-set.active { opacity: 1; }
.bezel-grip { fill: none; stroke: transparent; stroke-width: 70; pointer-events: stroke; cursor: grab; touch-action: none; outline: none; }
.bezel-grip.grabbed { cursor: grabbing; }
.bezel-grip:focus-visible { stroke: rgba(217, 160, 102, .07); }
.pusher { position: absolute; width: 13%; height: 13%; cursor: pointer; transform: translate(-50%, -50%); border-radius: 50%; touch-action: manipulation; }
.pusher--top { left: 90.1%; top: 26.7%; }
.pusher--bot { left: 90.1%; top: 73.3%; }
.pusher--crown { left: 95%; top: 50%; width: 12%; height: 14%; }
#wCrown { transition: transform .28s var(--ease-out); }
.watch text { font-family: var(--font-body); text-anchor: middle; dominant-baseline: central; }
.w-tach { font-size: 16px; font-weight: 600; fill: #F1EFEA; }
.w-tach-label { font-size: 12px; font-weight: 700; letter-spacing: .14em; fill: #F1EFEA; }
.w-sub { font-size: 11.5px; font-weight: 700; fill: var(--w-sub-ink); }
.w-brand { font-family: var(--font-display) !important; font-size: 32px; fill: var(--w-ink); }
.w-small { font-size: 7.5px; font-weight: 600; letter-spacing: .22em; fill: var(--w-ink-soft); }
.d-brand { font-family: var(--font-display) !important; font-size: 32px; letter-spacing: .08em; fill: #F4F2EC; }
.d-model { font-size: 12.5px; font-weight: 700; letter-spacing: .16em; fill: #F4F2EC; }
.d-auto { font-family: var(--font-display) !important; font-size: 15px; fill: #E7E4DA; }
.d-pro { font-size: 8.5px; font-weight: 600; letter-spacing: .24em; fill: #C9C7C2; }
.d-depth { font-size: 11px; font-weight: 700; letter-spacing: .1em; fill: #F4F2EC; }
.w-date { font-size: 21px; font-weight: 700; fill: #17171A; }

@media (max-width: 480px) {
  .watch-foot { flex-wrap: nowrap; }
  .watch-foot .btn { padding: 0 16px; font-size: .8125rem; white-space: nowrap; }
}

/* Phones on their side: watch on the left, controls on the right */
@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  #watchPage { grid-template-columns: auto minmax(220px, 320px); grid-template-rows: auto auto auto auto; column-gap: 24px; justify-content: center; }
  .watch-stage { grid-column: 1; grid-row: 1 / 5; width: calc(100vh - 24px); width: calc(100dvh - 24px); max-width: 60vw; }
  .watch-head, .watch-now, .watch-set, .watch-foot { grid-column: 2; }
  .watch-set { width: 100%; }
  .watch-foot .btn { padding: 0 16px; font-size: .8125rem; }
}

/* The dial crossfades when the theme changes */
.morph .watch:not(.off) { view-transition-name: watch; }
::view-transition-group(watch) { animation-duration: .52s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
::view-transition-old(watch), ::view-transition-new(watch) { animation-duration: .52s; animation-timing-function: ease; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
