:root {
  color-scheme: light;
  --ink: #17365f;
  --ink-strong: #0d2b50;
  --muted: #5d7795;
  --blue: #2874f0;
  --panel: #f5f9ff;
  --panel-strong: #eaf3ff;
  --line: #b8d3f6;
  --warning: #fff4dc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.portal {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-strong);
  text-decoration: none;
}

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

.brand-lockup strong {
  color: var(--ink-strong);
  font-size: 0.72rem;
  font-weight: 850;
}

.brand-lockup small {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.secure-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--ink-strong);
  font-weight: 800;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.moderator-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-strong);
  font-weight: 850;
  text-decoration: none;
}

.hero {
  padding: 72px 0 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--ink-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  font-weight: 500;
  line-height: 1.02;
}

.hero p:last-child {
  max-width: 680px;
  font-size: 1.2rem;
  line-height: 1.48;
}

.projects {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 28px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
}

.project-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
}

.project-card h2 {
  margin-bottom: 8px;
  color: var(--ink-strong);
  font-size: 2rem;
}

.project-card p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--ink);
  line-height: 1.48;
}

.collection-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.collection-picker > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.collection-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink-strong);
  font-size: 0.86rem;
  font-weight: 900;
  transition:
    transform 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.collection-chip.active,
.collection-chip:hover {
  border-color: var(--blue);
  background: var(--panel-strong);
}

.collection-chip.active {
  box-shadow: 0 0 0 3px rgba(40, 116, 240, 0.12);
}

dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 10px;
  margin: 0;
}

dl div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  color: var(--ink-strong);
  font-weight: 900;
}

.primary-button,
.secondary-button,
.secondary-action {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 900;
  transition:
    transform 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    color 120ms ease;
}

.primary-button {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 7px 14px rgba(40, 116, 240, 0.16);
}

.secondary-button {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink-strong);
  box-shadow: inset 0 -1px 0 rgba(13, 43, 80, 0.04);
}

.project-actions {
  display: grid;
  gap: 10px;
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink-strong);
  text-decoration: none;
  box-shadow: inset 0 -1px 0 rgba(13, 43, 80, 0.04);
}

.primary-button:hover {
  background: #1e67df;
}

.secondary-button:hover,
.secondary-action:hover,
.close-button:hover {
  border-color: var(--blue);
  background: var(--panel-strong);
}

.primary-button:active,
.secondary-button:active,
.secondary-action:active,
.close-button:active,
.collection-chip:active,
.primary-button.is-pressed,
.secondary-button.is-pressed,
.close-button.is-pressed,
.collection-chip.is-pressed {
  transform: translateY(1px) scale(0.985);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.secondary-action:focus-visible,
.close-button:focus-visible,
.collection-chip:focus-visible {
  outline: 3px solid rgba(40, 116, 240, 0.28);
  outline-offset: 3px;
}

.code-dialog {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
}

.code-dialog::backdrop {
  background: rgba(13, 43, 80, 0.28);
}

.code-panel {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #ffffff;
}

.code-panel h2 {
  margin-bottom: 8px;
  color: var(--ink-strong);
  font-size: 1.7rem;
}

.close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-strong);
  font-size: 1.3rem;
  transition:
    transform 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

label span {
  color: var(--muted);
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  color: var(--ink-strong);
  font-size: 1.2rem;
}

.error {
  margin: 12px 0 0;
  color: #a03227;
  font-weight: 800;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 760px) {
  .portal {
    width: min(100% - 28px, 1120px);
    padding-top: 24px;
  }

  .topbar,
  .top-actions,
  .project-card,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  dl {
    grid-template-columns: 1fr;
  }
}
