@font-face {
	font-family: "Terminus";
	src: url("Terminus.woff2") format("woff2");
}

:root {
  --bg:            #060f0a;
  --surface:       #0c1b12;
  --surface-2:     #11261a;
  --grid-line:     #143421;
  --green-deep:    #1f7a4c;
  --green-bright:  #5dffa0;
  --text-dim:      #6f9e82;
  --text-bright:   #eafff1;

  --font-display: 'Courier', monospace;
  --font-mono:    'Terminus', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text-bright);
  font-family: var(--font-mono);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  position: relative;
  overflow-x: hidden;
}

/* ambient circuit grid */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.35;
  mask-image: radial-gradient(circle at 50% 35%, rgba(0,0,0,0.9) 0%, transparent 75%);
}

/* CRT scanlines */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(93, 255, 160, 0.035) 0px,
    rgba(93, 255, 160, 0.035) 1px,
    transparent 2px,
    transparent 3px
  );
}

.terminal {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--green-deep);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(93,255,160,0.05), 0 30px 80px -20px rgba(0,0,0,0.8), 0 0 60px -10px rgba(93,255,160,0.08);
  overflow: hidden;
}

.titlebar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--grid-line);
  padding: 10px 16px;
}

.titlebar-text {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.terminal-body {
  padding: 36px 32px 28px;
  text-align: center;
}

.boot-log {
  text-align: left;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 0 0 28px;
}

.boot-log .ok {
  color: var(--green-bright);
}

.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.hat-logo {
  width: 120px;
  height: 120px;
}

.tip-glow {
  animation: pulse 2.4s ease-in-out infinite;
}

.brand {
  font-family: var(--font-display);
  font-size: 52px;
  letter-spacing: 0.08em;
  color: var(--green-bright);
  text-shadow: 0 0 12px rgba(93,255,160,0.55), 0 0 30px rgba(93,255,160,0.25);
  margin: 4px 0 10px;
  line-height: 1;
}

.tagline {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 30px;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  margin-left: 4px;
  background: var(--green-bright);
  vertical-align: -2px;
  animation: blink 1.1s step-start infinite;
}

.divider {
  text-align: left;
  font-size: 13px;
  color: var(--text-dim);
  border-top: 1px dashed var(--grid-line);
  padding-top: 18px;
  margin-bottom: 16px;
}

.portal-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  text-align: left;
}

.portal-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--text-bright);
  background: var(--surface-2);
  border: 1px solid var(--grid-line);
  border-radius: 4px;
  padding: 16px 18px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.portal-link:hover,
.portal-link:focus-visible {
  border-color: var(--green-bright);
  background: #142a1c;
  transform: translateX(2px);
}

.portal-link:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 2px;
}

.portal-head {
  font-size: 17px;
  font-weight: 700;
}

.bracket {
  color: var(--text-dim);
}

.portal-name {
  color: var(--green-bright);
}

.portal-desc {
  font-size: 13px;
  color: var(--text-dim);
}

.portal-url {
  font-size: 12px;
  color: var(--green-deep);
}

.status-line {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 8px var(--green-bright);
  animation: pulse 2.4s ease-in-out infinite;
}

.footer-line {
  border-top: 1px solid var(--grid-line);
  background: var(--surface-2);
  padding: 14px 16px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (max-width: 480px) {
  .brand {
    font-size: 40px;
  }
  .terminal-body {
    padding: 28px 20px 22px;
  }
  .hat-logo {
    width: 96px;
    height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor,
  .tip-glow,
  .dot {
    animation: none;
  }
}

.radio-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--green-bright);
  background: var(--green-deep);
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}
.radio-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--green-bright);
  border-radius: 2px;
  color: var(--green-bright);
  cursor: pointer;
  padding: 0;
}
.radio-toggle:hover {
  background: var(--green-bright);
  color: var(--green-deep);
}
.radio-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
}
.radio-name {
  font-size: 0.85rem;
  color: var(--green-bright);
}
.radio-status {
  font-size: 0.7rem;
  opacity: 0.7;
  text-transform: lowercase;
}
.radio-volume {
  width: 70px;
  accent-color: var(--green-bright);
  flex: 0 0 auto;
}
.radio-sleep {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--green-bright);
  border-radius: 2px;
  color: var(--green-bright);
  font-family: inherit;
  font-size: 0.65rem;
  line-height: 1;
  padding: 0.35rem 0.4rem;
  cursor: pointer;
  opacity: 0.7;
  white-space: nowrap;
}
.radio-sleep:hover {
  opacity: 1;
}
.radio-sleep.active {
  background: var(--green-bright);
  color: var(--green-deep);
  opacity: 1;
}
