@font-face {
  font-family: 'Nunito Sans';
  src: url('./brand/NunitoSans-400.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito Sans';
  src: url('./brand/NunitoSans-600.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  --page: #edf3f9;
  --surface: #fff;
  --line: #d0ddeb;
  --text: #0a2748;
  --muted: #4a6280;
  --accent: #1469ad;
  --panel: #102c49;
  --entry-highlight: #80d5da;
  --gutter: clamp(16px, 4vw, 40px);
  font-family: 'Nunito Sans', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color-scheme: light;
  color: var(--text);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; }
p { margin: 0; }

.shell {
  width: min(1200px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.site-header {
  padding-block: 12px;
  border-block-end: 1px solid var(--line);
  background: var(--surface);
}

.site-header img {
  display: block;
  width: 176px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

main {
  padding-block: clamp(24px, 4vw, 48px) 48px;
  container-type: inline-size;
}

.portal-layout {
  display: grid;
  gap: 16px;
}

.intro {
  position: relative;
  isolation: isolate;
  min-block-size: 270px;
  border: 1px solid #1e4165;
  border-radius: 16px;
  background: var(--panel);
  color: #f4f8ff;
  overflow: hidden;
}

.intro-copy {
  position: relative;
  z-index: 1;
  padding: clamp(24px, 5vw, 40px);
  animation: intro-in 220ms ease-out both;
}

.intro-image {
  position: absolute;
  inset: auto 0 0;
  inline-size: 100%;
  block-size: 62%;
  object-fit: cover;
  object-position: 67% 50%;
  mask-image: linear-gradient(transparent, #000 25%);
  pointer-events: none;
}

@keyframes intro-in {
  from { transform: translateY(4px); }
  to { transform: translateY(0); }
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 1.75rem + 2.2vw, 3.625rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.025em;
}

.intro p {
  margin-block-start: 12px;
  color: #ccdaeb;
}

.service-panel { min-inline-size: 0; }

#message:empty, .entries:empty { display: none; }

.error {
  padding: 12px 16px;
  border-inline-start: 4px solid #b43d3d;
  border-radius: 4px;
  background: #f9eaea;
  color: #8e3030;
}

.entries {
  display: grid;
  grid-auto-rows: 1fr;
  min-block-size: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-inline-size: 0;
  padding: clamp(12px, 2.4vw, 24px);
  transition: background-color 140ms ease-out;
}

.entry + .entry { border-block-start: 1px solid var(--line); }
.entry:first-child { border-radius: 15px 15px 0 0; }
.entry:last-child { border-radius: 0 0 15px 15px; }
.entry:focus-within { background: #f2f7fc; }

.entry:has(a.button) { cursor: pointer; }

@media (hover: hover) {
  .entry:has(a.button):hover { background: #f2f7fc; }
}

.entry-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-inline-size: 0;
}

.entry-copy {
  display: grid;
  gap: 4px;
  min-inline-size: 0;
}

.entry-icon {
  display: grid;
  flex: 0 0 clamp(36px, 6vw, 50px);
  block-size: clamp(36px, 6vw, 50px);
  place-items: center;
  border-radius: 10px;
  background: var(--panel);
  color: #e3f2fa;
}

.entry-icon svg {
  inline-size: 24px;
  block-size: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-detail {
  stroke: var(--entry-highlight);
}

.entry h2 {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.125rem, 1rem + .5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.description {
  color: #36536f;
  overflow-wrap: anywhere;
}

.entry-action > .action-icon { display: none; }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-inline-size: 44px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--panel);
  border-radius: 8px;
  background: var(--panel);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-align: start;
  text-decoration: none;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}

a.button::before {
  content: "";
  position: absolute;
  inset: 0;
}

.action-label { display: none; }

.button .action-icon {
  flex: 0 0 18px;
  block-size: 18px;
  color: var(--entry-highlight);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  a.button:hover {
    border-color: #1a5374;
    background: #1a5374;
  }
}

a.button:active { background: #0c2540; }
.button:disabled {
  border-color: var(--line);
  background: var(--page);
  color: var(--muted);
  cursor: not-allowed;
}

.button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.entry:has(button:disabled) .entry-action {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.note {
  color: var(--muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

@container (min-width: 32rem) {
  a.button { inline-size: 96px; }
  .action-label { display: inline; }
}

@container (min-width: 51rem) {
  .portal-layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 24px;
  }
  .intro { min-block-size: 428px; }
  .intro-image { block-size: 66%; }
}

@media (prefers-reduced-motion: reduce) {
  .intro-copy { animation: none; }
  .entry, .button { transition: none; }
}
