:root {
  --pink: #f38ba8;
  --mauve: #cba6f7;
  --peach: #fab387;
  --teal: #94e2d5;
  --text: #cdd6f4;
  --subtext: #a6adc8;
  --base: #1e1e2e;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background:
    radial-gradient(820px 460px at 88% 0%, rgba(243, 139, 168, 0.22), transparent 62%),
    radial-gradient(680px 520px at 0% 100%, rgba(203, 166, 247, 0.18), transparent 68%),
    radial-gradient(480px 320px at 72% 100%, rgba(148, 226, 213, 0.1), transparent 70%),
    var(--base);
  color: var(--text);
  font-family: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 400;
}

body::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--pink) 0 34%,
    var(--mauve) 0 67%,
    var(--peach) 0 100%
  );
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 420px);
  gap: clamp(1.8rem, 5vw, 4.5rem);
  align-items: center;
  width: min(1040px, calc(100% - 2.6rem));
  margin: 0 auto;
  padding: clamp(2.2rem, 6vh, 4.2rem) 0 1.2rem;
}

.intro,
.portrait {
  animation: rise 0.7s ease both;
}

.portrait {
  animation-delay: 0.12s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--mauve);
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(2.7rem, 12vw, 6.6rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

h1 span {
  color: var(--pink);
}

.chill {
  margin: 1rem 0 0;
  color: var(--peach);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 400;
}

blockquote {
  margin: 2rem 0 0;
  padding: 1.15rem 0 0.15rem 1.15rem;
  border-left: 3px solid var(--pink);
  max-width: 34rem;
}

blockquote p {
  margin: 0;
  color: var(--text);
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 560;
  font-variation-settings: "opsz" 72, "SOFT" 40;
  letter-spacing: -0.02em;
  line-height: 1.28;
}

blockquote footer {
  margin-top: 0.95rem;
}

blockquote cite {
  color: var(--teal);
  font-family: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 560;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portrait {
  margin: 0;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(205, 214, 244, 0.16);
  border-radius: 1.35rem;
  box-shadow:
    0 0 0 6px rgba(243, 139, 168, 0.16),
    0 28px 60px rgba(17, 17, 27, 0.45);
  background: #313244;
  animation: halo 4.8s ease-in-out infinite;
}

@keyframes halo {
  50% {
    box-shadow:
      0 0 0 9px rgba(203, 166, 247, 0.22),
      0 28px 60px rgba(17, 17, 27, 0.45);
  }
}

.portrait figcaption {
  margin-top: 0.75rem;
  color: var(--subtext);
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.16em;
  text-align: right;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  main,
  .panel,
  .notes {
    width: min(560px, calc(100% - 1.4rem));
  }

  main {
    grid-template-columns: 1fr;
    padding-top: 1.4rem;
    padding-bottom: 0.4rem;
  }

  h1 {
    font-size: clamp(2.55rem, 11.4vw, 4.4rem);
  }

  .portrait {
    max-width: 100%;
  }

  .portrait figcaption {
    text-align: left;
  }

  blockquote p {
    font-size: 1.35rem;
  }
}

.panel,
.notes {
  width: min(1040px, calc(100% - 2.6rem));
  margin: 0 auto;
}

.panel { padding-bottom: 0.4rem; }
.notes { padding-bottom: max(2.5rem, env(safe-area-inset-bottom)); }

.panel h2,
.notes h2 {
  margin: 0 0 0.7rem;
  color: var(--mauve);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.7fr);
  gap: 0.9rem;
  align-items: stretch;
}

.screen {
  overflow: hidden;
  border: 1px solid rgba(205, 214, 244, 0.14);
  border-radius: 1.15rem;
  background: #11111b;
  animation: rise 0.7s ease 0.12s both;
}

.bezel {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  background: #181825;
  color: var(--subtext);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lights {
  display: flex;
  gap: 0.35rem;
}

.lights i {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
}

.lights i:nth-child(1) { background: var(--pink); }
.lights i:nth-child(2) { background: var(--peach); }
.lights i:nth-child(3) { background: #a6e3a1; }

.bezel span:nth-child(2) {
  color: var(--pink);
}

.live {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  color: #a6e3a1;
}

.pulse {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #a6e3a1;
  box-shadow: 0 0 0 0 rgba(166, 227, 161, 0.6);
  animation: ping 1.8s ease-out infinite;
}

@keyframes ping {
  70% {
    box-shadow: 0 0 0 7px rgba(166, 227, 161, 0);
  }
}

.display {
  padding: 1.15rem 1rem 0.35rem;
  text-align: center;
}

.host {
  margin: 0;
  color: var(--pink);
  font-size: clamp(3.4rem, 12vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.85;
  animation: shimmer 3.4s ease-in-out infinite;
}

@keyframes shimmer {
  50% {
    color: var(--mauve);
    text-shadow: 0 0 22px rgba(203, 166, 247, 0.45);
  }
}

.host-sub,
.readout {
  margin: 0.55rem 0 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.host-sub {
  color: var(--teal);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.bits {
  display: flex;
  justify-content: center;
  gap: 0.38rem;
  margin-top: 0.95rem;
}

.bits i {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #313244;
  animation: bit 1.3s ease-in-out infinite;
  animation-delay: calc(sibling-index() * 0.08s);
}

.bits i:nth-child(3n) { background: var(--pink); }
.bits i:nth-child(3n + 1) { background: var(--teal); }
.bits i:nth-child(3n + 2) { background: var(--peach); }

@keyframes bit {
  50% { transform: translateY(-4px) scale(0.7); opacity: 0.45; }
}

.screen.is-hot .bits i {
  animation-duration: 0.45s;
}

.readout {
  min-height: 2.8rem;
  color: var(--text);
  font-size: clamp(0.95rem, 3.4vw, 1.05rem);
}

.readout.pop {
  animation: pop 0.35s ease;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.8rem;
}

.keys button,
#note-form button,
.note-card button {
  touch-action: manipulation;
  cursor: pointer;
}

.keys button {
  min-height: 48px;
  border: 0;
  border-radius: 0.8rem;
  background: #313244;
  color: var(--text);
  font: 650 0.95rem/1 "Outfit", sans-serif;
}

.keys button:active,
.keys button.is-on {
  background: var(--pink);
  color: #11111b;
  transform: translateY(1px);
}

#note-form {
  display: grid;
  gap: 0.7rem;
}

#note-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--subtext);
  font-size: 0.75rem;
  font-weight: 560;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#note-form input,
#note-form textarea {
  width: 100%;
  border: 1px solid rgba(205, 214, 244, 0.16);
  border-radius: 0.85rem;
  background: #181825;
  color: var(--text);
  font: 400 1rem/1.45 "Outfit", sans-serif;
  padding: 0.8rem 0.85rem;
}

#note-form textarea {
  min-height: 6.2rem;
  resize: vertical;
}

#note-form button {
  justify-self: start;
  min-height: 48px;
  padding: 0 1.3rem;
  border: 0;
  border-radius: 999px;
  background: var(--pink);
  color: #11111b;
  font: 700 1rem/1 "Outfit", sans-serif;
}

#note-form button:active {
  transform: translateY(1px);
}

.hint,
.empty {
  color: var(--subtext);
  font-size: 0.9rem;
}

#note-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-card {
  padding: 0.85rem 0.95rem 0.75rem;
  border-radius: 0.95rem;
  background: rgba(49, 50, 68, 0.78);
  animation: rise 0.35s ease;
}

.note-card strong {
  color: var(--peach);
  font-size: 0.95rem;
}

.note-card p {
  margin: 0.3rem 0 0;
  line-height: 1.4;
}

.note-card button {
  margin-top: 0.45rem;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  color: var(--mauve);
  font: 650 0.8rem/1 "Outfit", sans-serif;
}

.gauges {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gauges li {
  padding: 0.75rem 0.85rem 0.8rem;
  border: 1px solid rgba(205, 214, 244, 0.12);
  border-radius: 0.9rem;
  background: rgba(49, 50, 68, 0.72);
  animation: rise 0.7s ease both;
}

.gauges li:nth-child(2) { animation-delay: 0.08s; }
.gauges li:nth-child(3) { animation-delay: 0.14s; }
.gauges li:nth-child(4) { animation-delay: 0.2s; }

.gauges span {
  display: block;
  color: var(--subtext);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gauges strong {
  display: block;
  margin: 0.2rem 0 0.45rem;
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.15rem;
  font-weight: 600;
}

.gauges i {
  display: block;
  height: 0.38rem;
  overflow: hidden;
  border-radius: 999px;
  background: #313244;
}

.gauges b {
  display: block;
  width: calc(var(--level, 40) * 1%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--mauve));
  animation: fill 1s ease both;
}

.gauges li:nth-child(2) b { background: linear-gradient(90deg, var(--teal), var(--mauve)); }
.gauges li:nth-child(3) b { background: linear-gradient(90deg, var(--peach), var(--pink)); }
.gauges li:nth-child(4) b { background: linear-gradient(90deg, #a6e3a1, var(--teal)); }

@keyframes fill {
  from { width: 0; }
}

@media (max-width: 820px) {
  .panel,
  .notes {
    width: min(560px, calc(100% - 1.4rem));
  }

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

  .keys,
  .gauges {
    grid-template-columns: 1fr 1fr;
  }

  .host {
    font-size: clamp(3.3rem, 18vw, 4.8rem);
  }

  #note-form button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
  }
}
