@font-face {
  font-family: "HAM Sans";
  src: url("/fonts/manrope-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "HAM Sans";
  src: url("/fonts/manrope-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --night: #070906;
  --night-raised: #0d100b;
  --night-control: #12160f;
  --phosphor: #c9ff38;
  --phosphor-strong: #dcff7a;
  --phosphor-dim: #6f8e25;
  --paper: #f2f6e9;
  --text-secondary: #b7c0ac;
  --text-tertiary: #87917d;
  --text-muted: #626a5c;
  --line: rgba(231, 255, 188, 0.11);
  --line-strong: rgba(201, 255, 56, 0.34);
  --danger: #ff8b78;
  --focus: #efffc5;
  --space: 4px;
  --radius-control: 10px;
  --radius-panel: 18px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--night);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: "HAM Sans", "Arial Nova", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--phosphor);
  color: var(--night);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: calc(var(--space) * 3);
  color: var(--paper);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand strong {
  color: var(--phosphor);
  font-weight: 800;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: var(--phosphor);
}

.brand-mark::before {
  width: 4px;
  height: 4px;
  box-shadow: 0 0 12px rgba(201, 255, 56, 0.8);
}

.brand-mark::after {
  width: 12px;
  height: 1px;
  background: var(--phosphor-dim);
}

.brand-mark span {
  width: 1px;
  height: 12px;
  background: var(--phosphor-dim);
}

.eyebrow {
  display: flex;
  align-items: center;
  margin: 0 0 calc(var(--space) * 4);
  gap: calc(var(--space) * 2);
  color: var(--phosphor);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 12px rgba(201, 255, 56, 0.7);
}

.login-page {
  overflow-x: hidden;
}

.login-header {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(100% - 48px, 1440px);
  min-height: 88px;
  margin: 0 auto;
  align-items: center;
}

.login-main {
  position: relative;
  display: grid;
  min-height: calc(100vh - 88px);
  place-items: center;
  padding: 56px 24px 112px;
  isolation: isolate;
}

.signal-field {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: min(78vw, 920px);
  aspect-ratio: 1;
  transform: translate(-50%, -48%);
  pointer-events: none;
}

.signal-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(201, 255, 56, 0.07);
  border-radius: 50%;
}

.signal-ring--two {
  inset: 18%;
  border-color: rgba(201, 255, 56, 0.1);
}

.signal-ring--three {
  inset: 36%;
  border-color: rgba(201, 255, 56, 0.16);
}

.signal-field::before,
.signal-field::after {
  position: absolute;
  content: "";
  background: rgba(201, 255, 56, 0.07);
}

.signal-field::before {
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
}

.signal-field::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.login-panel {
  width: min(100%, 432px);
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: rgba(13, 16, 11, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.login-panel h1 {
  margin: 0 0 12px;
  font-size: clamp(36px, 6vw, 48px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1;
  text-wrap: balance;
}

.login-copy {
  margin: 0 0 32px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
  text-wrap: pretty;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label,
.entry-form label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.password-control {
  position: relative;
}

.password-control input,
.entry-form input,
.entry-form textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--night-control);
  color: var(--paper);
  outline: none;
  transition:
    border-color 160ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.password-control input {
  padding: 0 56px 0 16px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.16em;
}

.password-control input::placeholder {
  color: var(--text-muted);
}

.password-control input:focus,
.entry-form input:focus,
.entry-form textarea:focus {
  border-color: var(--phosphor-dim);
  box-shadow: 0 0 0 3px rgba(201, 255, 56, 0.1);
}

.reveal-button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.reveal-button span {
  display: block;
  width: 18px;
  height: 11px;
  border: 1px solid var(--text-tertiary);
  border-radius: 50%;
}

.reveal-button span::after {
  display: block;
  width: 4px;
  height: 4px;
  margin: 2px auto 0;
  border-radius: 50%;
  background: var(--text-tertiary);
  content: "";
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition:
    background-color 160ms cubic-bezier(0.23, 1, 0.32, 1),
    color 160ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

.primary-button {
  width: 100%;
  margin-top: 8px;
  padding: 0 10px 0 18px;
  border: 1px solid var(--phosphor);
  background: var(--phosphor);
  color: #111509;
}

.primary-button:hover {
  background: var(--phosphor-strong);
}

.primary-button:active,
.secondary-button:active,
.dialog-close:active {
  transform: scale(0.97);
}

.primary-button:disabled {
  border-color: var(--line);
  background: var(--night-control);
  color: var(--text-muted);
  cursor: not-allowed;
}

.button-arrow {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: rgba(7, 9, 6, 0.12);
  font-size: 17px;
}

.login-footnote {
  display: flex;
  margin-top: 24px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
}

.lock-mini {
  position: relative;
  display: block;
  width: 10px;
  height: 8px;
  border: 1px solid var(--text-muted);
  border-radius: 2px;
}

.lock-mini::before {
  position: absolute;
  bottom: 6px;
  left: 1px;
  width: 6px;
  height: 5px;
  border: 1px solid var(--text-muted);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  content: "";
}

.form-message {
  margin: -12px 0 20px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 139, 120, 0.25);
  border-radius: var(--radius-control);
  color: var(--danger);
  font-size: 13px;
}

.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  width: min(100% - 64px, 1440px);
  min-height: 88px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.dialog-close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color 160ms cubic-bezier(0.23, 1, 0.32, 1),
    color 160ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

.dialog-close:hover {
  border-color: var(--line-strong);
  color: var(--paper);
}

.journal-main {
  width: min(100% - 64px, 1160px);
  margin: 0 auto;
  padding: 96px 0 120px;
}

.journal-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 96px;
  align-items: end;
  padding-bottom: 88px;
}

.journal-intro h1 {
  margin: 0;
  font-size: clamp(64px, 9vw, 124px);
  font-weight: 600;
  letter-spacing: -0.075em;
  line-height: 0.83;
  text-wrap: balance;
}

.journal-intro h1 span {
  color: var(--phosphor);
}

.journal-summary dl {
  display: grid;
  margin: 0 0 28px;
  grid-template-columns: 1fr 1fr 1.35fr;
}

.journal-summary dl div {
  min-width: 0;
  padding: 16px 12px 16px 0;
}

.journal-summary dt {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.journal-summary dd {
  margin: 4px 0 0;
  color: var(--paper);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.journal-summary .summary-date {
  font-size: 14px;
  line-height: 2.35;
}

.primary-button--compact {
  width: 100%;
  max-width: 250px;
  margin: 0;
}

.day-entry {
  display: grid;
  grid-template-columns: 132px 32px minmax(0, 1fr);
}

.day-date {
  padding: 48px 16px 48px 0;
}

.day-number {
  display: block;
  color: var(--paper);
  font-size: 48px;
  font-variant-numeric: tabular-nums;
  font-weight: 520;
  letter-spacing: -0.05em;
  line-height: 1;
}

.day-month {
  display: block;
  margin-top: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.day-rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.day-rail::before {
  width: 1px;
  height: 100%;
  background: var(--line);
  content: "";
}

.rail-node {
  position: absolute;
  top: 58px;
  left: 50%;
  width: 7px;
  height: 7px;
  border: 2px solid var(--night);
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 1px var(--line-strong);
  transform: translateX(-50%);
}

.day-entry--latest .rail-node {
  background: var(--phosphor);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 0 18px rgba(201, 255, 56, 0.7);
}

.day-content {
  padding: 48px 0 56px 32px;
}

.day-heading {
  display: flex;
  margin-bottom: 24px;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.day-heading h2 {
  margin: 0;
  color: var(--paper);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.day-heading > span {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.work-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 8px;
  list-style: none;
}

.work-list li {
  display: grid;
  min-height: 76px;
  padding: 16px 18px;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--night-raised);
  transition:
    border-color 180ms cubic-bezier(0.23, 1, 0.32, 1),
    background-color 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.work-list li:hover {
  border-color: var(--line);
  background: var(--night-control);
}

.work-index {
  color: var(--phosphor-dim);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.work-list p {
  margin: 0;
  color: var(--paper);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}

.work-check {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--phosphor);
  font-size: 12px;
}

.empty-state {
  display: grid;
  min-height: 420px;
  padding: 72px 24px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-signal {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.empty-signal::before {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  content: "";
}

.empty-signal span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 14px rgba(201, 255, 56, 0.8);
}

.empty-label {
  margin: 0 0 8px;
  color: var(--phosphor);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.empty-state h2 {
  max-width: 600px;
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.05;
  text-wrap: balance;
}

.empty-state > p:not(.empty-label) {
  max-width: 480px;
  margin: 16px 0 28px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.secondary-button {
  min-width: 210px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--paper);
}

.secondary-button:hover {
  background: var(--night-control);
}

.toast {
  position: fixed;
  z-index: 5;
  top: 104px;
  left: 50%;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--night-control);
  color: var(--phosphor-strong);
  font-size: 13px;
  transform: translateX(-50%);
  animation: toast-in 220ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
}

.entry-dialog {
  width: min(calc(100% - 32px), 520px);
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--night-raised);
  color: var(--paper);
  box-shadow: 0 24px 100px rgba(0, 0, 0, 0.55);
}

.entry-dialog::backdrop {
  background: rgba(3, 5, 3, 0.78);
  backdrop-filter: blur(8px);
}

.entry-dialog[open] {
  animation: dialog-in 220ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
}

.entry-form {
  display: grid;
  padding: 32px;
  gap: 10px;
}

.dialog-header {
  display: flex;
  margin-bottom: 4px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.dialog-header .eyebrow {
  margin-bottom: 8px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.045em;
}

.dialog-close {
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.dialog-hint {
  margin: 0 0 10px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.entry-form input {
  padding: 0 14px;
  color-scheme: dark;
}

.entry-form textarea {
  min-height: 128px;
  padding: 14px;
  resize: vertical;
}

.entry-form label:not(:first-of-type) {
  margin-top: 8px;
}

.character-count {
  color: var(--text-muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  text-align: right;
}

.error-main {
  display: grid;
  min-height: calc(100vh - 88px);
  padding: 48px 24px 112px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.error-code {
  margin: 0;
  color: var(--phosphor);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
}

.error-main h1 {
  margin: 12px 0;
  font-size: clamp(42px, 8vw, 78px);
  font-weight: 600;
  letter-spacing: -0.065em;
}

.error-main > p:not(.error-code) {
  margin: 0 0 28px;
  color: var(--text-tertiary);
}

.link-button {
  width: auto;
  min-width: 220px;
  gap: 24px;
}

@media (max-width: 820px) {
  .journal-main {
    padding-top: 64px;
  }

  .journal-intro {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-bottom: 64px;
  }

  .journal-summary {
    max-width: 520px;
  }

  .day-entry {
    grid-template-columns: 92px 24px minmax(0, 1fr);
  }

  .day-content {
    padding-left: 20px;
  }
}

@media (max-width: 580px) {
  .login-header,
  .topbar,
  .journal-main {
    width: min(100% - 32px, 1440px);
  }

  .login-header,
  .topbar {
    min-height: 72px;
  }

  .login-main {
    min-height: calc(100vh - 72px);
    padding: 32px 16px 72px;
  }

  .login-panel {
    padding: 28px 24px;
  }

  .signal-field {
    width: 150vw;
  }

  .journal-main {
    padding: 56px 0 80px;
  }

  .journal-intro h1 {
    font-size: clamp(60px, 19vw, 84px);
  }

  .journal-summary dl {
    grid-template-columns: 1fr 1fr;
  }

  .journal-summary dl div:last-child {
    grid-column: 1 / -1;
    padding-top: 0;
  }

  .journal-summary .summary-date {
    line-height: 1.4;
  }

  .primary-button--compact {
    max-width: none;
  }

  .day-entry {
    grid-template-columns: 62px 18px minmax(0, 1fr);
  }

  .day-date {
    padding-top: 40px;
  }

  .day-number {
    font-size: 36px;
  }

  .day-month {
    overflow: hidden;
    max-width: 58px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rail-node {
    top: 48px;
  }

  .day-content {
    padding: 40px 0 48px 12px;
  }

  .day-heading {
    display: block;
    margin-bottom: 16px;
  }

  .day-heading > span {
    display: block;
    margin-top: 4px;
  }

  .work-list li {
    min-height: 68px;
    padding: 14px;
    grid-template-columns: minmax(0, 1fr) 26px;
    gap: 12px;
  }

  .work-index {
    display: none;
  }

  .work-list p {
    font-size: 14px;
  }

  .entry-form {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
