/* clauck web pages. The clock's memory LCD is the reference: a reflective
   silver panel with black pixels by day, lit warm by the frontlight at night.
   No web fonts and no third-party requests, so a self-hosted instance works
   offline and tells nobody who visited. */

:root {
  --page: #e6e8e3;
  --ink: #1e211d;
  --muted: #565c55;
  --line: #c3c7bf;
  --field: #f5f6f3;
  --bezel: #2a2d29;
  --panel: #c8cbc2;
  --panel-hi: #dfe1da;
  --panel-lo: #b2b6ac;
  --pixel: #1e211d;
  --amber: #e09a3a;
  --error: #a3261b;
  --on-ink: #f5f6f3;
  color-scheme: light;
}

/* At night the frontlight is on: the panel turns warm and the page goes dark
   around it. */
@media (prefers-color-scheme: dark) {
  :root {
    --page: #161815;
    --ink: #e8e6df;
    --muted: #a19f97;
    --line: #34372f;
    --field: #1e211d;
    --bezel: #050605;
    --panel: #d6b27a;
    --panel-hi: #e9c995;
    --panel-lo: #b98f55;
    --pixel: #2b2015;
    --error: #f08b7e;
    --on-ink: #161815;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  width: 100%;
  max-width: 27rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  flex: 1;
}

.wordmark {
  display: inline-block;
  color: var(--ink);
  margin-bottom: 1.75rem;
}
.wordmark svg { height: 0.9rem; display: block; }

h1 {
  font-size: 1.625rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0 0 0.5rem;
}

p { margin: 0 0 1rem; }
.lede { color: var(--muted); }

a { color: inherit; text-underline-offset: 0.18em; }

/* The clock: a dark case around a reflective panel. The sheen is a fixed
   diagonal gradient, as light falls on the real panel from above. */
.clock { margin: 0 0 1.75rem; }
.bezel {
  background: var(--bezel);
  border-radius: 14px;
  padding: 12px;
}
.panel {
  background: linear-gradient(158deg, var(--panel-hi) 0%, var(--panel) 42%, var(--panel-lo) 100%);
  border-radius: 3px;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.35);
  color: var(--pixel);
  padding: 1.6rem 0.75rem;
}
.panel svg { display: block; width: 100%; height: auto; }
.panel.example svg { opacity: 0.32; }
.clock figcaption {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 0.625rem;
}

form { margin: 0; }
.field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.3rem; }
.hint { color: var(--muted); font-size: 0.875rem; margin-top: 0.3rem; }

input[type=email], input[type=password], input[type=text] {
  width: 100%;
  height: 3rem;
  padding: 0 0.85rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 6px;
}
input.code {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
}

button {
  font: inherit;
  cursor: pointer;
}
.primary {
  width: 100%;
  min-height: 3.125rem;
  margin-top: 0.25rem;
  font-weight: 600;
  color: var(--on-ink);
  background: var(--ink);
  border: 0;
  border-radius: 6px;
}
.primary:active { transform: translateY(1px); }
.link {
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.switch { margin-top: 1.5rem; color: var(--muted); }

.message {
  border-left: 3px solid var(--amber);
  padding: 0.15rem 0 0.15rem 0.85rem;
  margin: 0 0 1.5rem;
}
.message.error { border-color: var(--error); color: var(--error); }

.signed-in { color: var(--muted); }
.signed-in strong { color: var(--ink); font-weight: 600; }

.clocks { list-style: none; padding: 0; margin: 0 0 1.5rem; border-top: 1px solid var(--line); }
.clocks li { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.clocks .name { font-weight: 600; }
.clocks .meta { color: var(--muted); font-size: 0.9375rem; }

footer {
  max-width: 27rem;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
footer form { display: inline; }

@media (prefers-reduced-motion: reduce) {
  .primary:active { transform: none; }
}
