:root {
  color-scheme: light;
  --ink: #083b4a;
  --ink-soft: #315e68;
  --white: #ffffff;
  --brand: #1bb1c8;
  --glass: rgba(236, 250, 253, 0.41);
  --glass-strong: rgba(227, 248, 252, 0.58);
  --glass-border: rgba(255, 255, 255, 0.36);
  --glass-shadow: 0 14px 34px rgba(5, 68, 90, 0.13);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #a9d5e3;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.portal-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) max(34px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(34px, env(safe-area-inset-left));
  background-image: url("./assets/hoome-ice-background-full.jpg");
  background-position: center;
  background-size: cover;
}

.portal-shell::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(5, 70, 91, 0.18) 0%, rgba(245, 253, 255, 0.02) 42%, rgba(7, 72, 92, 0.16) 100%);
  pointer-events: none;
}

.portal-header,
.portal-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tile-copy small,
.portal-footer {
  font-weight: 600;
  letter-spacing: 1.4px;
}

.portal-header {
  justify-content: flex-end;
  min-height: 44px;
}

.account-state {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  background: rgba(231, 249, 253, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.account-state svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.portal-content {
  display: flex;
  width: min(960px, 100%);
  flex-direction: column;
  justify-content: flex-start;
  margin: 0 auto;
  padding: 110px 0 38px;
}

.portal-title-block {
  display: flex;
  justify-content: center;
  margin-bottom: 56px;
  text-align: center;
}

.portal-logo {
  display: block;
  width: 620px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 7px 24px rgba(4, 53, 69, 0.26));
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}

.system-tile {
  position: relative;
  display: flex;
  min-height: 108px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), var(--glass-shadow);
  transition: transform 320ms var(--ease-spring), background 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  backdrop-filter: blur(30px) saturate(145%);
  -webkit-backdrop-filter: blur(30px) saturate(145%);
}

.system-tile::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(112deg, transparent 28%, rgba(255, 255, 255, 0.42) 49%, transparent 70%);
  opacity: 0;
  transform: translateX(-80%);
  transition: opacity 180ms ease, transform 450ms ease;
  pointer-events: none;
}

.system-tile:hover,
.system-tile:focus-visible {
  border-color: rgba(255, 255, 255, 0.6);
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 20px 44px rgba(5, 65, 85, 0.18);
  outline: none;
  transform: translateY(-5px);
}

.system-tile:hover::before,
.system-tile:focus-visible::before {
  opacity: 1;
  transform: translateX(80%);
}

.system-tile:active {
  transform: translateY(-1px) scale(0.96);
  transition-duration: 180ms;
}

.system-tile-primary {
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.46);
}

.tile-copy {
  display: grid;
  min-width: 0;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.tile-copy strong {
  display: inline-block;
  color: var(--ink);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: 2px;
  line-height: 30px;
}

.tile-copy small {
  display: inline-block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-footer {
  color: rgba(255, 255, 255, 0.76);
  font-size: 9px;
  line-height: 14px;
  text-shadow: 0 2px 10px rgba(3, 47, 62, 0.28);
}

@media (max-width: 900px) {
  .portal-shell {
    overflow: auto;
    padding-right: 22px;
    padding-left: 22px;
  }

  .portal-content {
    justify-content: flex-start;
    padding-top: 62px;
  }

  .system-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .system-tile {
    min-height: 98px;
    padding: 22px;
  }
}

@media (max-width: 560px) {
  .portal-shell {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    background-position: 57% center;
  }

  .portal-footer span:last-child {
    display: none;
  }

  .account-state {
    max-width: 130px;
    min-height: 40px;
    padding: 0 11px;
  }

  .account-state span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .portal-content {
    padding: 48px 0 34px;
  }

  .portal-title-block {
    margin-bottom: 34px;
  }

  .portal-logo {
    width: 300px;
  }

  .system-grid {
    gap: 12px;
  }

  .system-tile {
    min-height: 96px;
    padding: 18px;
  }

  .tile-copy strong {
    font-size: 22px;
    line-height: 28px;
  }
}

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