
:root {
  --bg: #10131a;
  --ink: #e0e0e0;
  --card: #181c24;
  --accent: #00ffae;
  --accent-2: #00bfff;
  --line: #22242a;
  --muted: #7fffd4;
  --shadow: 0 8px 32px rgba(0,255,174,0.08);
  --hacker-green: #00ffae;
  --hacker-blue: #00bfff;
  --hacker-bg: #10131a;
}

* {
  box-sizing: border-box;
}


html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--hacker-bg);
  color: var(--ink);
}


body {
  font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Monaco', monospace;
  letter-spacing: 0.01em;
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}


.background-shape {
  position: absolute;
  border-radius: 999px;
  filter: blur(1.2px);
  opacity: 0.18;
  pointer-events: none;
}

.shape-a {
  width: 32vw;
  height: 32vw;
  background: linear-gradient(135deg, var(--hacker-green), transparent 80%);
  left: -10vw;
  top: -14vw;
}

.shape-b {
  width: 28vw;
  height: 28vw;
  background: linear-gradient(225deg, var(--hacker-blue), transparent 80%);
  right: -10vw;
  bottom: -12vw;
}

.main-title-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.2rem 2.2rem 0.2rem 2.2rem;
  background: transparent;
  z-index: 10;
}
.main-title-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}
.rotato-title-img {
  display: block;
  margin: 0 auto;
}

.footer {
  width: 100vw;
  text-align: center;
  color: var(--hacker-blue);
  font-size: 1.05rem;
  margin: 0;
  padding: 0.55rem 0 0.75rem;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 3;
}
.footer a {
  color: var(--hacker-green);
  text-decoration: underline;
  font-weight: 600;
}

.rotato-title-img {
  height: 3.2rem;
  max-width: 60vw;
  filter: drop-shadow(0 2px 12px #00ffae44);
}

.contact-btn {
  background: linear-gradient(90deg, var(--hacker-green), var(--hacker-blue));
  color: #10131a;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px #00ffae22;
  transition: filter 0.15s, box-shadow 0.15s;
}
.contact-btn:hover, .contact-btn:focus-visible {
  filter: brightness(1.15);
  box-shadow: 0 4px 16px #00ffae44;
}

.layout {
  position: relative;
  z-index: 2;
  height: auto;
  min-height: 0;
  align-self: stretch;
  padding: clamp(0.75rem, 2vw, 1.3rem);
  display: grid;
  gap: clamp(0.75rem, 1.2vw, 1rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}


.panel {
  background: linear-gradient(170deg, rgba(24,28,36,0.98), rgba(16,19,26,0.96));
  border: 2px solid var(--hacker-blue);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: visible;
  animation: rise-in 500ms cubic-bezier(.7,1.6,.5,1) both;
}

.layout .panel:first-child {
  z-index: 5;
}

.panel:nth-child(2) {
  animation-delay: 120ms;
}

.panel:nth-child(3) {
  animation-delay: 220ms;
}

@keyframes rise-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}


.panel-header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: 0.01em;
  color: var(--hacker-green);
  font-family: inherit;
  text-shadow: 0 2px 8px #00ffae33;
}


.panel-header p {
  margin: 0.35rem 0 0.9rem;
  color: var(--hacker-blue);
  font-size: 0.97rem;
  font-family: inherit;
}

.docs-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 0;
  overflow: visible;
  padding-right: 0.2rem;
  position: relative;
}


.doc-card {
  border-radius: 12px;
  border: 1.5px solid var(--hacker-blue);
  background: linear-gradient(120deg, #181c24 80%, #10131a 100%);
  text-decoration: none;
  color: var(--hacker-green);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.3rem;
  text-align: center;
  padding: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  position: relative;
  z-index: 1;
  transition: transform 140ms, box-shadow 140ms, border-color 140ms;
}
.doc-card:hover,
.doc-card:focus-visible {
  transform: translateY(-3px);
  z-index: 20;
  box-shadow: 0 6px 18px #00ffae33;
  border-color: var(--hacker-green);
  outline: none;
}

.modal[hidden] {
  display: none !important;
}


.doc-icon {
  font-size: 1.5rem;
  color: var(--hacker-blue);
}


.doc-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--hacker-green);
}


.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hacker-green), var(--hacker-blue));
  color: #10131a;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.7rem;
  font-family: inherit;
  font-size: 1.05rem;
  transition: filter 0.15s, box-shadow 0.15s;
}
.primary-button:hover,
.primary-button:focus-visible {
  filter: brightness(1.12);
  box-shadow: 0 2px 12px #00ffae44;
  outline: none;
}
/* Modal Styles */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 1;
}
.modal-content {
  position: relative;
  z-index: 2;
  width: min(460px, 96vw);
  background: linear-gradient(180deg, #1a1f2a 0%, #151a24 100%);
  border: 1px solid rgba(0, 191, 255, 0.24);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 191, 255, 0.1);
  padding: 1.8rem;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 1.1rem;
  background: none;
  border: none;
  color: var(--hacker-blue);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.modal-close:hover {
  color: var(--hacker-green);
}

.doc-img-blur {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  width: 100%;
}

.doc-img-blur-img {
  width: 100%;
  max-width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
  display: block;
}
.modal-content h2 {
  margin: 0;
  color: #7ad8ff;
  font-family: inherit;
  font-size: 1.9rem;
  font-weight: 800;
}
.modal-subtitle {
  margin: 0.4rem 0 1.2rem;
  color: #96a3b8;
  font-size: 0.97rem;
}
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.modal-field {
  display: flex;
  flex-direction: column;
}

.modal-content label {
  display: block;
  margin: 0;
  color: #cfd8e6;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
}
.modal-content input,
.modal-content textarea {
  width: 100%;
  display: block;
  margin-top: 0.35rem;
  margin-bottom: 0;
  border-radius: 11px;
  border: 1px solid rgba(0, 191, 255, 0.2);
  background: #0f141d;
  color: #eaf1ff;
  font-family: inherit;
  font-size: 0.98rem;
  padding: 0.72rem 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.modal-content input:focus,
.modal-content textarea:focus {
  border-color: #00bfff;
  box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.2);
}
.modal-send {
  width: 100%;
  margin-top: 0.45rem;
  background: linear-gradient(135deg, #00ff87 0%, #60efff 100%);
  color: #08101c;
  border: none;
  border-radius: 11px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  padding: 0.82rem 1.2rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 255, 135, 0.24);
  transition: transform 0.12s, filter 0.15s, box-shadow 0.15s;
}
.modal-send:hover, .modal-send:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 12px 24px rgba(0, 255, 135, 0.3);
}
.modal-success {
  color: #9afec8;
  font-size: 1rem;
  text-align: center;
  margin: 1.2rem 0 0.4rem;
}

.modal-success-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 0.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0, 255, 135, 0.18);
  border: 1px solid rgba(0, 255, 135, 0.35);
  color: #6effb3;
  font-size: 1.4rem;
  font-weight: 900;
}

.modal-success-sub {
  margin-top: 0.35rem;
  color: #9ca8bc;
  font-size: 0.92rem;
}

.modal-error {
  margin: 0 0 0.7rem;
  padding: 0.62rem 0.75rem;
  border: 1px solid rgba(255, 107, 129, 0.45);
  border-radius: 10px;
  color: #ff9aa8;
  background: rgba(255, 107, 129, 0.08);
  font-size: 0.88rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.firmware-version {
  margin: 0.65rem 0 0.3rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.firmware-body {
  min-height: 0;
  overflow: auto;
  padding-right: 0.2rem;
}

.firmware-body h2 {
  font-size: 1rem;
  margin: 0.8rem 0 0.45rem;
  color: #d7ecff;
}

.firmware-body ol,
.comment-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #c9d9ee;
}

.firmware-body ol li,
.comment-list li {
  color: #c9d9ee;
}

.comment-list strong {
  color: #8fdcff;
}

.comment-list {
  list-style: square;
}

.comment-list li {
  margin-bottom: 0.45rem;
}

.warning {
  border: 1px solid #edc07f;
  background: #fff0d8;
  color: #6a3d00;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
}

.serial-controls {
  display: grid;
  grid-template-columns: auto repeat(4, auto);
  gap: 0.35rem;
  align-items: center;
  width: 100%;
}

.serial-controls select,
.serial-controls button {
  border-radius: 8px;
  border: 1px solid #b8a183;
  padding: 0.38rem 0.48rem;
  font-size: 0.8rem;
  background: #fff;
  white-space: nowrap;
  min-width: fit-content;
}

.serial-controls select {
  max-width: 120px;
}

.serial-controls button {
  background: #143a5d;
  color: #fff;
  border-color: #143a5d;
  font-weight: 600;
}

.serial-controls button:disabled {
  background: #9ca3af;
  border-color: #9ca3af;
  cursor: not-allowed;
}

.serial-log {
  margin: 0.72rem 0 1.2rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 12px;
  border: 1px solid #3c4c67;
  background: #0f1728;
  color: #dbe5ff;
  padding: 0.75rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Consolas", "Lucida Console", monospace;
  font-size: 0.82rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--card);
}
.serial-log::-webkit-scrollbar {
  width: 6px;
}
.serial-log::-webkit-scrollbar-track {
  background: var(--card);
  border-radius: 3px;
}
.serial-log::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
  opacity: 0.7;
}
.serial-log::-webkit-scrollbar-thumb:hover {
  background: var(--accent-2);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: repeat(3, minmax(300px, 1fr));
    overflow-x: auto;
    overflow-y: hidden;
  }

  .footer {
    padding-bottom: 0.7rem;
  }

  .serial-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .serial-controls label {
    grid-column: span 2;
  }
}
