/* Design Read: developer welcome hub, blue-teal zyyo language + tech grid */
/* DESIGN_VARIANCE: 7 | MOTION: 5 | VISUAL_DENSITY: 3 */

body[data-page="welcome"] {
  min-height: 100vh;
  overflow-x: hidden;
}

.is-hidden {
  display: none !important;
}

body[data-page="welcome"] .welcome-filter {
  opacity: 0.35;
}

.welcome-tech-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(135deg, #dbeafe 0%, #f0f9ff 42%, #ecfeff 100%);
  transition: background 0.45s ease;
}

html[data-theme="Dark"] .welcome-tech-bg {
  background: linear-gradient(145deg, #06080c 0%, #101820 38%, #0a0e14 72%, #121a24 100%);
}

.welcome-grid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.welcome-tech-grid {
  display: none;
}

.welcome-tech-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}

.welcome-tech-orb--a {
  width: min(420px, 60vw);
  height: min(420px, 60vw);
  top: -8%;
  right: 8%;
  background: rgba(79, 124, 255, 0.35);
  animation: welcomeOrbA 14s ease-in-out infinite alternate;
}

.welcome-tech-orb--b {
  width: min(360px, 50vw);
  height: min(360px, 50vw);
  bottom: 6%;
  left: -6%;
  background: rgba(32, 188, 164, 0.28);
  animation: welcomeOrbB 18s ease-in-out infinite alternate;
}

html[data-theme="Dark"] .welcome-tech-orb--a {
  background: rgba(32, 188, 164, 0.12);
  opacity: 0.45;
}

html[data-theme="Dark"] .welcome-tech-orb--b {
  background: rgba(79, 124, 255, 0.1);
  opacity: 0.35;
}

html[data-theme="Dark"] .welcome-filter {
  opacity: 0.12;
}

html[data-theme="Dark"] .welcome-gate {
  border-color: rgba(220, 228, 240, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="Dark"] .welcome-gate--featured {
  border-color: rgba(32, 188, 164, 0.22);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.welcome-tech-scanline {
  display: none;
}

.welcome-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px) clamp(16px, 4vw, 40px) 360px;
  display: flex;
  flex-direction: column;
}

.welcome-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(24px, 5vw, 44px);
}

.welcome-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--item_left_title_color);
  min-width: 0;
}

.welcome-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.welcome-brand-name {
  display: block;
  white-space: nowrap;
  font-family: "ZCOOL XiaoWei", "title", "Outfit", serif;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(79, 124, 255, 0.12));
}

.welcome-logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, #4f7cff, #20bca4) !important;
  box-shadow: 0 8px 22px rgba(79, 124, 255, 0.18);
  overflow: hidden;
}

.welcome-logo:not(.has-avatar)::after {
  content: attr(data-initials);
  font-size: 0.95rem;
}

.welcome-logo.has-avatar {
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 22px rgba(79, 124, 255, 0.18);
}

.welcome-logo.has-avatar::after {
  content: none;
  display: none;
}

.welcome-brand-text {
  font-family: "Outfit", "title", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--purple_text_color);
  white-space: nowrap;
}

.welcome-toolbar {
  margin-top: 0 !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  justify-content: flex-end;
  gap: 10px;
}

.welcome-toolbar .iconItem {
  width: 56px;
  height: 48px;
  margin-left: 0;
  border: 1px solid rgba(79, 124, 255, 0.1);
}

.welcome-toolbar .iconItem:hover,
.welcome-toolbar .iconItem:focus-visible {
  width: 108px;
  transform: translateY(-2px);
}

.welcome-toolbar button.iconItem {
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.welcome-toolbar .icon-theme-dark {
  display: none;
}

html[data-theme="Dark"] .welcome-toolbar .icon-theme-light {
  display: none;
}

html[data-theme="Dark"] .welcome-toolbar .icon-theme-dark {
  display: block;
}

.welcome-main {
  flex: 1;
  display: grid;
  gap: clamp(36px, 5vw, 52px);
  align-content: center;
}

.welcome-hero {
  max-width: none;
}

.welcome-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 48%);
  gap: clamp(24px, 4vw, 40px);
  align-items: start;
}

.welcome-hero-right {
  width: 100%;
  max-width: 520px;
  justify-self: end;
}

.welcome-hero-left {
  min-width: 0;
}

.welcome-hero-left .index-logo {
  width: min(168px, 36vw);
  max-width: 168px;
  margin-bottom: 10px;
  border-radius: 50%;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.welcome-hero-left .index-logo.has-avatar {
  border: 3px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 32px rgba(79, 124, 255, 0.18);
}

.welcome-kicker {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--purple_text_color);
  font-family: "Outfit", sans-serif;
}

.welcome-title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.28em 0.55em;
  font-family: "title", "Outfit", sans-serif;
  font-size: clamp(2rem, 5vw, 3.15rem);
  line-height: 1.12;
  color: var(--item_left_title_color);
}

.welcome-title-prefix {
  font-weight: 700;
}

.welcome-name-display {
  white-space: nowrap;
  font-family: "ZCOOL XiaoWei", "title", serif;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.welcome-role {
  margin: 14px 0 0;
  font-size: clamp(1rem, 2.2vw, 1.18rem);
}

.welcome-lead {
  margin: 18px 0 0;
  max-width: 52ch;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.75;
  color: var(--item_left_text_color);
}

.welcome-hint {
  margin: 16px 0 0;
  padding: 8px 12px;
  display: inline-block;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--purple_text_color);
  background: var(--item_bg_color);
  border: 1px solid rgba(79, 124, 255, 0.1);
}

.welcome-snake-card {
  padding: clamp(18px, 2.5vw, 24px);
  border-radius: 20px;
  background: var(--item_bg_color);
  border: 1px solid rgba(79, 124, 255, 0.16);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 48px rgba(79, 124, 255, 0.12);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.welcome-snake-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 56px rgba(79, 124, 255, 0.16);
}

html[data-theme="Dark"] .welcome-snake-card {
  border-color: rgba(220, 228, 240, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.welcome-snake-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--purple_text_color);
  font-family: "Outfit", sans-serif;
}

.welcome-snake-body {
  width: 100%;
}

.welcome-snake-body.tanChiShe {
  width: 100%;
}

.welcome-snake-body img {
  width: 100%;
  height: auto;
  min-height: clamp(160px, 22vw, 220px);
  display: block;
  border-radius: 12px;
  object-fit: contain;
}

.welcome-snake-caption {
  margin: 12px 0 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--item_left_text_color);
  opacity: 0.88;
}

.welcome-section-label {
  margin: 0 0 -10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--purple_text_color);
  font-family: "Outfit", sans-serif;
}

.welcome-gates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 18px);
}

.welcome-gate {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto 1fr;
  gap: 10px 14px;
  padding: clamp(18px, 2.5vw, 24px);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: var(--item_bg_color);
  border: 1px solid rgba(79, 124, 255, 0.1);
  backdrop-filter: blur(12px);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  overflow: hidden;
}

.welcome-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.08), transparent 55%);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.welcome-gate:hover,
.welcome-gate:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(79, 124, 255, 0.28);
  box-shadow: 0 16px 40px rgba(79, 124, 255, 0.14);
}

.welcome-gate:hover::before,
.welcome-gate:focus-visible::before {
  opacity: 1;
}

.welcome-gate--featured {
  border-color: rgba(79, 124, 255, 0.22);
  box-shadow: 0 12px 32px rgba(79, 124, 255, 0.1);
}

.welcome-gate-index {
  grid-column: 1;
  grid-row: 1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--purple_text_color);
  font-family: "Outfit", sans-serif;
}

.welcome-gate-icon {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  font-size: 1.5rem;
  color: var(--purple_text_color);
  line-height: 1;
}

.welcome-gate-body {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: center;
}

.welcome-gate-title {
  font-family: "title", "Outfit", sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--item_left_title_color);
}

.welcome-gate-desc {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--item_left_text_color);
}

.welcome-gate-arrow {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 1.2rem;
  color: var(--purple_text_color);
  transition: transform 0.25s ease;
}

.welcome-gate:hover .welcome-gate-arrow,
.welcome-gate:focus-visible .welcome-gate-arrow {
  transform: translateX(4px);
}

.welcome-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(32px, 6vw, 48px);
  padding-top: 20px;
  font-size: 0.84rem;
  color: var(--footer_text_color);
}

.welcome-footer a {
  color: var(--purple_text_color);
  font-weight: 600;
}

@keyframes welcomeGridDrift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-48px, -48px, 0);
  }
}

@keyframes welcomeOrbA {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-24px, 18px, 0) scale(1.08);
  }
}

@keyframes welcomeOrbB {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(20px, -16px, 0) scale(1.06);
  }
}

@media (max-width: 900px) {
  .welcome-hero-grid {
    grid-template-columns: 1fr;
  }

  .welcome-hero-right {
    order: -1;
  }

  .welcome-snake-card {
    max-width: none;
  }

  .welcome-gates {
    grid-template-columns: 1fr;
  }

  .welcome-shell {
    padding-bottom: 320px;
  }

  .welcome-toolbar .iconItem:hover,
  .welcome-toolbar .iconItem:focus-visible {
    width: 56px;
  }

  .welcome-toolbar .iconTip {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-tech-grid,
  .welcome-tech-orb--a,
  .welcome-tech-orb--b {
    animation: none;
  }

  .welcome-gate {
    transition: none;
  }
}

/* ---------- Sub pages (journal / discoveries) ---------- */

body[data-page="sub"] .welcome-shell {
  padding-bottom: 80px;
}

.sub-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--purple_text_color);
  text-decoration: none;
}

.sub-back:hover {
  transform: translateX(-2px);
}

.sub-hero {
  margin-bottom: clamp(24px, 4vw, 36px);
}

.sub-hero h1 {
  margin: 0 0 10px;
  font-family: "title", "Outfit", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--item_left_title_color);
}

.sub-hero p {
  margin: 0;
  max-width: 56ch;
  line-height: 1.7;
  color: var(--item_left_text_color);
}

.sub-list {
  display: grid;
  gap: 14px;
}

.sub-card {
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--item_bg_color);
  border: 1px solid rgba(79, 124, 255, 0.1);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.sub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(79, 124, 255, 0.1);
}

.sub-card-meta {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--purple_text_color);
  margin-bottom: 8px;
}

.sub-card h2,
.sub-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--item_left_title_color);
}

.sub-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--item_left_text_color);
}

.sub-card a.sub-card-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--purple_text_color);
  text-decoration: none;
}

.sub-card a.sub-card-link:hover {
  text-decoration: underline;
}

.sub-empty {
  padding: 28px;
  border-radius: 14px;
  text-align: center;
  color: var(--item_left_text_color);
  background: var(--item_bg_color);
}

/* ---------- 2026 personal grid refresh ---------- */
body[data-page="welcome"] {
  --welcome-violet: 99, 91, 255;
  --welcome-cyan: 36, 192, 174;
  --welcome-line: rgba(74, 74, 92, 0.1);
  --welcome-panel: rgba(255, 253, 248, 0.76);
  --welcome-panel-strong: rgba(255, 255, 255, 0.9);
  --welcome-shadow: 0 22px 70px rgba(42, 37, 56, 0.1);
}

html[data-theme="Dark"] body[data-page="welcome"] {
  --welcome-line: rgba(224, 225, 239, 0.1);
  --welcome-panel: rgba(20, 20, 26, 0.72);
  --welcome-panel-strong: rgba(25, 25, 33, 0.9);
  --welcome-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.welcome-tech-bg {
  background:
    radial-gradient(circle at 76% 10%, rgba(var(--welcome-violet), 0.13), transparent 34%),
    radial-gradient(circle at 8% 72%, rgba(var(--welcome-cyan), 0.1), transparent 30%),
    linear-gradient(145deg, #faf8f3 0%, #f7f5f1 52%, #f3f4f8 100%);
}

html[data-theme="Dark"] .welcome-tech-bg {
  background:
    radial-gradient(circle at 76% 10%, rgba(var(--welcome-violet), 0.1), transparent 34%),
    radial-gradient(circle at 8% 72%, rgba(var(--welcome-cyan), 0.07), transparent 30%),
    linear-gradient(145deg, #0e0e12 0%, #131319 48%, #101117 100%);
}

.welcome-topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  padding: 10px 12px;
  border: 1px solid var(--welcome-line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--welcome-panel-strong) 82%, transparent);
  box-shadow: 0 10px 36px rgba(42, 37, 56, 0.06);
  backdrop-filter: blur(18px) saturate(1.25);
}

.welcome-brand-name,
.welcome-cover-action--primary {
  background-image: linear-gradient(120deg, rgb(var(--welcome-violet)), rgb(var(--welcome-cyan)));
}

.welcome-hero-grid {
  position: relative;
  padding: clamp(22px, 4vw, 48px);
  border: 1px solid var(--welcome-line);
  border-radius: 28px;
  background: var(--welcome-panel);
  box-shadow: var(--welcome-shadow);
  backdrop-filter: blur(22px) saturate(1.12);
  isolation: isolate;
  overflow: hidden;
}

.welcome-hero-grid::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 420px;
  aspect-ratio: 1;
  top: -260px;
  right: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--welcome-violet), 0.18), transparent 68%);
  animation: welcomeHeroBreath 9s ease-in-out infinite alternate;
}

.welcome-cover-statement {
  margin: 18px 0 0;
  max-width: 15ch;
  font-family: "ZCOOL XiaoWei", "title", serif;
  font-size: clamp(1.5rem, 3.5vw, 2.65rem);
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--item_left_title_color);
  text-wrap: balance;
}

.welcome-cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.welcome-cover-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--welcome-line);
  border-radius: 999px;
  background: var(--welcome-panel-strong);
  color: var(--item_left_title_color);
  font-size: 0.88rem;
  font-weight: 700;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.welcome-cover-action--primary {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(var(--welcome-violet), 0.2);
}

.welcome-cover-action:hover,
.welcome-cover-action:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(var(--welcome-violet), 0.32);
  box-shadow: 0 14px 34px rgba(var(--welcome-violet), 0.14);
}

.welcome-proof-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 26px 0 0;
  padding: 1px;
  list-style: none;
  border-radius: 14px;
  background: var(--welcome-line);
  overflow: hidden;
}

.welcome-proof-list li {
  min-width: 0;
  padding: 12px;
  background: var(--welcome-panel-strong);
}

.welcome-proof-list strong,
.welcome-proof-list span {
  display: block;
}

.welcome-proof-list strong {
  font-size: 0.82rem;
  color: var(--item_left_title_color);
}

.welcome-proof-list span {
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--item_left_text_color);
}

.welcome-snake-card,
.welcome-gate {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --lift: 0px;
  --spot-x: 50%;
  --spot-y: 50%;
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translate3d(0, var(--lift), 0);
  transform-style: preserve-3d;
  will-change: transform;
}

.welcome-snake-card::after,
.welcome-gate::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle 210px at var(--spot-x) var(--spot-y), rgba(255, 255, 255, 0.5), transparent 62%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

html[data-theme="Dark"] .welcome-snake-card::after,
html[data-theme="Dark"] .welcome-gate::after {
  background: radial-gradient(circle 210px at var(--spot-x) var(--spot-y), rgba(var(--welcome-violet), 0.16), transparent 64%);
}

.welcome-snake-card:hover,
.welcome-gate:hover,
.welcome-gate:focus-visible {
  --lift: -6px;
}

.welcome-snake-card:hover::after,
.welcome-gate:hover::after,
.welcome-gate:focus-visible::after {
  opacity: 1;
}

.welcome-snake-card {
  position: relative;
  border-color: var(--welcome-line);
  background: var(--welcome-panel-strong);
  overflow: hidden;
}

.welcome-gate {
  background: var(--welcome-panel);
  border-color: var(--welcome-line);
}

.welcome-gate--featured {
  border-color: rgba(var(--welcome-violet), 0.22);
}

.welcome-reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0) scale(0.985);
  transition:
    opacity 0.8s cubic-bezier(.2,.8,.2,1) calc(var(--reveal-index, 0) * 75ms),
    transform 0.8s cubic-bezier(.2,.8,.2,1) calc(var(--reveal-index, 0) * 75ms);
}

.welcome-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

@keyframes welcomeHeroBreath {
  from { transform: translate3d(0, 0, 0) scale(0.92); opacity: 0.65; }
  to { transform: translate3d(-22px, 18px, 0) scale(1.08); opacity: 1; }
}

@media (max-width: 680px) {
  .welcome-topbar { position: relative; top: auto; }
  .welcome-hero-grid { padding: 20px; border-radius: 22px; }
  .welcome-proof-list { grid-template-columns: 1fr; }
  .welcome-cover-action { flex: 1 1 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-hero-grid::before { animation: none; }
  .welcome-reveal { opacity: 1; transform: none; transition: none; }
  .welcome-snake-card,
  .welcome-gate { transform: none !important; will-change: auto; }
}
