:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #f3f6fb;
  background: #0b111e;
  --text-muted: #b4c0d2;
  --accent: #91c6fe;
  --surface: #162133;
  --border: #27354b;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.portal {
  width: min(1180px, calc(100% - 2 * clamp(20px, 4.6vw, 68px)));
  margin-inline: auto;
  padding-block: clamp(32px, 6vw, 76px) 40px;
}

.intro { margin-bottom: clamp(26px, 4vw, 46px); }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font: 650 .82rem/1.4 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: .08em;
}

.brand-divider { color: #7291b4; }

.brand-mark {
  position: relative;
  width: 21px;
  height: 13px;
  margin-inline: 1px 5px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transform: rotate(-38deg);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.brand-mark::before { left: 50%; width: 5px; height: 5px; }
.brand-mark::after { left: 100%; width: 4px; height: 4px; }

h1 {
  margin-top: 18px;
  font-size: clamp(2rem, 4.95vw, 4rem);
  font-weight: 680;
  line-height: 1.08;
  letter-spacing: -.047em;
  text-wrap: balance;
}

.subtitle {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: clamp(.95rem, 1.7vw, 1.16rem);
  line-height: 1.5;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
}

.project-status {
  padding: 18px 0;
  color: var(--text-muted);
}

.project-card {
  min-width: 0;
  border-radius: 17px;
  background: var(--surface);
}

.card-link {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: inherit;
  text-decoration: none;
  transition: background-color 170ms ease, border-color 170ms ease, transform 170ms ease;
}

.card-link:hover,
.card-link:focus-visible {
  background: #1b2940;
  border-color: #5880a9;
}

@media (hover: hover) { .card-link:hover { transform: translateY(-3px); } }

.card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0d1525;
}

.card-content { padding: clamp(16px, 2.6vw, 27px); }

.card-meta {
  color: var(--accent);
  font-size: .79rem;
  font-weight: 570;
  line-height: 1.45;
}

.card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  font-size: clamp(1.18rem, 2.4vw, 1.55rem);
  line-height: 1.2;
  letter-spacing: -.023em;
}

.card-arrow {
  color: var(--accent);
  font-weight: 450;
  transition: transform 170ms ease;
}

.card-link:hover .card-arrow,
.card-link:focus-visible .card-arrow { transform: translateX(3px); }

.card-description {
  margin-top: 9px;
  color: var(--text-muted);
  font-size: .92rem;
  line-height: 1.55;
}

.portal-footer {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #101a2a;
  color: var(--text-muted);
  font-size: .89rem;
  text-align: center;
}

.portal-footer span { margin-right: 7px; color: var(--accent); }

.project-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.project-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 6px clamp(12px, 2.8vw, 36px);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .84rem;
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.project-back:hover { text-decoration: underline; text-underline-offset: 3px; }

.project-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #05080e;
}

@media (max-width: 660px) {
  .project-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .card-link, .card-arrow { transition: none; }
}
