:root {
  color-scheme: dark;
  --bg: #101216;
  --bg-soft: #171a20;
  --panel: rgba(24, 28, 35, 0.74);
  --panel-strong: rgba(32, 37, 46, 0.92);
  --ink: #f7f3ea;
  --muted: #aab4bf;
  --line: rgba(255, 255, 255, 0.12);
  --green: #67d68d;
  --blue: #67b7ff;
  --coral: #ff8a7a;
  --gold: #f5c84b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(103, 214, 141, 0.16), transparent 28rem),
    radial-gradient(circle at 86% 16%, rgba(103, 183, 255, 0.16), transparent 26rem),
    radial-gradient(circle at 70% 92%, rgba(255, 138, 122, 0.12), transparent 27rem),
    linear-gradient(135deg, #0f1115 0%, #171b21 58%, #121418 100%);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), transparent 84%);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #101216;
  animation: splash-out 900ms ease 760ms forwards;
}

.splash-mark {
  display: grid;
  grid-template-columns: repeat(3, 18px);
  gap: 10px;
  filter: drop-shadow(0 18px 30px rgba(103, 214, 141, 0.22));
}

.splash-mark span {
  width: 18px;
  height: 64px;
  border-radius: 6px;
  background: var(--green);
  transform-origin: bottom;
  animation: splash-rise 680ms cubic-bezier(0.2, 0.8, 0.2, 1) infinite alternate;
}

.splash-mark span:nth-child(2) {
  background: var(--blue);
  animation-delay: 90ms;
}

.splash-mark span:nth-child(3) {
  background: var(--coral);
  animation-delay: 180ms;
}

.home-shell {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(12px, 1.25vw, 18px);
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: clamp(12px, 2vw, 26px);
}

.hero-panel,
.weather-panel,
.hardware-panel,
.section-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.026)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-panel {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1fr);
  gap: clamp(16px, 2vw, 30px);
  align-items: center;
  min-height: 0;
  padding: clamp(14px, 1.6vw, 22px);
  overflow: hidden;
}

.hero-panel::after {
  width: min(22vw, 240px);
  height: min(22vw, 240px);
  justify-self: end;
  align-self: start;
  margin: -10% -6% 0 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
  background:
    conic-gradient(from 150deg, rgba(103, 214, 141, 0.38), rgba(103, 183, 255, 0.38), rgba(255, 138, 122, 0.32), rgba(103, 214, 141, 0.38));
  filter: blur(1px);
  opacity: 0.26;
  grid-area: 1 / 2;
  animation: slow-spin 18s linear infinite;
}

.hero-copy,
.search-card {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.85rem, 2.65vw, 3rem);
  line-height: 1;
}

h2 {
  font-size: clamp(1.18rem, 1.4vw, 1.54rem);
  line-height: 1;
}

.hero-copy p:last-child {
  max-width: 58ch;
  margin-top: 7px;
  color: var(--muted);
  font-size: clamp(0.92rem, 0.9vw, 1rem);
}

.search-card {
  display: grid;
  gap: 9px;
}

.search-card label,
.add-form span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 10px;
}

.search-box input,
.add-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(12, 14, 18, 0.72);
  outline: none;
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease, background 170ms ease;
}

.search-box input:focus,
.add-form input:focus {
  border-color: rgba(103, 214, 141, 0.78);
  background: rgba(10, 13, 16, 0.94);
  box-shadow: 0 0 0 4px rgba(103, 214, 141, 0.12);
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease, filter 170ms ease;
}

button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

button:active {
  transform: translateY(0);
}

.search-box button,
.add-form button {
  border-color: rgba(103, 214, 141, 0.62);
  color: #07110c;
  background: linear-gradient(135deg, #7bed9c, #4fbd74);
  font-weight: 900;
}

.weather-panel,
.hardware-panel,
.section-block {
  display: grid;
  gap: 12px;
  padding: clamp(16px, 1.6vw, 22px);
}

.weather-panel {
  grid-column: span 7;
}

.hardware-panel {
  grid-column: span 5;
}

.shortcuts-panel {
  grid-column: span 4;
}

.links-panel,
.apps-panel {
  grid-column: span 4;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  color: #0c1217;
  background: var(--gold);
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1;
}

.weather-status,
.hardware-status {
  color: var(--muted);
  font-size: 0.94rem;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.weather-day {
  display: grid;
  gap: 7px;
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(10, 13, 16, 0.52);
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}

.weather-day:hover,
.link-tile:hover,
.app-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(103, 214, 141, 0.4);
  background: rgba(28, 34, 42, 0.86);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.3);
}

.weather-day strong {
  font-size: 0.92rem;
}

.weather-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 38px;
}

.weather-icon img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.28));
}

.weather-temp {
  font-size: 1.22rem;
  font-weight: 900;
}

.weather-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.hardware-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.hardware-card {
  display: grid;
  gap: 12px;
  min-height: 146px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(10, 13, 16, 0.52);
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}

.hardware-card:hover {
  transform: translateY(-4px);
  border-color: rgba(103, 183, 255, 0.42);
  background: rgba(28, 34, 42, 0.86);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.3);
}

.hardware-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hardware-card-head strong {
  font-size: 1.1rem;
}

.hardware-card-head span {
  border: 1px solid rgba(103, 214, 141, 0.26);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--green);
  background: rgba(103, 214, 141, 0.1);
  font-size: 0.75rem;
  font-weight: 900;
}

.hardware-card.is-offline .hardware-card-head span {
  border-color: rgba(255, 138, 122, 0.3);
  color: var(--coral);
  background: rgba(255, 138, 122, 0.1);
}

.hardware-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.hardware-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.hardware-stat {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.hardware-stat span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.hardware-stat strong {
  font-size: clamp(1.05rem, 2vw, 1.52rem);
  line-height: 1;
}

.hardware-stat i {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.hardware-stat i::before {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  content: "";
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.link-grid,
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
}

.link-tile,
.app-tile {
  position: relative;
  display: grid;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  color: var(--ink);
  background: rgba(10, 13, 16, 0.5);
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}

.tile-link {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  color: inherit;
  text-decoration: none;
}

.link-tile::before,
.app-tile::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: var(--green);
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.35rem;
  font-weight: 900;
  transition: transform 180ms ease, background 180ms ease;
}

.tile-icon img {
  width: 74%;
  height: 74%;
  object-fit: contain;
}

.tile-copy {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.tile-copy strong {
  font-size: 0.98rem;
  font-weight: 900;
}

.tile-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.link-tile:hover .tile-icon,
.app-tile:hover .tile-icon {
  transform: scale(1.06) rotate(-2deg);
  background: rgba(255, 255, 255, 0.11);
}

.accent-blue::before {
  background: var(--blue);
}

.accent-coral::before {
  background: var(--coral);
}

.accent-gold::before {
  background: var(--gold);
}

.accent-green::before {
  background: var(--green);
}

.remove-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 8px;
  padding: 0;
  opacity: 0;
}

.link-tile:hover .remove-button,
.app-tile:hover .remove-button,
.remove-button:focus-visible {
  opacity: 1;
}

.add-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(210px, 1.25fr) minmax(140px, 0.7fr) minmax(210px, 1fr) 84px;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(245, 200, 75, 0.2);
  border-radius: 8px;
  background: rgba(245, 200, 75, 0.06);
  animation: form-in 210ms ease both;
}

#linkForm {
  grid-template-columns: minmax(150px, 0.75fr) minmax(210px, 1.25fr) minmax(210px, 1fr) 84px;
}

.add-form label {
  display: grid;
  gap: 7px;
}

.icon-drop {
  min-width: 0;
}

.icon-drop > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon-drop-body {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(12, 14, 18, 0.52);
  cursor: pointer;
  transition: border-color 170ms ease, background 170ms ease, transform 170ms ease;
}

.icon-drop:hover .icon-drop-body,
.icon-drop.is-dragging .icon-drop-body {
  border-color: var(--gold);
  background: rgba(245, 200, 75, 0.1);
  transform: translateY(-2px);
}

.icon-drop.is-processing .icon-drop-body {
  opacity: 0.68;
}

.icon-preview {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  color: #101216;
  background: var(--gold);
  font-size: 1.2rem;
  font-weight: 900;
}

.icon-preview img {
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
}

.icon-drop-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.icon-drop-copy strong,
.icon-drop-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-drop-copy strong {
  font-size: 0.82rem;
}

.icon-drop-copy small {
  color: var(--muted);
  font-size: 0.74rem;
}

[hidden] {
  display: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal-up 620ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.reveal:nth-of-type(2) {
  animation-delay: 90ms;
}

.reveal:nth-of-type(3) {
  animation-delay: 170ms;
}

.reveal:nth-of-type(4) {
  animation-delay: 250ms;
}

.reveal:nth-of-type(5) {
  animation-delay: 330ms;
}

.reveal:nth-of-type(6) {
  animation-delay: 410ms;
}

@keyframes splash-rise {
  from {
    transform: scaleY(0.38);
  }

  to {
    transform: scaleY(1);
  }
}

@keyframes splash-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes reveal-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slow-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes form-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .home-shell {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .weather-panel,
  .hardware-panel,
  .shortcuts-panel,
  .links-panel,
  .apps-panel {
    grid-column: 1;
  }

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

  .hero-panel::after {
    grid-area: 1 / 1;
    width: 360px;
    height: 360px;
  }

  .search-box,
  .add-form,
  #linkForm {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .home-shell {
    padding: 10px;
  }

  .hero-panel,
  .weather-panel,
  .hardware-panel,
  .section-block {
    padding: 16px;
  }

  .hero-panel {
    min-height: 250px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .weather-grid {
    grid-template-columns: repeat(7, minmax(132px, 1fr));
  }

  .hardware-grid,
  .hardware-stats {
    grid-template-columns: 1fr 1fr;
  }
}

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