/* The Journal as a ledger: Onyx's widget layout, dressed in Nocturne's palette. */
.lg { --up: #3ddc97; --down: #ff5c6c; --lg-s1: linear-gradient(180deg, #0d0d10, #070708); padding-bottom: 40px; }
.lg .up { color: var(--up); } .lg .down { color: var(--down); }
.lg-mono { font: 500 11px/1.4 'IBM Plex Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lg-intro { padding-bottom: 50px; }
.lg-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.lg-chip { font: 500 10.5px/1 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 999px; white-space: nowrap; }
.lg-chip:nth-child(2) { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

.lg-seg { position: relative; display: inline-flex; padding: 4px; border: 1px solid var(--line-strong); border-radius: 999px; background: #0c0c0f; margin-bottom: 18px; }
.lg-seg button { position: relative; z-index: 1; padding: 9px 18px; border: 0; background: none; border-radius: 999px; font-size: 14px; color: var(--muted); cursor: pointer; transition: color .3s; }
.lg-seg button[aria-pressed=true] { color: #0b0a12; }
.lg-seg > i { position: absolute; top: 4px; bottom: 4px; left: 0; width: var(--sw, 0); transform: translateX(var(--sx, 0)); border-radius: 999px; background: var(--accent); transition: transform .5s var(--ease-out), width .5s var(--ease-out); }

.lg-w { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--lg-s1); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); transition: border-color .35s ease; }
.lg-w:hover { border-color: var(--line-strong); }
.lg-w > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lg-w > p { color: var(--muted); font-size: 13.5px; margin: 0; }

.lg-kpis { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--lg-s1); margin-bottom: 12px; }
.lg-kpi { display: grid; gap: 10px; padding: 22px 22px 24px; border-right: 1px solid var(--line); }
.lg-kpi:last-child { border-right: 0; }
.lg-kpi strong { font-size: clamp(24px, 2.4vw, 34px); font-weight: 500; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.lg-kpi small { font-size: .55em; color: var(--muted); letter-spacing: 0; }

.lg-curve { margin-bottom: 12px; }
.lg-chart { position: relative; height: clamp(220px, 30vw, 380px); margin: 14px 0 6px; cursor: crosshair; touch-action: pan-y; }
.lg-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.lg-base { stroke: rgba(255,255,255,.2); stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.lg-line { fill: none; stroke: var(--accent); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-dasharray: 4 4; }
.motion-ok .lg-line { stroke-dashoffset: 4; transition: stroke-dashoffset 2.4s var(--ease-out) .25s; }
.motion-ok .lg-area { opacity: 0; transition: opacity 1.4s ease 1s; }
.motion-ok .in .lg-line { stroke-dashoffset: 0; } .motion-ok .in .lg-area { opacity: 1; }
.lg-cross { position: absolute; inset: 0; pointer-events: none; }
.lg-cross[hidden] { display: none; }
.lg-cross::before { content: ''; position: absolute; top: 0; bottom: 0; left: var(--x); width: 1px; background: rgba(255,255,255,.18); }
.lg-cross i { position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #070708; border: 1.5px solid var(--accent); }
.lg-cross span, .lg-cells i[data-tip]:hover::after, .lg-daybars i:hover::after { font: 500 11px/1 'IBM Plex Mono', monospace; white-space: nowrap; padding: 8px 10px; border-radius: 8px; background: #16161b; border: 1px solid var(--line-strong); color: var(--text); pointer-events: none; }
.lg-cross span { position: absolute; left: var(--x); top: 0; transform: translateX(12px); }
.lg-cross.flip span { transform: translateX(calc(-100% - 12px)); }

.lg-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.lg-daily { grid-column: span 12; }
.lg-daybars { display: flex; align-items: center; gap: 4px; height: 200px; margin-top: 10px; }
.lg-daybars i { position: relative; flex: 1; height: 50%; display: flex; }
.lg-daybars i::before { content: ''; position: absolute; left: 0; right: 0; height: calc(var(--h) * 100%); border-radius: 3px; transition: opacity .2s, transform 1s var(--ease-out); }
.lg-daybars i.up { align-self: flex-start; } .lg-daybars i.up::before { bottom: 0; background: var(--up); transform-origin: bottom; }
.lg-daybars i.down { align-self: flex-end; } .lg-daybars i.down::before { top: 0; background: var(--down); transform-origin: top; }
.lg-daybars:hover i::before { opacity: .35; } .lg-daybars i:hover::before { opacity: 1; }
.lg-daybars i:hover::after { content: attr(data-tip); position: absolute; left: 50%; top: -30px; transform: translateX(-50%); z-index: 5; }
.lg-daybars i.down:hover::after { top: auto; bottom: -30px; }
.motion-ok .lg-daybars i::before { transform: scaleY(0); } .motion-ok .in .lg-daybars i::before { transform: none; }

.lg-cal { grid-column: span 6; }
.lg-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.lg-legend i { width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.lg-legend i.up { background: var(--up); } .lg-legend i.down { background: var(--down); }
.lg-calendar { display: flex; gap: 26px; margin: 12px 0 4px; flex-wrap: wrap; }
.lg-month { display: grid; gap: 10px; }
.lg-month > span { font-size: 12.5px; color: var(--muted); }
.lg-cells { display: grid; grid-template-rows: repeat(5, 22px); grid-auto-flow: column; grid-auto-columns: 22px; gap: 6px; }
.lg-cells i { grid-row: var(--row); position: relative; border-radius: 5px; background: rgba(255,255,255,.05); outline: 1px solid transparent; outline-offset: 2px; transition: transform .2s ease, outline-color .2s; }
.lg-cells i.up { background: color-mix(in srgb, var(--up) calc(var(--a) * 100%), rgba(255,255,255,.05)); }
.lg-cells i.down { background: color-mix(in srgb, var(--down) calc(var(--a) * 100%), rgba(255,255,255,.05)); }
.lg-cells i:hover { transform: scale(1.15); outline-color: rgba(255,255,255,.55); z-index: 2; }
.lg-cells i[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 5; }

.lg-week, .lg-hist { grid-column: span 3; }
.lg-week ul { list-style: none; padding: 0; display: grid; gap: 12px; margin: 10px 0 auto; }
.lg-week li { display: grid; grid-template-columns: 34px 1fr 64px; gap: 10px; align-items: center; font-size: 13.5px; }
.lg-week b { font: 500 12px 'IBM Plex Mono', monospace; text-align: right; }
.lg-div { position: relative; height: 8px; background: rgba(255,255,255,.04); border-radius: 99px; }
.lg-div::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: rgba(255,255,255,.2); }
.lg-div i { position: absolute; top: 0; bottom: 0; width: calc(var(--v) * 50%); border-radius: 99px; }
.lg-div i.up { left: 50%; background: var(--up); transform-origin: left; }
.lg-div i.down { right: 50%; background: var(--down); transform-origin: right; }
.lg-histo { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; height: 170px; margin: 10px 0 auto; }
.lg-histo div { display: grid; grid-template-rows: auto 1fr auto; height: 100%; gap: 6px; text-align: center; }
.lg-histo i { align-self: end; height: calc(var(--h) * 100%); min-height: 2px; border-radius: 4px 4px 2px 2px; background: var(--up); opacity: .85; transform-origin: bottom; transition: transform 1.2s var(--ease-out); }
.lg-histo i.down { background: var(--down); }
.lg-histo span, .lg-histo small { font: 500 10.5px 'IBM Plex Mono', monospace; color: var(--faint); }
.lg-histo span { color: var(--muted); }
.motion-ok .lg-histo i { transform: scaleY(0); } .motion-ok .in .lg-histo i { transform: none; }

.lg-subhead { display: grid; gap: 14px; margin: 110px 0 34px; }
.lg-subhead h2 { font-size: clamp(32px, 4vw, 56px); letter-spacing: -.05em; line-height: 1; }
.lg-subhead p { max-width: 520px; }
.lg-stats .lg-ring, .lg-stats .lg-pf { grid-column: span 3; }
.lg-stats .lg-range { grid-column: span 6; }
.lg-ring-box { position: relative; width: 100%; max-width: 132px; aspect-ratio: 1; margin: 8px auto 0; display: grid; place-items: center; }
.lg-ring-box svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.lg-ring-box circle { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 5; }
.lg-ring-box .lg-ring-val { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: var(--val) var(--len); }
.motion-ok .lg-ring-val { stroke-dasharray: 0 var(--len); transition: stroke-dasharray 1.8s var(--ease-out) .3s; }
.motion-ok .in .lg-ring-val { stroke-dasharray: var(--val) var(--len); }
.lg-ring-box strong { font-size: 26px; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.lg-ring > p { text-align: center; }
.lg-mid { font-size: clamp(40px, 3.6vw, 56px); font-weight: 500; letter-spacing: -.05em; line-height: 1; margin: 20px 0 auto; font-variant-numeric: tabular-nums; }
.lg-meter { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.lg-meter i { display: block; height: 100%; width: calc(var(--v) * 100%); background: var(--accent); border-radius: inherit; transform-origin: left; }
.lg-scale { display: flex; justify-content: space-between; font: 500 10px 'IBM Plex Mono', monospace; color: var(--faint); }
.lg-bars { display: grid; gap: 22px; margin: 16px 0 auto; }
.lg-bars div { display: grid; gap: 10px; }
.lg-bars strong { font-size: clamp(28px, 2.6vw, 40px); font-weight: 500; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.lg-bars i { display: block; height: 6px; border-radius: 99px; width: calc(var(--v) * 100%); background: var(--up); transform-origin: left; }
.lg-bars i.down { background: var(--down); }
.motion-ok .lg-meter i, .motion-ok .lg-bars i, .motion-ok .lg-div i { transform: scaleX(0); transition: transform 1.6s var(--ease-out) .35s; }
.motion-ok .in .lg-meter i, .motion-ok .in .lg-bars i, .motion-ok .in .lg-div i { transform: scaleX(1); }

.lg-log { margin-top: 12px; }
.lg-log-scroll { max-height: 420px; overflow-y: auto; margin-top: 8px; scrollbar-width: thin; scrollbar-color: #222 transparent; }
.lg-log table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.lg-log th { position: sticky; top: 0; background: #0b0b0e; text-align: left; font: 500 10.5px 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 10px 0; border-bottom: 1px solid var(--line); }
.lg-log td { padding: 11px 0; border-bottom: 1px solid var(--line); color: #b4b4bc; }
.lg-log th:not(:first-child), .lg-log td:not(:first-child) { text-align: right; }
.lg-log tr:hover td { color: var(--text); }
.lg-log td.up { color: var(--up); } .lg-log td.down { color: var(--down); }
.lg .journal-demo-note { margin-top: 26px; }

@media (max-width: 1180px) {
  .lg-cal { grid-column: span 12; }
  .lg-week, .lg-hist { grid-column: span 6; }
  .lg-kpis { grid-template-columns: repeat(3, 1fr); }
  .lg-kpi:nth-child(3) { border-right: 0; }
  .lg-kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .lg-w { padding: 20px; }
  .lg-grid { gap: 10px; }
  .lg-week, .lg-hist, .lg-stats .lg-range { grid-column: span 12; }
  .lg-stats .lg-ring, .lg-stats .lg-pf { grid-column: span 6; }
  .lg-kpis { grid-template-columns: repeat(2, 1fr); }
  .lg-kpi { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); padding: 18px; }
  .lg-kpi:nth-child(2n) { border-right: 0 !important; }
  .lg-kpi:nth-last-child(-n+2) { border-bottom: 0; }
  .lg-daybars { gap: 2px; height: 150px; }
  .lg-cells { grid-template-rows: repeat(5, 18px); grid-auto-columns: 18px; gap: 5px; }
  .lg-seg button { padding: 9px 14px; }
}

/* The portrait stays black and white until you look at it. */
.about-portrait img { filter: grayscale(1) contrast(1.05) brightness(.94); transition: filter .9s ease; }
.about-portrait:hover img, .about-portrait:active img { filter: grayscale(0) contrast(1.02); }
