:root {
  color-scheme: light;
  --bg: #f3efe7;
  --panel: rgba(255, 252, 247, 0.92);
  --line: #d9cfc0;
  --ink: #1e1f24;
  --muted: #5e615f;
  --brand: #0d5c63;
  --brand-2: #f2a65a;
  --brand-3: #7c9885;
  --danger: #a63d40;
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(242, 166, 90, 0.25), transparent 30%),
    radial-gradient(circle at top right, rgba(13, 92, 99, 0.18), transparent 36%),
    linear-gradient(180deg, #fbf8f1 0%, var(--bg) 100%);
}

a {
  color: inherit;
}

.portal-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

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

.brand-lockup {
  display: grid;
  gap: 8px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: var(--muted);
}

.brand-lockup h1,
.brand-lockup h2,
.brand-lockup p {
  margin: 0;
}

.brand-lockup h1,
.brand-lockup h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.lead {
  color: var(--muted);
  max-width: 62rem;
  line-height: 1.7;
}

.portal-grid,
.dashboard-grid,
.memory-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 20px 40px rgba(32, 30, 21, 0.08);
  padding: 24px;
  backdrop-filter: blur(10px);
}

.hero-panel {
  grid-column: span 7;
  display: grid;
  gap: 18px;
}

.form-panel {
  grid-column: span 5;
}

.full-span {
  grid-column: 1 / -1;
}

.projects-panel,
.owned-panel,
.memory-panel {
  grid-column: span 7;
}

.events-panel,
.account-panel {
  grid-column: span 5;
}

.memory-main {
  grid-column: span 8;
}

.memory-side {
  grid-column: span 4;
}

.section-title,
.panel h3,
.panel h4,
.panel p {
  margin: 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title small,
.muted {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(13, 92, 99, 0.1);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
}

.badge.is-planned {
  background: rgba(242, 166, 90, 0.18);
  color: #8a4d11;
}

.button-row,
.inline-form,
.stack {
  display: flex;
  gap: 12px;
}

.stack {
  flex-direction: column;
}

.button-row {
  flex-wrap: wrap;
}

.button,
button,
input,
textarea {
  font: inherit;
}

.button,
button {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 12px 16px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

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

.button-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(13, 92, 99, 0.22);
}

.button-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.button-danger {
  background: rgba(166, 61, 64, 0.12);
  color: var(--danger);
  border-color: rgba(166, 61, 64, 0.2);
}

.button-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.92rem;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

.helper {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

.alert {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(166, 61, 64, 0.2);
  background: rgba(166, 61, 64, 0.1);
  color: var(--danger);
  margin-bottom: 16px;
}

.project-cards,
.owned-list,
.event-list,
.memory-spec-list {
  display: grid;
  gap: 14px;
}

.project-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  display: grid;
  gap: 12px;
}

.project-card.indigo {
  background: linear-gradient(180deg, rgba(13, 92, 99, 0.08), rgba(255, 255, 255, 0.92));
}

.project-card.amber {
  background: linear-gradient(180deg, rgba(242, 166, 90, 0.16), rgba(255, 255, 255, 0.92));
}

.project-card h4,
.owned-item h4 {
  margin: 0;
  font-size: 1.12rem;
}

.project-card p,
.owned-item p,
.event-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.owned-item,
.event-item,
.memory-spec {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.portal-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pill-link {
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.code-block {
  padding: 14px;
  border-radius: 18px;
  background: #171717;
  color: #f5f5f5;
  overflow-x: auto;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.92rem;
}

@media (max-width: 960px) {
  .hero-panel,
  .form-panel,
  .projects-panel,
  .owned-panel,
  .memory-panel,
  .events-panel,
  .account-panel,
  .memory-main,
  .memory-side {
    grid-column: 1 / -1;
  }

  .project-cards,
  .form-grid.two-up {
    grid-template-columns: 1fr;
  }

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