:root {
  color-scheme: dark;
  --black: #050505;
  --ink: #111111;
  --white: #ffffff;
  --soft: #f5f5f7;
  --muted: #a3a3a8;
  --dim: #6e6e73;
  --line-dark: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.1);
  --glass: rgba(12, 12, 13, 0.74);
  --panel: rgba(255, 255, 255, 0.072);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --green: #7bd8b4;
  --gold: #e9c46a;
  --red: #ff8b8b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--white);
  background: var(--black);
}

body.is-authenticated #publicContent {
  display: none;
}

body.is-authenticated .portal-shell {
  min-height: 100svh;
  padding-top: 112px;
}

body.is-authenticated .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

body.is-authenticated .nav-links {
  display: none;
}

body.is-dialog-open {
  overflow: hidden;
}

body.home-page {
  height: 100svh;
  overflow: hidden;
}

.home-shell {
  position: relative;
  height: 100svh;
  min-height: 0;
}

.home-hero {
  min-height: 100svh;
  padding-bottom: 96px;
}

.home-footer {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  padding-top: 0;
  background: transparent;
}

.portal-page .page {
  overflow-x: hidden;
  overflow-y: visible;
}

.portal-page .portal-shell {
  min-height: 100svh;
  padding-top: 112px;
}

.portal-page .portal-header h1 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

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

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.page {
  min-height: 100vh;
  overflow: hidden;
  background: var(--black);
}

.topbar {
  position: fixed;
  z-index: 30;
  top: 14px;
  left: 50%;
  width: min(1120px, calc(100% - 28px));
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 8px 10px 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: var(--glass);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(24px) saturate(150%);
  transform: translateX(-50%);
  animation: navIn 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: background 280ms ease, border-color 280ms ease, min-height 280ms ease;
}

.topbar.is-scrolled {
  min-height: 52px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(8, 8, 9, 0.88);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  overflow: hidden;
}

.brand-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  filter: grayscale(1) contrast(1.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 26px rgba(0, 0, 0, 0.32);
  transition: filter 220ms ease, transform 220ms ease;
}

.brand:hover .brand-avatar {
  filter: grayscale(0.25) contrast(1.08);
  transform: scale(1.035);
}

.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a,
.nav-login-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0 13px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 680;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-links a:hover,
.nav-login-button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.topbar-controls {
  display: flex;
  justify-content: flex-end;
}

.language-switch {
  position: relative;
  width: 116px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.language-switch::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transform: translateX(0);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.language-switch.is-en::before {
  transform: translateX(100%);
}

.lang-button {
  position: relative;
  z-index: 1;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.82rem;
  font-weight: 780;
  cursor: pointer;
  transition: color 180ms ease, transform 180ms ease;
}

.lang-button:hover {
  transform: translateY(-1px);
}

.lang-button.is-active {
  color: #050505;
}

.hero {
  position: relative;
  min-height: 94svh;
  display: grid;
  align-items: center;
  isolation: isolate;
  padding: 118px 30px 74px;
  background: #050505;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.hero::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 23%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 118px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 118px),
    linear-gradient(135deg, #050505 0%, #151515 48%, #050505 100%);
  background-size: auto, 118px 118px, 118px 118px, auto;
  animation: gridDrift 18s ease-in-out infinite alternate;
}

.hero::after {
  z-index: -1;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.035) 25%, transparent 48%),
    linear-gradient(90deg, rgba(5, 5, 5, 0.94) 0%, rgba(5, 5, 5, 0.62) 55%, rgba(5, 5, 5, 0.92) 100%),
    linear-gradient(180deg, transparent 62%, #050505 100%);
}

.hero-inner {
  width: min(1060px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  width: 100%;
  max-width: none;
  margin: 0;
  font-size: clamp(4rem, 11vw, 9rem);
  line-height: 0.9;
  font-weight: 880;
  letter-spacing: 0;
  white-space: nowrap;
  animation: heroRise 980ms 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[lang="en"] .hero h1 {
  font-size: clamp(3.5rem, 9vw, 8rem);
}

.hero-lead {
  max-width: 820px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(1.35rem, 3.2vw, 2.8rem);
  line-height: 1.16;
  font-weight: 760;
  animation: heroRise 860ms 310ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-copy,
.section-copy {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.85;
}

.hero-copy {
  animation: heroRise 860ms 410ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-actions,
.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions {
  margin-top: 12px;
  animation: heroRise 860ms 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.button {
  position: relative;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 780;
  line-height: 1;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, color 180ms ease;
}

.button::after {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.36) 45%, transparent 66%);
  opacity: 0;
  transform: translateX(-65%);
  pointer-events: none;
  transition: opacity 180ms ease, transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.13);
}

.button:hover::after {
  opacity: 1;
  transform: translateX(65%);
}

.primary-button {
  background: #ffffff;
  color: #050505;
  border-color: #ffffff;
}

.primary-button:hover {
  color: #050505;
  background: rgba(255, 255, 255, 0.92);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.07);
}

.social-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.x-button {
  width: 54px;
  min-width: 54px;
  padding: 0;
}

.hero-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  animation: heroRise 860ms 590ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-signals span,
.date-pill,
.archive-tab {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.72);
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 720;
}

.section {
  position: relative;
  padding: 86px 30px;
  background: #050505;
}

.band {
  background:
    linear-gradient(180deg, #050505, #0a0a0b 52%, #050505),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 118px);
}

.section-inner,
.portal-shell {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.section-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

.section h2 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

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

.feature-card,
.memory-panel,
.status-card,
.timeline-panel,
.report-panel,
.admin-import {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.092), rgba(255, 255, 255, 0.052));
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px) saturate(130%);
}

.feature-card {
  min-height: 236px;
  padding: 24px;
}

.feature-index {
  display: inline-flex;
  margin-bottom: 38px;
  color: rgba(255, 255, 255, 0.44);
  font-weight: 860;
}

.feature-card h3 {
  margin: 0 0 12px;
  font-size: 1.28rem;
}

.feature-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  line-height: 1.8;
}

.data-layout,
.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.78fr);
  gap: 24px;
  align-items: center;
}

.memory-panel {
  padding: 22px;
}

.memory-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.memory-row span {
  color: rgba(255, 255, 255, 0.58);
}

.memory-row strong {
  text-align: right;
}

.memory-progress {
  height: 8px;
  margin-top: 22px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.memory-progress span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffffff, rgba(123, 216, 180, 0.78));
}

.login-section {
  padding-bottom: 102px;
}

.admin-import {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.login-intro-layout {
  display: block;
}

.login-copy {
  max-width: 860px;
}

.form-heading h2,
.form-heading h3,
.panel-heading h3 {
  margin: 0;
  font-size: 1.36rem;
}

.form-heading p,
.panel-heading p,
#studentMeta,
.timeline-panel p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.58);
}

label {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 720;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  outline: none;
}

textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox-line input {
  width: 16px;
  min-height: 16px;
  flex: 0 0 16px;
}

.login-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.86rem;
  line-height: 1.55;
}

.full-button {
  width: 100%;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--green);
  font-size: 0.9rem;
  line-height: 1.45;
}

.form-message.is-error {
  color: var(--red);
}

.portal-shell {
  padding: 92px 0 100px;
}

.is-hidden {
  display: none !important;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.portal-header h2 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.student-status {
  max-width: 720px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.65;
}

.portal-actions select {
  min-width: 180px;
}

.compact-button {
  min-height: 44px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.status-card {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 18px;
}

.status-card span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.88rem;
  font-weight: 760;
}

.status-card strong {
  font-size: 1.18rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.archive-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 14px;
}

.archive-tab {
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.archive-tab.is-active {
  background: #ffffff;
  color: #050505;
}

#monthFilter {
  width: 156px;
  min-height: 38px;
  border-radius: 999px;
  padding: 7px 11px;
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.28fr);
  gap: 14px;
}

.timeline-panel,
.report-panel {
  min-height: 560px;
  padding: 20px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08));
}

.timeline-item {
  position: relative;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
  color: #ffffff;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 18px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.08);
}

.timeline-item:hover,
.timeline-item.is-active {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.09);
}

.timeline-item small {
  color: rgba(255, 255, 255, 0.52);
  font-weight: 760;
}

.timeline-item strong {
  line-height: 1.35;
}

.timeline-item span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.9rem;
  line-height: 1.5;
}

.markdown-body {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.85;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: #ffffff;
  letter-spacing: 0;
}

.markdown-body h1 {
  margin: 0 0 18px;
  font-size: 2rem;
}

.markdown-body h2 {
  margin: 24px 0 10px;
  font-size: 1.32rem;
}

.markdown-body h3 {
  margin: 20px 0 8px;
  font-size: 1.12rem;
}

.markdown-body p {
  margin: 0 0 12px;
}

.markdown-body ul {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding-left: 1.15rem;
}

.markdown-body li::marker {
  color: rgba(255, 255, 255, 0.5);
}

.markdown-body blockquote {
  margin: 14px 0;
  border-left: 3px solid rgba(255, 255, 255, 0.36);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0 8px 8px 0;
}

.admin-import {
  margin-top: 14px;
}

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

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.admin-form-actions .button {
  min-width: 150px;
}

.admin-update-notice {
  margin: 0;
  border-left: 3px solid var(--gold);
  padding: 9px 12px;
  background: rgba(233, 196, 106, 0.09);
  color: #f4d889;
  line-height: 1.55;
}

.admin-preview {
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  padding-top: 22px;
}

.login-dialog {
  width: min(480px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  color: #ffffff;
  background: rgba(10, 10, 11, 0.9);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(26px) saturate(145%);
}

.login-dialog[open] {
  animation: modalIn 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.login-dialog-panel {
  position: relative;
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px;
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-dialog .form-heading {
  padding-right: 38px;
}

.login-dialog .form-heading .eyebrow {
  margin: 0 0 8px;
}

.login-dialog .form-heading h2 {
  font-size: 1.65rem;
}

footer {
  padding: 26px 30px 34px;
  background: #050505;
}

.footer-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 22px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.9rem;
}

.motion-ready .footer-inner {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(18px);
  transition: opacity 760ms ease, filter 760ms ease, transform 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

.motion-ready .footer-inner.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.wechat-modal {
  width: min(520px, calc(100% - 28px));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0;
  color: #ffffff;
  background: rgba(12, 12, 13, 0.88);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(24px) saturate(150%);
}

.wechat-modal::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.modal-card {
  position: relative;
  padding: 28px;
}

.modal-card h2 {
  margin: 8px 0 12px;
}

.modal-card p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  line-height: 1.75;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 1.2rem;
}

@keyframes navIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes navInMobile {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes heroRise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gridDrift {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }
  to {
    background-position: 0 0, 42px 18px, -28px 36px, 0 0;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .nav-links {
    display: none;
  }

  .feature-grid,
  .data-layout,
  .portal-layout,
  .portal-grid,
  .status-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .portal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-actions,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .portal-actions select {
    width: 100%;
  }

  .home-page .hero-actions {
    align-items: center;
    flex-direction: row;
  }

  .home-page .hero-actions .button {
    width: auto;
  }

  .admin-form-actions {
    flex-direction: column;
  }

  .admin-form-actions .button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .topbar {
    top: 10px;
    width: calc(100% - 20px);
    min-height: 54px;
    padding: 7px 8px 7px 9px;
    border-radius: 10px;
    animation-name: navInMobile;
  }

  .brand-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .language-switch {
    width: 96px;
    height: 38px;
  }

  .lang-button {
    min-height: 30px;
    font-size: 0.75rem;
  }

  .hero {
    min-height: 92svh;
    padding: 104px 18px 52px;
  }

  .home-hero {
    min-height: 100svh;
    padding-bottom: 76px;
  }

  .section {
    padding: 62px 18px;
  }

  .section-inner {
    width: 100%;
  }

  .portal-shell {
    width: calc(100% - 24px);
  }

  .hero h1 {
    font-size: clamp(2.5rem, 12.5vw, 4.8rem);
  }

  .home-page .hero h1 {
    font-size: min(12.5vw, 4.8rem);
  }

  .login-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .login-dialog-panel {
    max-height: calc(100dvh - 20px);
    padding: 24px 18px 18px;
  }

  .login-dialog .form-heading {
    padding-right: 34px;
  }

  html[lang="en"] .hero h1 {
    font-size: clamp(2.4rem, 11vw, 4.2rem);
  }

  .archive-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .archive-tab {
    flex: 0 0 auto;
  }

  .timeline-panel,
  .report-panel {
    min-height: auto;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-height: 700px) {
  .home-footer {
    display: none;
  }

  .home-hero {
    padding-bottom: 34px;
  }

  .home-page .hero-signals {
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .hero::before,
  .hero h1,
  .hero-lead,
  .hero-copy,
  .hero-actions,
  .hero-signals,
  .login-dialog,
  .footer-inner {
    animation: none !important;
  }

  .button,
  .lang-button,
  .language-switch::before,
  .brand-avatar,
  .nav-links a,
  .timeline-item {
    transition: none !important;
  }
}
