/* === Material You Design Tokens === */
:root {
  --md-primary: #0062A1;
  --md-on-primary: #FFFFFF;
  --md-primary-container: #CFE5FF;
  --md-on-primary-container: #001D36;
  --md-surface: #F8FAFE;
  --md-on-surface: #1A1C1E;
  --md-surface-variant: #E2E7EF;
  --md-on-surface-variant: #44474E;
  --md-outline-variant: rgba(0, 98, 161, 0.10);
  --md-radius-lg: 24px;
  --md-radius-xl: 28px;
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  min-height: 100vh;
  background: var(--md-surface);
  color: var(--md-on-surface);
  font-family: 'Noto Sans SC', system-ui, sans-serif;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* === Animated Background === */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  will-change: transform;
}
.orb-1 { width: 420px; height: 420px; background: #C2DDF7; top: -100px; left: -80px; }
.orb-2 { width: 300px; height: 300px; background: #A8CBF0; top: 60px; right: -40px; }
.orb-3 { width: 260px; height: 260px; background: #D6ECF5; bottom: 40px; left: 22%; opacity: 0.38; }
.orb-4 { width: 200px; height: 200px; background: #B8D8F5; bottom: -50px; right: 8%; opacity: 0.32; }

.ripple-ring {
  position: fixed;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 98, 161, 0.13);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  animation: rippleOut 1.6s cubic-bezier(0.2, 0, 0, 1) forwards;
  z-index: 9998;
}
@keyframes rippleOut {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* === Layout === */
.container {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 44px;
  flex: 1;
  width: 100%;
}

/* === Header === */
.header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  animation: fadeUp 0.55s cubic-bezier(0.2, 0, 0, 1) both;
}

.site-icon {
  width: 28px;
  height: 28px;
  background: var(--md-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.site-icon svg { fill: #fff; }

.site-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--md-primary);
  letter-spacing: 0.2px;
}

/* === Greeting Card === */
.greeting-card {
  background: var(--md-primary-container);
  border-radius: var(--md-radius-xl);
  padding: 40px 36px 36px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.6s cubic-bezier(0.2, 0, 0, 1) 0.05s both;
}
.greeting-card::before {
  content: '';
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(0, 98, 161, 0.06);
  top: -70px; right: -50px;
}
.greeting-card::after {
  content: '';
  position: absolute;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(0, 98, 161, 0.04);
  bottom: -50px; left: -30px;
}

.greeting-text {
  font-size: 48px;
  font-weight: 500;
  color: var(--md-on-primary-container);
  line-height: 1.15;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 1;
}

.greeting-sub {
  font-size: 14px;
  color: var(--md-on-surface-variant);
  margin-top: 8px;
  font-weight: 400;
  position: relative;
  z-index: 1;
  min-height: 20px;
  transition: opacity 0.4s ease;
}
.greeting-sub.loading { opacity: 0.4; }

/* === Cards Grid === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

/* === Card === */
.card {
  border-radius: var(--md-radius-lg);
  padding: 24px 22px 20px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--md-outline-variant);
  background: var(--md-primary-container);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1),
              box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1),
              background 0.25s ease;
  animation: fadeUp 0.5s cubic-bezier(0.2, 0, 0, 1) both;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 98, 161, 0.13);
  background: #C2D9F7;
}
.card:active { transform: translateY(0); box-shadow: none; }

/* Top indicator bar */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: calc(100% - 20px);
  height: 3px;
  background: var(--md-primary);
  border-radius: 0 0 3px 3px;
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1);
  z-index: 2;
}
.card:hover::before { transform: translateX(-50%) scaleX(1); }

/* Image background card */
.card.image-bg {
  background-size: cover;
  background-position: center;
  border-color: transparent;
}
.card.image-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg,
    rgba(0, 29, 54, 0.86) 0%,
    rgba(0, 29, 54, 0.35) 60%,
    rgba(0, 29, 54, 0.10) 100%);
  border-radius: inherit;
  z-index: 1;
}
.card.image-bg .card-inner { position: relative; z-index: 2; }
.card.image-bg .card-title  { color: #fff; }
.card.image-bg .card-desc   { color: rgba(255, 255, 255, 0.82); }

.card-inner { position: relative; z-index: 1; }

.card-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--md-on-primary-container);
  margin-bottom: 6px;
  line-height: 1.3;
}

.card-desc {
  font-size: 13px;
  color: var(--md-on-surface-variant);
  line-height: 1.65;
  font-weight: 400;
}

/* === Error State === */
.error-state {
  background: var(--md-primary-container);
  border-radius: var(--md-radius-lg);
  padding: 48px 24px;
  text-align: center;
  grid-column: 1 / -1;
  color: var(--md-on-surface-variant);
  font-size: 14px;
}

/* === Footer === */
footer {
  position: relative;
  z-index: 1;
  background: var(--md-surface-variant);
  border-radius: 24px 24px 0 0;
  padding: 28px 24px 24px;
  text-align: center;
}
.footer-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-on-surface);
  margin-bottom: 4px;
}
.footer-copy { font-size: 12px; color: #74777F; }

/* === Animations === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card:nth-child(1) { animation-delay: 0.08s; }
.card:nth-child(2) { animation-delay: 0.14s; }
.card:nth-child(3) { animation-delay: 0.20s; }
.card:nth-child(4) { animation-delay: 0.26s; }
.card:nth-child(5) { animation-delay: 0.32s; }
.card:nth-child(6) { animation-delay: 0.38s; }
.card:nth-child(7) { animation-delay: 0.44s; }
.card:nth-child(8) { animation-delay: 0.50s; }

/* === Responsive === */
@media (max-width: 768px) {
  .container { padding: 32px 20px 36px; }
  .greeting-card { padding: 32px 24px 28px; }
  .greeting-text { font-size: 36px; }
  .cards-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media (max-width: 480px) {
  .container { padding: 24px 16px 28px; }
  .greeting-text { font-size: 2rem; }
  .cards-grid { grid-template-columns: 1fr; gap: 12px; }
  .card { min-height: 140px; padding: 20px 18px 16px; }
}