@font-face {
  font-family: "Dited";
  src: url("../fonts/Dited/Dited.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Marny";
  src: url("../fonts/marny-font/MarnyRegular-lg3GX.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --page-bg: #111111;
  --panel-bg: linear-gradient(180deg, #001e38 0%, #001830 100%);
  --panel-stroke: #0a6fb8;
  --panel-inner-stroke: rgba(108, 189, 255, 0.14);
  --line: rgba(145, 211, 255, 0.18);
  --text-main: #d8efff;
  --text-soft: #b8def9;
  --button-bg: #10375a;
  --button-border: #498fcb;
  --button-active-border: #78c0ff;
  --paper: #f3eee5;
  --paper-edge: #e8dfd1;
  --paper-ink: #223a53;
  --paper-meta: #a89d90;
  --paper-line: #d0c2b1;
  --paper-accent: #84b7e8;
  --barcode: #b0a08f;
  --printer-shell: #072646;
  --printer-shell-edge: #2f6894;
  --printer-slot: #021326;
  --printer-led-idle: #79c9ff;
  --printer-led-active: #ff7ca8;
  --printer-heart: #ff96b9;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--page-bg);
  color: var(--text-main);
  font-family: "IBM Plex Mono", monospace;
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 10px 18px;
  display: grid;
  place-items: start center;
}

.panel {
  width: min(100%, 810px);
  margin-top: 0;
  border-radius: 18px;
  border: 1.5px solid var(--panel-stroke);
  background: var(--panel-bg);
  box-shadow:
    inset 0 0 0 1px var(--panel-inner-stroke),
    0 0 0 1px rgba(0, 56, 96, 0.35),
    0 10px 40px rgba(0, 0, 0, 0.32);
  padding: 20px 22px 22px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.terminal-dots span:nth-child(1) {
  background: #5ed2ff;
}
.terminal-dots span:nth-child(2) {
  background: #8cf5ff;
}
.terminal-dots span:nth-child(3) {
  background: #b0d8ff;
}

.terminal-title {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #92d7ff;
}

.divider {
  margin: 14px 0 18px;
  height: 1px;
  background: var(--line);
}

.intro-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(122, 186, 236, 0.34);
  border-radius: 12px;
  background: linear-gradient(
    165deg,
    rgba(8, 45, 79, 0.56),
    rgba(6, 30, 54, 0.3)
  );
  box-shadow: inset 0 0 0 1px rgba(187, 226, 255, 0.06);
}

.intro-copy {
  min-width: 0;
}

.intro-kicker {
  margin: 0 0 6px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: #8ccfff;
  text-transform: uppercase;
}

.intro-title {
  margin: 0;
  font-size: 1.18rem;
  color: #d8efff;
}

.intro-text {
  margin: 8px 0 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #bfe2fb;
  max-width: 58ch;
}

.notes-orb {
  --fill: 0deg;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, #042041 0%, #031631 74%);
  border: 4px solid rgba(62, 123, 175, 0.9);
  box-shadow: inset 0 0 0 1px rgba(143, 201, 244, 0.08);
  position: relative;
}

.notes-orb::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 2px dashed rgba(77, 138, 188, 0.55);
}

.notes-orb::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    rgba(120, 188, 236, 0.34) var(--fill),
    transparent 0deg
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 4px),
    #000 calc(100% - 3px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 4px),
    #000 calc(100% - 3px)
  );
}

.notes-orb-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-align: center;
  padding: 20px 10px;
}

.notes-orb-value {
  margin: 0;
  font-size: 2.05rem;
  line-height: 0.95;
  color: #83cbff;
  font-weight: 700;
  letter-spacing: 0;
}

.notes-orb-label {
  margin: 4px 0 0;
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-align: center;
  font-size: 0.55rem;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  color: #74c0f2;
  line-height: 1;
}

.notes-orb-label-line {
  display: block;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.category-btn {
  min-height: 50px;
  border-radius: 6px;
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: var(--text-main);
  padding: 11px 14px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.category-btn:hover {
  transform: translateY(-1px);
  border-color: #6eb6f7;
}

.category-btn.active {
  border-color: var(--button-active-border);
  box-shadow: inset 0 0 0 1px rgba(145, 211, 255, 0.12);
}

.category-emoji {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.category-emoji svg {
  width: 100%;
  height: 100%;
  display: block;
}

.category-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.category-copy small,
.category-copy strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #d8efff;
}

.category-copy small {
  color: #c3e7ff;
  line-height: 1;
}

.category-copy strong {
  line-height: 1.15;
}

.printer {
  margin-top: 16px;
  border: 1px solid var(--printer-shell-edge);
  border-radius: 12px;
  background: linear-gradient(180deg, #083157 0%, var(--printer-shell) 100%);
  box-shadow: inset 0 0 0 1px rgba(176, 220, 255, 0.08);
  overflow: hidden;
}

.printer-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(144, 204, 255, 0.2);
}

.printer-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--printer-led-idle);
  box-shadow: 0 0 12px rgba(121, 201, 255, 0.8);
}

.printer-status {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  color: #b8dcf6;
  text-transform: uppercase;
}

.printer-heart {
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--printer-heart);
  opacity: 0.75;
}

.printer-window {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: stretch;
  gap: 8px;
  height: 72px;
  padding: 8px;
  background: var(--printer-slot);
}

.ascii-heart {
  margin: 0;
  border-radius: 7px;
  border: 1px solid rgba(126, 189, 236, 0.38);
  background: linear-gradient(
    180deg,
    rgba(24, 52, 82, 0.9),
    rgba(8, 25, 44, 0.92)
  );
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-inline: 8px;
}

.heartbeat-trace {
  display: flex;
  width: max-content;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  color: rgba(255, 171, 199, 0.9);
  text-shadow: 0 0 10px rgba(255, 156, 188, 0.52);
  white-space: nowrap;
  animation: heartTrace 3200ms linear infinite;
}

.heartbeat-trace > span {
  flex: 0 0 auto;
  padding-right: 0;
}

.printer-rail {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    rgba(8, 29, 53, 0.7),
    rgba(5, 19, 36, 0.88)
  );
  border: 1px solid rgba(104, 170, 219, 0.28);
}

.printer-feed {
  position: absolute;
  inset: 0 0 0 0;
  background:
    radial-gradient(
        circle at 1px 50%,
        rgba(162, 220, 255, 0.4) 1.2px,
        transparent 1.4px
      )
      0 0/8px 100%,
    linear-gradient(
      180deg,
      rgba(177, 217, 245, 0.16),
      rgba(177, 217, 245, 0.02)
    );
  transform: translateY(-100%);
  opacity: 0;
}

.printer-head {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 92px;
  height: 44px;
  border-radius: 9px;
  background: linear-gradient(180deg, #c5ddf3 0%, #83accf 52%, #4f7597 100%);
  border: 1px solid rgba(214, 238, 255, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 2px 0 rgba(2, 15, 28, 0.5);
}

.printer-head::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  height: 4px;
  border-radius: 3px;
  background: rgba(6, 18, 33, 0.78);
}

.printer[data-state="printing"] .printer-led {
  background: var(--printer-led-active);
  box-shadow: 0 0 12px rgba(255, 124, 168, 0.88);
}

.printer[data-state="printing"] .printer-head {
  animation: headMoveRight 900ms cubic-bezier(0.35, 0.08, 0.22, 0.98) infinite
    alternate;
}

.printer[data-state="printing"] .printer-feed {
  opacity: 1;
  animation: feedMove 420ms linear infinite;
}

.printer[data-state="printing"] .printer-heart {
  animation: heartPulse 560ms ease-in-out infinite;
}

.printer[data-state="done"] .printer-heart {
  animation: heartPulse 380ms ease-in-out 1;
}

.note-card {
  margin-top: 20px;
}

.note-paper {
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 0;
  padding: 0 22px 0;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.note-paper::before,
.note-paper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 13px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 7px,
    rgba(213, 198, 182, 0.95) 7px 8px,
    transparent 8px 14px
  );
  z-index: 2;
}

.note-paper::before {
  top: 0;
}
.note-paper::after {
  bottom: 0;
}

.note-topline {
  height: 13px;
}

.note-body,
.note-separator,
.note-footer {
  position: relative;
  z-index: 3;
}

.note-body {
  padding: 26px 0 12px;
}

.note-body p {
  margin: 0;
  max-width: 690px;
  font-family: "Dited", "IBM Plex Serif", "Georgia", serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: -0.006em;
  font-style: normal;
}

.note-body.typing p {
  text-shadow: 0 0 7px rgba(137, 168, 198, 0.22);
}

.note-body.typing::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 2px;
  margin-left: 3px;
  vertical-align: middle;
  background: rgba(83, 114, 141, 0.7);
  animation: cursorBlink 620ms steps(1, end) infinite;
}

.note-separator {
  border-top: 1px dashed var(--paper-line);
}

.note-footer {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 22px;
}

.note-label {
  margin: 0;
  font-size: 0.78rem;
  color: #86a9c7;
  letter-spacing: 0.06em;
}

.note-signature {
  margin: 0 0 0 auto;
  font-family: "Marny", cursive;
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1;
  color: #6e8cab;
  letter-spacing: 0.01em;
  opacity: 0.95;
}

.another-note-btn {
  display: block;
  margin: 14px auto 0;
  min-width: 186px;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 11px;
  border: 1px solid rgba(110, 173, 221, 0.62);
  background: rgba(4, 17, 34, 0.42);
  color: #d8e8f6;
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.another-note-btn:hover {
  border-color: rgba(154, 209, 251, 0.9);
}

.note-card.printing .note-paper {
  animation: paperSlide 320ms cubic-bezier(0.2, 0.8, 0.25, 1);
}

@keyframes headMoveRight {
  0% {
    left: 8px;
  }
  100% {
    left: calc(100% - 100px);
  }
}

@keyframes feedMove {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

@keyframes heartPulse {
  0% {
    transform: scale(1);
    opacity: 0.74;
  }
  28% {
    transform: scale(1.18);
    opacity: 1;
  }
  45% {
    transform: scale(0.94);
  }
  65% {
    transform: scale(1.11);
  }
  100% {
    transform: scale(1);
    opacity: 0.78;
  }
}

@keyframes heartTrace {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes cursorBlink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes paperSlide {
  0% {
    transform: translateY(-7px);
    opacity: 0.75;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes orbSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 12px;
  }

  .panel {
    padding: 16px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .intro-panel {
    grid-template-columns: 1fr;
  }

  .notes-orb {
    width: 146px;
    height: 146px;
    justify-self: center;
  }

  .notes-orb-label {
    font-size: 0.66rem;
  }

  .note-paper {
    padding-inline: 16px;
  }

  .note-body p {
    font-size: clamp(1.55rem, 8vw, 2.25rem);
    line-height: 1.18;
  }

  .printer-window {
    grid-template-columns: 94px 1fr;
    height: 66px;
    padding: 7px;
  }

  .ascii-heart {
    font-size: 0.62rem;
  }

  .heartbeat-trace {
    font-size: 0.6rem;
  }

  .printer-head {
    width: 78px;
    height: 40px;
  }

  .note-footer {
    align-items: flex-end;
    min-height: 64px;
  }

  .note-label {
    font-size: 0.68rem;
  }

  .note-signature {
    font-size: 1.34rem;
  }

  .another-note-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notes-orb::before,
  .printer[data-state="printing"] .printer-head,
  .printer[data-state="printing"] .printer-feed,
  .printer[data-state="printing"] .printer-heart,
  .heartbeat-trace,
  .printer[data-state="done"] .printer-heart,
  .note-card.printing .note-paper,
  .note-body.typing::after {
    animation: none;
  }
}
