/* LU4 shared base styles */

:root {
  --bg: #212121;
  --surface: #303030;
  --surface-muted: #262626;
  --surface-raised: #363636;
  --border: #3c3c3c;
  --text: #ffffff;
  --text-muted: #aeaeae;
  --accent: #33ffa7;
  --accent-strong: #90ffd2;
  --accent-soft: rgba(51, 255, 167, 0.12);
  --link: #33ffa7;
  --link-hover: #90ffd2;
  --header-bg: #212121;
  --header-text: #ffffff;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Consolas", monospace;
  --max: 44rem;
  --wide: 70rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(51, 255, 167, 0.035), rgba(51, 255, 167, 0) 18rem),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0, rgba(255, 255, 255, 0.018) 1px, transparent 1px, transparent 18px),
    var(--bg);
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover);
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--header-bg);
  color: var(--header-text);
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 1.35rem 0 1.45rem;
  border-bottom: 1px solid #2d2d2d;
  box-shadow: none;
}

.site-header__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  position: relative;
}

.site-header--dashboard .site-header__inner,
.site-header--guide .site-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
}

.site-header__brand {
  min-width: 0;
}

.site-header__tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.site-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.8rem, 4.2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

.site-header .tagline {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.88;
  font-weight: 400;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-header .eyebrow {
  color: var(--accent);
}

.site-header .tagline.tagline--qq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(7.5rem, 11vw, 10rem);
  height: clamp(6.5rem, 9vw, 8.5rem);
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  color: rgba(51, 255, 167, 0.9);
  text-decoration: none;
  transition: color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.site-header .tagline.tagline--qq:hover {
  color: var(--accent-strong);
  opacity: 1;
  transform: translateY(-1px) scale(1.02);
}

.site-header .tagline.tagline--qq::before {
  content: "";
  width: 100%;
  height: 100%;
  display: block;
  background: currentColor;
  -webkit-mask: url("Hedgehog in New Pants.svg") center / contain no-repeat;
  mask: url("Hedgehog in New Pants.svg") center / contain no-repeat;
}

.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.layout--wide {
  max-width: var(--wide);
}

.section {
  margin-bottom: 2rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.65rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.18rem, 3vw, 1.45rem);
  line-height: 1.25;
}

.section-heading .eyebrow {
  margin-bottom: 0.2rem;
}

.button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.58rem 0.9rem;
  border: 1px solid rgba(51, 255, 167, 0.34);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  line-height: 1;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.button:hover {
  color: var(--accent-strong);
  background: #2a5545;
}

.button--primary {
  background: #1f3d32;
  border-color: var(--accent);
  color: var(--accent);
}

.button--primary:hover {
  background: #2a5545;
  color: var(--accent-strong);
}

.button--ghost {
  background: transparent;
}

.resource-tile {
  position: relative;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.resource-tile__flag {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.7rem;
  padding: 0.14rem 0.68rem;
  border: 1px solid rgba(255, 240, 120, 0.42);
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 250, 170, 0.92), rgba(255, 212, 67, 0.98) 56%, rgba(255, 150, 0, 0.98) 100%);
  color: #3a1d00;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.34),
    0 0 0 2px rgba(255, 188, 46, 0.18),
    0 0 18px rgba(255, 214, 92, 0.2);
  transform: rotate(6deg);
}

.resource-tile__flag::before {
  content: "!";
  position: absolute;
  top: -0.32rem;
  right: -0.24rem;
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ff3f1f;
  color: #fff7ea;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(255, 63, 31, 0.32);
}

.resource-tile__flag::after {
  content: "";
  position: absolute;
  inset: -0.22rem;
  border-radius: 999px;
  border: 1px dashed rgba(255, 218, 110, 0.34);
  opacity: 0.9;
}

.resource-tile--local h4 {
  padding-right: 6.2rem;
}

.resource-tile h3,
.resource-tile h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  line-height: 1.35;
}

.resource-tile h4 {
  font-weight: 700;
}

.resource-tile p {
  margin: 0 0 0.7rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.resource-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.resource-groups {
  display: grid;
  gap: 1rem;
}

.resource-group {
  min-width: 0;
}

.resource-group > h3 {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.resource-board--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.inline-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  text-decoration: none;
  font-weight: 700;
}

.resource-tile--wide {
  grid-column: span 2;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1rem 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.page-hint {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 6.6rem);
  z-index: 140;
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.72rem 0.95rem;
  border: 1px solid rgba(51, 255, 167, 0.22);
  border-radius: 12px;
  background: rgba(24, 24, 24, 0.94);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.6rem);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.page-hint.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .resource-board {
    grid-template-columns: 1fr 1fr;
  }

  .resource-tile--wide {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .site-header--dashboard .site-header__inner,
  .site-header--guide .site-header__inner {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .site-header__brand {
    padding-right: 4.6rem;
  }

  .site-header__tools {
    position: absolute;
    top: 0;
    right: max(1rem, env(safe-area-inset-right));
    align-items: flex-end;
    width: auto;
    gap: 0.4rem;
  }

  .site-header .tagline.tagline--qq {
    width: 3.1rem;
    height: 3.1rem;
  }
}

@media (max-width: 620px) {
  .section-heading {
    display: block;
  }

  .resource-board {
    grid-template-columns: 1fr;
  }

  .resource-tile--wide {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .site-header__brand {
    padding-right: 3.9rem;
  }

  .site-header .tagline.tagline--qq {
    width: 2.7rem;
    height: 2.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
