* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--page-text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

/* ---------------------------------------------------------
   Homepage
   --------------------------------------------------------- */

.home-shell {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 1.2rem 4rem;
}

.hero {
  margin-bottom: 2.3rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: .4rem;

  color: var(--muted);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .03em;
}

.hero h1 {
  margin: 0 0 .55rem;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.08;
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero .orion-motto,
.page-heading .orion-motto {
  margin-bottom: .55rem;
  color: var(--text);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.hero .orion-introduction {
  max-width: 760px;
  font-size: 1.08rem;
  line-height: 1.65;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.orion-interest-grid {
  margin-bottom: 1rem;
}


.portal-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;

  min-height: 130px;
  padding: 1.2rem;

  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: .8rem;

  color: var(--page-text);
  text-decoration: none;

  transition:
    transform .12s ease,
    border-color .12s ease,
    box-shadow .12s ease;
}

.portal-card:hover,
.portal-card:focus {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 5px 18px rgba(0,0,0,.08);
}

.portal-icon {
  font-size: 1.9rem;
  line-height: 1;
}

.portal-card h2 {
  margin: 0 0 .3rem;
  font-size: 1.15rem;
}

.portal-card p {
  margin: 0;
  color: var(--muted);
  font-size: .94rem;
}

.server-note {
  margin-top: 2rem;
  padding: .9rem 1rem;

  background: var(--soft-bg);
  border-radius: .6rem;

  color: var(--muted);
  font-size: .9rem;
}

/* ---------------------------------------------------------
   Existing utility pages
   --------------------------------------------------------- */

body:not(.home) > h1,
body:not(.home) > h2,
body:not(.home) > p,
body:not(.home) > ul,
body:not(.home) > form,
body:not(.home) > hr {
  width: min(760px, calc(100% - 2.4rem));
  margin-left: auto;
  margin-right: auto;
}

body:not(.home) > h1,
body:not(.home) > h2 {
  margin-top: 2rem;
}

body:not(.home) > p,
body:not(.home) > ul {
  text-align: left;
}

a {
  color: var(--link);
}

.download ul {
  list-style: none;
  padding-left: 0;
}

.download li {
  margin: .45rem 0;
}

form {
  text-align: left;
}

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

input,
textarea,
select {
  width: 100%;
  max-width: 640px;
  padding: .65rem .7rem;
  margin: .25rem 0 .8rem;

  color: var(--page-text);
  background: var(--card-bg);

  border: 1px solid var(--input-border);
  border-radius: .4rem;
}

button,
input[type="submit"] {
  width: auto;
  padding: .6rem .9rem;

  border: 0;
  border-radius: .4rem;

  background: var(--button-bg);
  color: var(--button-text);

  cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
  opacity: .9;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

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

@media (max-width: 520px) {
  .home-shell {
    padding-top: 2rem;
  }

  .portal-card {
    min-height: auto;
  }
}

/* ---------------------------------------------------------
   Modern utility pages
   --------------------------------------------------------- */

.page-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.2rem 4rem;
}

.page-heading {
  margin-bottom: 1.5rem;
}

.page-heading h1 {
  margin: 0 0 .35rem;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.page-heading p {
  margin: 0;
  color: var(--muted);
}

.content-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: .8rem;
  padding: 1.2rem;
}

.download-tools {
  display: flex;
  gap: .8rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.download-count {
  color: var(--muted);
  font-size: .9rem;
  white-space: nowrap;
}

.file-search {
  width: min(360px, 100%);
  margin: 0;
}

.file-list {
  display: grid;
  gap: .55rem;
}

.file-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto auto;
  gap: .8rem;
  align-items: center;

  padding: .8rem .9rem;

  border: 1px solid var(--card-border);
  border-radius: .55rem;

  color: var(--page-text);
  text-decoration: none;

  background: var(--card-bg);
}

.file-row:hover,
.file-row:focus {
  border-color: var(--accent);
  background: var(--soft-bg);
}

.file-icon {
  font-size: 1.25rem;
  text-align: center;
}

.file-name {
  overflow-wrap: anywhere;
  font-weight: 600;
}

.file-meta {
  color: var(--muted);
  font-size: .85rem;
  white-space: nowrap;
}

.download-arrow {
  font-size: 1rem;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 700px) {
  .download-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .file-search {
    width: 100%;
    max-width: none;
  }

  .file-row {
    grid-template-columns: 2rem minmax(0, 1fr) auto;
  }

  .file-date {
    display: none;
  }
}

/* ---------------------------------------------------------
   Upload page
   --------------------------------------------------------- */

.upload-card {
  max-width: 720px;
}

.upload-zone {
  margin-top: .4rem;
  padding: 2rem 1.4rem;

  border: 2px dashed var(--card-border);
  border-radius: .75rem;

  background: var(--soft-bg);
  text-align: center;
}

.upload-zone-icon {
  display: block;
  margin-bottom: .6rem;
  font-size: 2.4rem;
}

.upload-zone h2 {
  margin: 0 0 .35rem;
}

.upload-zone p {
  margin: 0 0 1.2rem;
  color: var(--muted);
}

.upload-file-input {
  width: 100%;
  max-width: 520px;
  margin: 0 auto 1rem;
}

.upload-submit {
  display: inline-block;
  min-width: 150px;
  padding: .7rem 1rem;

  background: var(--button-bg);
  color: var(--button-text);

  border: 0;
  border-radius: .45rem;

  font-weight: 700;
  cursor: pointer;
}

.upload-submit:hover,
.upload-submit:focus {
  opacity: .9;
}

.upload-status {
  margin-bottom: 1.2rem;
  padding: 1rem 1.1rem;

  border-radius: .6rem;
  border: 1px solid var(--card-border);
}

.upload-status.success {
  border-left: 5px solid #2e7d32;
}

.upload-status.error {
  border-left: 5px solid #c62828;
}

.upload-status strong {
  display: block;
  margin-bottom: .25rem;
}

.upload-help {
  margin-top: 1rem;
  color: var(--muted);
  font-size: .9rem;
}

/* ---------------------------------------------------------
   Useful Links page
   --------------------------------------------------------- */

.links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}

.link-card {
  display: flex;
  align-items: flex-start;
  gap: .9rem;

  padding: 1rem;

  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: .7rem;

  color: var(--page-text);
  text-decoration: none;
}

.link-card:hover,
.link-card:focus {
  border-color: var(--accent);
  background: var(--soft-bg);
}

.link-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.link-card strong {
  display: block;
  margin-bottom: .2rem;
  font-size: 1.03rem;
}

.link-card small {
  color: var(--muted);
  line-height: 1.4;
}

.links-section-title {
  margin: 1.6rem 0 .7rem;
  font-size: 1.05rem;
  color: var(--muted);
}

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

/* ---------------------------------------------------------
   Contact page
   --------------------------------------------------------- */

.contact-card {
  max-width: 680px;
}

.contact-person {
  display: flex;
  align-items: center;
  gap: 1rem;

  padding: 1.2rem;

  border: 1px solid var(--card-border);
  border-radius: .7rem;

  background: var(--card-bg);
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 3.2rem;
  width: 3.2rem;
  height: 3.2rem;

  border-radius: 50%;
  background: var(--soft-bg);

  font-size: 1.65rem;
}

.contact-details h2 {
  margin: 0 0 .2rem;
  font-size: 1.2rem;
}

.contact-details p {
  margin: .15rem 0;
  color: var(--muted);
}

.contact-email {
  display: inline-block;
  margin-top: .45rem;

  font-weight: 700;
  text-decoration: none;
}

.contact-email:hover,
.contact-email:focus {
  text-decoration: underline;
}

.contact-note {
  margin-top: 1rem;
  padding: .9rem 1rem;

  color: var(--muted);
  background: var(--soft-bg);

  border-radius: .55rem;
  font-size: .9rem;
}

@media (max-width: 520px) {
  .contact-person {
    align-items: flex-start;
  }
}



.site-brand .orion-brand-top {
  font-size: .92rem;
  font-weight: 700;
}

.site-brand .orion-brand-bottom {
  margin-top: .12rem;
  font-size: .92rem;
  font-weight: 700;
}



/* Artwork stays contained; library colors carry through quiet reading areas. */
.home-shell { max-width: 1120px; padding-top: 1.5rem; }
.hero-banner {
  display: block;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: contain;
  border: 1px solid var(--orion-gold);
  border-radius: .8rem;
  margin-bottom: 1.6rem;
  background: #081525;
}
.hero h1,
.page-heading h1 { font-family: Georgia, "Times New Roman", serif; }
.eyebrow { color: var(--walnut); }
.portal-card { border-top: 2px solid var(--walnut); }
.server-note { border: 1px solid var(--accent); }
.about-emblem {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin: 0 0 1.1rem;
}
.content-panel + .content-panel { margin-top: 1rem; }
input::placeholder,
textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .portal-card { transition: none; }
  .portal-card:hover, .portal-card:focus { transform: none; }
}

.orion-section-heading {
  margin: 1.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
}
