/* The Aleph's own palette (src/render/color.h, brand::) and its manners: dark, Exo 2 only, cut corners, a
   hairline, the one accent only for what is lit. */
@font-face { font-family: "Exo 2"; font-weight: 300; src: url(/fonts/Exo2.0-Light.otf) format("opentype"); font-display: swap; }
@font-face { font-family: "Exo 2"; font-weight: 500; src: url(/fonts/Exo2.0-Medium.otf) format("opentype"); font-display: swap; }
@font-face { font-family: "Exo 2"; font-weight: 600; src: url(/fonts/Exo2.0-SemiBold.otf) format("opentype"); font-display: swap; }

:root {
  --night: #10142B; --panel: #181E3D; --panel2: #1F2650; --line: #2B3366;
  --muted: #9AA3D6; --paper: #EEF0F7; --peri: #94ABF9; --violet: #5900FF; --purple: #9B5CFF;
  --accent: #8F4BFF; --red: #FF3B4E; --cut: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0; min-height: 100vh; color: var(--paper); font: 400 15px/1.5 "Exo 2", system-ui, sans-serif; font-weight: 300;
  background:
    repeating-linear-gradient(0deg, rgba(148,171,249,.035) 0 1px, transparent 1px 3px),
    radial-gradient(900px 520px at 50% -8%, rgba(143,75,255,.20), transparent 70%),
    radial-gradient(700px 500px at 100% 100%, rgba(89,0,255,.14), transparent 70%),
    var(--night);
}
main { max-width: 760px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.top h1 { margin: 0; flex: 1; font-weight: 300; font-size: 15px; letter-spacing: .5em; text-transform: uppercase; }
.top h1 i { font-style: normal; color: var(--accent); letter-spacing: .5em; }
.mark { width: 18px; height: 18px; background:
  linear-gradient(var(--accent), var(--accent)) 8px 0 / 2px 18px no-repeat,
  linear-gradient(var(--accent), var(--accent)) 0 8px / 18px 2px no-repeat; opacity: .9; }

/* A frame with two corners cut and a hairline: the outer element is the line, the inner the panel. */
.cut { --c: var(--cut); padding: 1px; background: var(--line);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); }
.cut > .in { background: var(--panel); padding: 18px;
  clip-path: polygon(calc(var(--c) - .4px) 0, 100% 0, 100% calc(100% - var(--c) + .4px), calc(100% - var(--c) + .4px) 100%, 0 100%, 0 calc(var(--c) - .4px)); }
.cut.lit { background: var(--accent); }

label { display: block; margin-bottom: 8px; color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: .32em; }
input { width: 100%; padding: 12px 14px; color: var(--paper); background: var(--night); border: 1px solid var(--line); border-radius: 0;
  font: 300 22px "Exo 2", sans-serif; letter-spacing: .3em; outline: none; }
input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
#key { font-size: 14px; letter-spacing: .04em; }
button { margin-top: 14px; padding: 12px 22px; color: var(--paper); background: var(--panel2); border: 1px solid var(--accent); border-radius: 0;
  font: 500 13px "Exo 2", sans-serif; letter-spacing: .34em; cursor: pointer; }
button:hover { background: var(--accent); }
button:focus-visible { outline: 2px solid var(--peri); outline-offset: 2px; }
button.ghost { margin: 0; padding: 7px 12px; background: transparent; border-color: var(--line); color: var(--muted); font-size: 11px; }
button.ghost:hover { border-color: var(--accent); color: var(--paper); background: transparent; }
button.small { margin-top: 28px; }

.msg { min-height: 1.4em; margin: 14px 0 0; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .26em; }
.msg.bad { color: var(--red); }
.note { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

/* The last two weeks: a bar a night, the two stops as lines. */
.week { position: relative; display: flex; align-items: flex-end; gap: 5px; height: 104px; margin-bottom: 26px; padding: 0 2px 16px;
  border-bottom: 1px solid var(--line); }
.week .stop { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed; pointer-events: none; }
.week .stop b { position: absolute; right: 0; top: -15px; font: 500 9px "Exo 2"; letter-spacing: .2em; }
.week .bar { position: relative; flex: 1; min-width: 6px; background: var(--peri); opacity: .85; }
.week .bar.soft { background: var(--accent); opacity: 1; }
.week .bar.hard { background: var(--red); opacity: 1; }
.week .bar span { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); color: var(--muted); font: 500 9px "Exo 2"; letter-spacing: .1em; }

.night { margin-bottom: 18px; }
.night .head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.night h2 { margin: 0; flex: 1; font-weight: 300; font-size: 13px; letter-spacing: .34em; }
.night .big { font-weight: 300; font-size: 44px; line-height: 1; letter-spacing: .02em; color: var(--paper); font-variant-numeric: tabular-nums; }
.night .big.soft { color: var(--accent); }
.night .big.hard { color: var(--red); }
.night .big small { margin-left: 8px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .3em; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 12px 0 4px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .24em; }
.stats b { color: var(--paper); font-weight: 500; letter-spacing: .08em; }

.chart { display: block; width: 100%; height: auto; margin-top: 8px; }
.chart .area { fill: rgba(143,75,255,.30); stroke: var(--accent); stroke-width: 1.5; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .soft { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 4; opacity: .8; }
.chart .hard { stroke: var(--red); stroke-width: 1; stroke-dasharray: 3 4; opacity: .9; }
.chart text { fill: var(--muted); font: 500 9px "Exo 2", sans-serif; letter-spacing: .14em; }
.chart .tick { stroke: var(--peri); stroke-width: 1; }

.doses { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.doses li { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 8px; background: var(--night); border: 1px solid var(--line);
  font-size: 11px; font-weight: 500; letter-spacing: .18em; color: var(--muted); }
.doses li b { color: var(--paper); font-weight: 500; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.doses svg { width: 22px; height: 22px; flex: none; }

@media (max-width: 420px) { .night .big { font-size: 38px; } .cut > .in { padding: 14px; } }
@media (prefers-reduced-motion: no-preference) { .bar { transition: opacity .2s; } .bar:hover { opacity: 1; } }
