:root {
  color-scheme: light;
  --paper: #f7f7f4;
  --ink: #202825;
  --muted: #515a55;
  --line: #dce2dc;
  --accent: #233d34;
  --edge: clamp(20px, 4.5vw, 72px);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: inherit; text-underline-offset: .25em; }
button, input { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid #39745e;
  outline-offset: 4px;
}
.portal-bar, .portal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--edge);
  min-height: 68px;
  gap: 18px;
}
.portal-bar { border-bottom: 1px solid var(--line); background: #fff; }
.portal-bar form { margin: 0; }
.portal-brand {
  text-decoration: none;
  font-size: clamp(21px, 2.2vw, 31px);
  font-weight: 760;
  letter-spacing: -.075em;
}
.portal-brand span { color: #39745e; }
.portal-quiet {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: .875rem;
  text-decoration: none;
  padding: 10px 0;
}
.portal-quiet:hover { text-decoration: underline; }

.portal-login {
  width: min(1440px, calc(100% - 2 * var(--edge)));
  margin: clamp(22px, 4vw, 52px) auto 0;
  min-height: clamp(540px, 70svh, 740px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  background: #fff;
}
.portal-collage { position: relative; min-width: 0; background: #b8ad96; overflow: hidden; }
.portal-collage picture, .portal-hero-photo { display: block; width: 100%; height: 100%; }
.portal-collage picture { position: absolute; inset: 0; }
.portal-hero-photo { object-fit: cover; object-position: 70% center; }
.portal-inset-photo {
  position: absolute;
  left: 7%;
  bottom: 8%;
  width: 26%;
  height: auto;
  border: solid 4px #f9f8f2;
  border-radius: 14px;
  box-shadow: 0 14px 32px #18181145;
  transform: rotate(-7deg);
}
.portal-login-panel { display: grid; place-items: center; padding: clamp(22px, 5vw, 86px); }
.portal-login-copy { width: min(100%, 350px); }
.portal-login-copy h1, .portal-intro h1 {
  margin: 0;
  font-weight: 560;
  letter-spacing: -.067em;
  line-height: 1.04;
  font-size: clamp(36px, 4.1vw, 66px);
}
.portal-login-copy > p, .portal-intro p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}
.portal-login-copy form { margin-top: 32px; }
.portal-login-copy label, .portal-search { font-size: .89rem; font-weight: 650; }
.portal-login-copy input, .portal-search input {
  display: block;
  width: 100%;
  min-height: 54px;
  margin: 9px 0 0;
  border: 1px solid #a8b6ae;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
}
.portal-login-copy input[aria-invalid=true] { border-color: #ad3d37; }
.portal-error { margin: 10px 0 0; font-size: .875rem; color: #992e29; line-height: 1.5; }
.portal-primary {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  min-height: 54px;
  border: 0;
  margin-top: 16px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-weight: 650;
  padding: 12px 16px;
}
.portal-primary:hover { background: #31574a; }
.portal-help { display: inline-block; margin-top: 22px; color: var(--muted); font-size: .875rem; }
.portal-footer { justify-content: flex-end; color: var(--muted); font-size: .8125rem; }

.portal-library, .portal-message {
  width: min(1220px, calc(100% - 2 * var(--edge)));
  margin: clamp(34px, 6vw, 80px) auto 0;
}
.portal-intro { max-width: 720px; }
.portal-tools { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.portal-tools a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #fff;
  text-decoration: none;
  font-size: .875rem;
}
.portal-tools a:hover { border-color: #869b90; }
.portal-search { display: block; max-width: 390px; margin-top: 30px; }
.portal-empty { color: var(--muted); margin: 36px 0; }
.portal-group { margin: clamp(30px, 5vw, 60px) 0 0; scroll-margin-top: 18px; }
.portal-group h2, .portal-support h2 { font-size: clamp(23px, 3vw, 34px); margin: 0 0 14px; letter-spacing: -.045em; font-weight: 560; }
.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.portal-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(18px, 2.5vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  overflow-wrap: anywhere;
}
.portal-card h3 { font-size: 1.33rem; margin: 10px 0 0; letter-spacing: -.038em; }
.portal-card p { margin: 8px 0 18px; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.portal-card .portal-file-meta { font-size: .79rem; font-weight: 650; margin: 0; }
.portal-card .portal-file-link, .portal-card .portal-unavailable {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  border-top: 1px solid var(--line);
  margin: auto 0 0;
  padding-top: 8px;
  font-size: .89rem;
}
.portal-file-link { color: var(--accent); font-weight: 660; text-decoration: none; }
.portal-file-link:hover { text-decoration: underline; }
.portal-unavailable { color: var(--muted); }
.portal-support {
  margin-top: 44px;
  padding: clamp(20px, 3vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #eaece6;
  border-radius: 16px;
  flex-wrap: wrap;
}
.portal-support h2 { margin-bottom: 5px; }
.portal-support p { margin: 0; color: var(--muted); }
.portal-support a { font-weight: 620; }

@media (max-width: 920px) {
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .portal-login { grid-template-columns: 1fr; min-height: 0; border-radius: 18px; }
  .portal-collage { aspect-ratio: 16 / 9; }
  .portal-hero-photo { object-position: center; }
  .portal-inset-photo { width: 22%; border-width: 2px; border-radius: 8px; bottom: 10%; }
  .portal-login-panel { padding: 30px clamp(17px, 6vw, 44px); }
  .portal-login-copy form { margin-top: 22px; }
}
@media (max-width: 530px) {
  .portal-grid { grid-template-columns: 1fr; }
  .portal-bar, .portal-footer { min-height: 56px; padding-block: 9px; }
}
