/* CREST Clock — the contractor page. One family (Inter Tight, self-hosted, tabular figures), one hero
   (the clock), two states the whole page flips between. Crest OS palette; light and dark both canon. */
@font-face { font-family: 'Inter Tight'; src: url('/fonts/InterTight-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --sea: #0B3B31; --waves: #107860; --ripples: #68C850; --lime: #B0D810;
  --paper: #F7F6EF; --ink: #10261F; --ink-2: #4A5F57; --line: #DDE3DC;
  --field: var(--sea); --field-ink: #F2F1E8; --field-ink-2: #9DB8AC;
  --amber: #8A5A00; --amber-bg: #FBF0D2; --red: #A3201E; --red-bg: #FBE4E6;
  --btn: var(--waves); --btn-ink: #FFFFFF;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #0A2A22; --ink: #E8F0EA; --ink-2: #9DB8AC; --line: #1D4A3D;
    --field: #E8F0EA; --field-ink: #0B3B31; --field-ink-2: #4A5F57;
    --amber: #F0C24B; --amber-bg: #3A3010; --red: #FF8A80; --red-bg: #4A1A1E; --btn: var(--ripples); --btn-ink: #062018; }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 500 17px/1.4 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; font-variant-numeric: tabular-nums;
  transition: background-color .5s ease;
}
.page { min-height: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 14px) 20px calc(env(safe-area-inset-bottom) + 16px); }
.top { display: flex; align-items: center; justify-content: space-between; }
.top .app { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: -.01em; }
.top .app img { width: 26px; height: 26px; }
.top .date { color: var(--ink-2); font-weight: 500; }

/* The hero. Out: quiet numerals on paper. In: the same numerals on a full-bleed field. */
.hero { margin: 28px -20px 0; padding: 44px 20px 36px; text-align: center; border-radius: 0; transition: background-color .5s ease, color .5s ease; }
.hero .time { font-size: clamp(64px, 19vw, 84px); line-height: 1; font-weight: 600; letter-spacing: -.035em; }
.hero .time small { font-size: .32em; font-weight: 500; letter-spacing: 0; margin-left: .18em; vertical-align: .55em; }
.hero .sub { margin-top: 12px; color: var(--ink-2); font-weight: 500; }
.hero .sub b { color: inherit; font-weight: 600; }
body[data-state="in"] .hero { background: var(--field); color: var(--field-ink); margin-top: 20px; }
body[data-state="in"] .hero .sub { color: var(--field-ink-2); }
body[data-state="in"] .hero .time .sec { color: var(--lime); }
@media (prefers-color-scheme: dark) { body[data-state="in"] .hero .time .sec { color: var(--waves); } }

.who { margin: 26px 0 0; text-align: center; }
.who .name { font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; }
.who .co { color: var(--ink-2); }
.who .last { margin-top: 14px; color: var(--ink-2); }
.who .last b { color: var(--ink); font-weight: 600; }
.pick { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pick button { font: inherit; font-weight: 600; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.pick button[aria-pressed="true"] { border-color: var(--waves); background: var(--waves); color: #fff; }
@media (prefers-color-scheme: dark) { .pick button[aria-pressed="true"] { background: var(--ripples); border-color: var(--ripples); color: #062018; } }
.note { margin-top: 18px; padding: 14px 16px; border-radius: 14px; font-weight: 500; }
.note.ok { background: transparent; border: 1.5px solid var(--line); }
.note.warn { background: var(--amber-bg); color: var(--amber); }
.note.bad { background: var(--red-bg); color: var(--red); }
.note b { display: block; font-weight: 600; margin-bottom: 2px; color: var(--ink); }
.note.warn b { color: var(--amber); } .note.bad b { color: var(--red); }

/* The timecard preview. Quiet disclosure; rows on paper with one hairline between them. */
.recent { margin-top: 22px; }
.recent summary { color: var(--ink-2); font-weight: 600; cursor: pointer; padding: 6px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
.recent summary::-webkit-details-marker { display: none; }
.recent summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-left: 2px; }
.recent[open] summary::before { transform: rotate(45deg); }
.recent summary:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; border-radius: 6px; }
.recent ul { list-style: none; margin: 4px 0 0; padding: 0; font-size: .95rem; }
.recent li { padding: 10px 0; border-top: 1px solid var(--line); }
.recent .r1, .recent .r2 { display: flex; align-items: baseline; gap: 10px; }
.recent .r1 .day { font-weight: 600; }
.recent .r1 .prog { color: var(--ink-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .r1 .tag { margin-left: auto; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); white-space: nowrap; }
.recent .r2 { color: var(--ink-2); margin-top: 2px; }
.recent .r2 .hrs { margin-left: auto; color: var(--ink); font-weight: 600; }
.recent .r2 .hrs.open { color: var(--waves); font-weight: 500; }
@media (prefers-color-scheme: dark) { .recent .r2 .hrs.open { color: var(--ripples); } }

.actions { margin-top: auto; padding-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.primary { width: 100%; font: inherit; font-size: 1.4rem; font-weight: 600; letter-spacing: -.01em; padding: 22px 16px; border-radius: 18px; border: 0;
  background: var(--btn); color: var(--btn-ink); cursor: pointer; touch-action: manipulation; }
.primary:disabled { opacity: .45; }
.primary:focus-visible, .pick button:focus-visible, .link:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.link { font: inherit; background: none; border: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px; }
.link:disabled { visibility: hidden; }
.spin { display: inline-block; width: .9em; height: .9em; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -.12em; margin-right: .45em; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { body, .hero { transition: none; } .spin { animation-duration: 1.6s; } }
.foot { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; color: var(--ink-2); font-size: .85rem; }
.foot .family { display: flex; align-items: center; gap: 6px; }
.foot .lockup { width: 84px; height: auto; content: url('/icons/crestos-lockup-light.png'); }
@media (prefers-color-scheme: dark) { .foot .lockup { content: url('/icons/crestos-lockup-dark.png'); } }
.ptr { text-align: center; color: var(--ink-2); font-size: .85rem; height: 0; overflow: hidden; transition: height .15s; }
[hidden] { display: none !important; }

/* ---- registration page ---- */
.hero .title { font-size: clamp(30px, 8.5vw, 40px); line-height: 1.1; font-weight: 600; letter-spacing: -.03em; }
body[data-state="done"] .hero { background: var(--field); color: var(--field-ink); margin-top: 20px; }
body[data-state="done"] .hero .sub { color: var(--field-ink-2); }
body[data-state="done"] .hero .title .mark { color: var(--lime); }
@media (prefers-color-scheme: dark) { body[data-state="done"] .hero .title .mark { color: var(--waves); } }
.who .lead { margin: 0; color: var(--ink-2); text-align: left; }
.install { margin-top: 22px; }
.install h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 8px; letter-spacing: -.01em; }
.install ol { margin: 0; padding-left: 1.3rem; color: var(--ink); }
.install li { margin: 8px 0; }
.install li b { font-weight: 600; }
.install .why { color: var(--ink-2); margin: 10px 0 0; }
a.primary { text-align: center; text-decoration: none; display: block; }
