/* 1. Default theme and typography: colors are generated from _data/shared/themes.yml. */
.is-portal {
  --bg: #f8faf4;
  --header-bg: #f8faf4;
  --surface: #f2f6ed;
  --card: #ffffff;
  --text: #273831;
  --muted: #5e6c64;
  --line: #dce2da;
  --line-strong: #acbdb0;
  --accent: #3c6552;
  --accent-soft: #edf4e7;
  --accent-line: #bed0bf;
  --portal-deep: #436c56;
  --portal-green: #49745f;
  --portal-green-soft: #4d775f;
  --portal-on-dark: #ffffff;
  --portal-muted-on-dark: #f3f8ef;
  --portal-highlight: #eef6df;
  --portal-highlight-hover: #f8fbee;
  --portal-art: #cee4c8;
  --portal-shadow: #2c493e0a;
  --portal-shadow-hover: #2c493e12;
  color-scheme: light;
  font-size: 16px;
  font-weight: 500;
}
.is-portal * { letter-spacing: 0; }
.is-portal .container { width: min(1200px, calc(100% - 64px)); }
.is-portal h1 { font-size: 40px; line-height: 1.18; font-weight: 700; }
.is-portal h2 { font-size: 24px; line-height: 1.3; }
.is-portal h3 { font-size: 21px; line-height: 1.35; }
/* 2. Header: logo, navigation, and mobile menu. */
.portal-header { position: relative; height: auto; backdrop-filter: none; border-bottom: 0; }
.portal-header .header-inner { padding-top: 30px; display: flex; flex-wrap: wrap; gap: 24px; }
.portal-header-note { margin-left: auto; color: var(--muted); font-size: 12px; }
.portal-brand { display: inline-flex; align-items: center; }
/* Show the selected shadow logo without resampling the asset. Crop only its
   unused canvas margins; multiply blends the white matte into the header. */
.portal-brand-logo { position: relative; display: block; width: 300px; aspect-ratio: 1660 / 390; overflow: hidden; background: transparent; mix-blend-mode: multiply; }
.portal-brand-logo img { position: absolute; width: 130.722892%; max-width: none; height: auto; left: -2.409639%; top: -43.589744%; }
.portal-brand-logo-skyseed { overflow: visible; mix-blend-mode: normal; }
.portal-brand-logo-skyseed img { width: 100%; max-width: none; height: auto; left: 0; top: 50%; transform: translateY(-50%) scaleY(1.22); transform-origin: center; }
.portal-header .main-navigation { width: 100%; order: 3; margin: 0; display: flex; gap: 4px; padding: 5px; background: var(--portal-green); border: 0; border-radius: 10px; }
.portal-header .main-navigation > a, .portal-resources > summary { display: inline-flex; justify-content: center; align-items: center; gap: 8px; color: var(--portal-on-dark); font-size: 13px; font-weight: 600; padding: 10px 13px; border-radius: 6px; width: auto; }
.portal-header .main-navigation > a:hover, .portal-header .main-navigation > a[aria-current] { background: #ffffff1c; color: var(--portal-on-dark); }
.portal-header .main-navigation > a:focus-visible, .portal-resources > summary:focus-visible { outline-color: var(--portal-highlight); outline-offset: -3px; }
.portal-header .main-navigation > a:last-child { margin-left: 0; border-right: 0; }
.portal-header .main-navigation .icon { width: 15px; height: 15px; }
.portal-header .menu-toggle { margin-left: auto; }
/* Shared resource links open without adding another destination page. */
.portal-resources { position: relative; }
.portal-resources > summary { cursor: pointer; list-style: none; white-space: nowrap; }
.portal-resources > summary::-webkit-details-marker { display: none; }
.portal-resources > summary:hover, .portal-resources > summary.is-current, .portal-resources[open] > summary { background: #ffffff1c; }
.portal-resources-chevron { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.portal-resources[open] .portal-resources-chevron { transform: translateY(1px) rotate(225deg); }
.portal-resources-links { position: absolute; z-index: 1; top: calc(100% + 10px); left: 0; width: 196px; max-width: calc(100vw - 48px); padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: 0 10px 28px var(--portal-shadow-hover); }
.portal-resources-links a { display: block; padding: 10px 14px; border-radius: 6px; color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
.portal-resources-links a:hover, .portal-resources-links a[aria-current] { background: var(--accent-soft); }
.portal-resources-links a:focus-visible { outline-offset: -2px; }
/* 3. Homepage hero: introduction, actions, and decorative illustration. */
.portal-intro { position: relative; display: grid; grid-template-columns: 1.5fr 1fr; align-items: center; padding: 42px 46px; margin-block: 22px 32px; border-radius: 18px; overflow: hidden; background: linear-gradient(115deg, var(--portal-deep), var(--portal-green-soft)); color: var(--portal-on-dark); }
.portal-intro-copy { position: relative; z-index: 1; }
.portal-intro .portal-eyebrow { color: var(--portal-highlight); letter-spacing: .16em; font-size: 10px; margin-bottom: 16px; }
.is-portal .portal-intro h1 { font-size: clamp(32px, 3.7vw, 49px); letter-spacing: -.035em; }
.portal-intro-tagline { color: var(--portal-highlight); font-size: 22px; font-weight: 500; margin-top: 8px; }
.portal-intro-description { max-width: 590px; font-size: 14px; line-height: 1.85; color: var(--portal-muted-on-dark); margin-top: 20px; }
.portal-intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 26px; }
.portal-intro-actions a { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; }
.portal-hero-button { padding: 11px 17px; background: var(--portal-highlight); color: var(--portal-deep); border-radius: 7px; }
.portal-hero-button:hover { background: var(--portal-highlight-hover); }
.portal-intro-actions .icon { width: 15px; height: 15px; }
.portal-network-art { width: 100%; height: auto; }
/* 4. Homepage project grid and cards. */
.portal-home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 28px; align-items: start; }
.portal-eyebrow { color: var(--accent); font-size: 12px; text-transform: uppercase; font-weight: 700; margin-bottom: 12px; }
.portal-projects { padding-block: 0 32px; min-width: 0; }
.portal-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.portal-section-heading > span { color: var(--muted); font-size: 13px; }
.portal-project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.portal-project { display: flex; flex-direction: column; min-width: 0; padding: 12px 12px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 14px var(--portal-shadow); transition: border-color .2s, box-shadow .2s; }
.portal-project:hover { border-color: var(--line-strong); box-shadow: 0 8px 24px var(--portal-shadow-hover); }
.portal-project > :not(.portal-project-image) { margin-left: 6px; margin-right: 6px; }
.portal-project h3 { font-size: 19px; line-height: 1.35; letter-spacing: -.02em; }
.portal-project-image { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); border-radius: 6px; }
.portal-project-image img { width: 100%; height: 100%; object-fit: contain; }
.portal-project-placeholder { background: var(--surface); color: var(--accent); flex-direction: column; gap: 12px; }
.portal-project-placeholder .icon { width: 40px; height: 40px; }
.portal-project-placeholder > span { font-size: 14px; font-weight: 600; text-align: center; padding-inline: 16px; }
.portal-project-placeholder small { color: var(--muted); font-size: 12px; }
.portal-project-category { font-size: 10px; color: var(--accent); margin-block: 20px 8px; font-weight: 600; }
.portal-project h3 a:hover { color: var(--accent); text-decoration: underline; }
.portal-project-description { margin-block: 12px 24px; font-size: 13px; line-height: 1.8; color: var(--muted); }
.portal-project-more { display: inline-flex; align-items: center; align-self: start; gap: 10px; margin-top: auto; color: var(--accent); font-size: 12px; font-weight: 700; padding-block: 4px; }
/* 5. Homepage sidebar: team, resources, and news. */
.portal-sidebar { border-left: 1px solid var(--line); padding-left: 24px; margin-top: 5px; }
.portal-sidebar .portal-eyebrow { font-size: 10px; line-height: 1.7; margin-bottom: 13px; }
.is-portal .portal-sidebar h2 { font-size: 16px; line-height: 1.5; }
.portal-sidebar p { color: var(--muted); font-size: 12px; line-height: 1.85; }
.portal-sidebar .portal-sidebar-person { margin-bottom: 6px; }
.portal-sidebar .portal-sidebar-person a { display: inline; font: inherit; color: var(--accent); }
.portal-sidebar-meta { display: block; margin-top: 3px; font-size: 11px; line-height: 1.65; color: var(--muted); }
.portal-sidebar .portal-sidebar-email-label { margin: 0 0 2px; color: var(--text); font-weight: 600; }
.portal-sidebar .portal-sidebar-email { margin: 0; }
.portal-sidebar a { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 600; color: var(--accent); }
.portal-sidebar a:hover { text-decoration: underline; text-underline-offset: 4px; }
.portal-sidebar .icon { width: 14px; height: 14px; }
.portal-sidebar-resources, .portal-sidebar-news { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.portal-sidebar-resources ul { list-style: none; padding: 0; margin: 13px 0 0; }
.portal-sidebar-resources a { display: flex; justify-content: space-between; padding-block: 7px; }
.portal-sidebar-news-content { min-height: 72px; margin-top: 13px; }
.portal-sidebar .portal-sidebar-note { font-size: 10px; margin-top: 24px; }
.portal-sidebar-note > span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
.portal-project-more:hover { text-decoration: underline; }
.portal-project-more .icon { width: 17px; height: 17px; }
/* 7. Shared footer: introduction, links, and team. */
.portal-footer { width: min(1200px, calc(100% - 64px)); margin: 8px auto 28px; border-radius: 14px; background: var(--portal-deep); color: var(--portal-on-dark); }
.is-portal .portal-footer .container { width: calc(100% - 64px); }
.portal-footer-main { display: grid; grid-template-columns: 1.15fr 1fr .85fr 1.35fr; gap: 36px; padding-block: 48px 40px; }
.portal-footer-main > * { min-width: 0; }
.portal-footer a { display: inline-flex; gap: 7px; align-items: center; color: var(--portal-on-dark); }
.portal-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.portal-footer a:focus-visible { outline-color: var(--portal-on-dark); }
.portal-footer .icon { width: 14px; height: 14px; }
.portal-footer .portal-footer-brand { font-size: 21px; font-weight: 700; line-height: 1.3; }
.portal-footer p { font-size: 13px; line-height: 1.8; color: var(--portal-muted-on-dark); margin-top: 16px; }
.portal-footer-motto { display: block; margin-top: 22px; font-size: 12px; color: var(--accent-soft); }
.is-portal .portal-footer h2 { font-size: 13px; font-weight: 700; line-height: 1.5; margin-bottom: 17px; color: var(--portal-on-dark); }
.portal-footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.portal-footer-links a { font-size: 13px; line-height: 1.6; }
.portal-footer .portal-footer-author { font-size: 15px; font-weight: 600; }
.portal-footer-role { display: block; margin-top: 3px; font-size: 11px; color: var(--portal-muted-on-dark); }
.portal-footer-team { scroll-margin-top: 24px; border-radius: 4px; }
.portal-footer-team:target { outline: 2px solid var(--portal-highlight); outline-offset: 12px; }
.portal-footer-team:target a[href^="mailto:"] { text-decoration: underline; text-underline-offset: 4px; }
.portal-footer-team p { margin-block: 12px; }
.portal-footer-team > a { font-size: 12px; overflow-wrap: anywhere; }
.portal-footer .portal-footer-team-link { display: flex; width: fit-content; margin-top: 12px; }
.portal-footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 20px; border-top: 1px solid #ffffff30; color: var(--portal-muted-on-dark); font-size: 11px; }
.portal-footer-back .icon { transform: rotate(-90deg); }
.portal-footer-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
/* 8. Project details: breadcrumbs, overview, and resources. */
.portal-breadcrumb { display: flex; flex-wrap: wrap; gap: 12px; padding-block: 26px 18px; font-size: 13px; color: var(--muted); }
.portal-breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.emulator-intro { padding-block: 10px 0; }
.emulator-section-nav { display: flex; flex-wrap: wrap; gap: 14px 30px; border-bottom: 1px solid var(--line); padding-block: 28px 18px; }
.emulator-section-nav a { font-size: 14px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 7px; }
.emulator-section-nav a:hover { text-decoration: underline; }
.emulator-section-nav .icon { width: 15px; height: 15px; }
.emulator-section { padding-block: 32px 34px; border-bottom: 1px solid var(--line); scroll-margin-top: 20px; }
.emulator-section:last-child { border-bottom: 0; }
.emulator-section h2 { margin-bottom: 22px; }
.emulator-overview { max-width: none; font-size: 18px; line-height: 1.7; color: var(--muted); }
.emulator-overview::after { content: ""; display: block; clear: both; }
.emulator-overview-image { float: left; width: min(34%, 360px); height: auto; aspect-ratio: 8 / 5; object-fit: cover; margin: 0 30px 14px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.emulator-overview p + p { margin-top: 18px; }
.emulator-resource-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.emulator-resource { display: grid; grid-template-columns: 64px minmax(0, 1fr) 100px; align-items: center; gap: 24px; padding-block: 22px; border-bottom: 1px solid var(--line); }
.emulator-project-resource { grid-template-columns: minmax(0, 1fr) auto; }
.emulator-resource-type { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.emulator-resource h3 { font-size: 16px; font-weight: 600; }
.emulator-resource h3 a:hover { color: var(--accent); text-decoration: underline; }
.emulator-resource p { font-size: 14px; color: var(--muted); margin-top: 5px; }
.emulator-resource > a { justify-self: end; display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--accent); font-weight: 600; padding: 8px 0; }
.emulator-resource > a:hover { text-decoration: underline; }
.emulator-resource .icon { width: 16px; height: 16px; }
.emulator-project-resource h3 a { display: inline-flex; align-items: center; gap: 12px; }
.emulator-project-resource h3 .fa { flex-shrink: 0; font-size: 24px; color: var(--portal-green); opacity: 0.75; }
.emulator-resource-pending { justify-self: end; color: var(--muted); font-size: 13px; }
.is-portal:not(.is-home) main > .container { background: var(--card); padding: 0 32px 20px; margin-top: 22px; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 14px; }
/* Team page: three clearly separated sections, with reusable member cards. */
.team-intro { padding: 12px 0 32px; }
.team-intro h1 { margin-block: 10px 16px; }
.team-intro > p:last-of-type { max-width: 660px; color: var(--muted); font-size: 16px; }
.team-section { padding: 30px 0; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.team-section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.team-section-number { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 8px; padding: 5px 10px; font: 12px var(--mono); }
.team-members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.team-member { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.team-lead .team-member { border-color: var(--accent-line); background: var(--accent-soft); }
.team-member-initial { position: relative; overflow: hidden; display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--card); color: var(--accent); font-weight: 700; font-size: 20px; }
.team-member-name { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; overflow-wrap: anywhere; }
.team-member-name strong { font-size: 18px; }
.team-member-name a { color: var(--accent); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.team-member-affiliation, .team-section-note, .team-pending { color: var(--muted); font-size: 14px; }
.team-section-note { margin-bottom: 16px; }
.team-pending { padding: 24px; border: 1px dashed var(--line-strong); border-radius: 12px; }

/* 9. Responsive layout: medium desktop screens. */
@media (min-width: 961px) and (max-width: 1150px) {
  .portal-home-grid { grid-template-columns: minmax(0, 1fr) 185px; gap: 20px; }
  .portal-project-grid { gap: 12px; }
  .portal-project h3 { font-size: 17px; }
  .portal-sidebar { padding-left: 18px; }
}
/* 10. Responsive layout: tablets and collapsible navigation. */
@media (max-width: 960px) {
  .portal-header .header-inner { gap: 18px; padding-block: 18px 0; }
  .portal-header .menu-toggle { display: none; }
  .portal-header-note { display: none; }
  .js-enabled .portal-header .menu-toggle { display: block; }
  .portal-header .main-navigation { flex-wrap: wrap; align-items: flex-start; }
  .js-enabled .portal-header .main-navigation:not(.is-open) { display: none; }
  .portal-header .main-navigation > a, .portal-resources { flex: 1 0 33%; }
  .portal-header .main-navigation > a, .portal-resources > summary { padding: 12px; }
  .portal-resources > summary { display: flex; }
  .portal-resources-links { position: static; width: 100%; margin-top: 6px; box-shadow: none; }
  .portal-header .main-navigation > a:last-child { margin: 0; }
  .portal-header:has(.main-navigation:not(.is-open)) { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
  .portal-project-grid { gap: 20px; }
  .portal-home-grid { grid-template-columns: 1fr; gap: 0; }
  .portal-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; border-left: 0; border-top: 1px solid var(--line); padding: 24px 0; }
  .portal-sidebar-resources { border-top: 0; margin: 0; padding: 0; }
  .portal-sidebar-news { grid-column: 1 / -1; margin: 0; }
  .portal-sidebar .portal-sidebar-note { grid-column: 1 / -1; margin: 0; }
  .portal-intro { padding: 32px; grid-template-columns: 1.7fr 1fr; }
  .portal-project h3 { font-size: 19px; }
  .portal-footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
}
/* 11. Responsive layout: single-column mobile pages. */
@media (max-width: 700px) {
  .is-portal .container { width: calc(100% - 36px); }
  .portal-brand-logo { width: 240px; }
  .is-portal h1 { font-size: 30px; }
  .is-portal h2 { font-size: 22px; }
  .portal-intro { padding: 28px 24px; margin-top: 16px; grid-template-columns: 1fr; }
  .portal-network-art { position: absolute; right: -85px; top: -35px; width: 270px; opacity: .2; }
  .portal-intro-tagline { font-size: 18px; }
  .portal-intro-description { font-size: 13px; }
  .portal-intro-actions { gap: 18px; }
  .emulator-overview-image { float: none; width: 100%; max-width: none; margin: 0 0 20px; }
  .portal-section-heading > span { display: none; }
  .portal-project-grid { grid-template-columns: 1fr; gap: 32px; }
  .portal-project { padding: 14px 14px 22px; }
  .portal-project h3 { font-size: 22px; }
  .portal-project-category { margin-top: 16px; }
  .portal-project-description { margin-bottom: 14px; }
  .portal-footer { width: calc(100% - 24px); margin-bottom: 12px; }
  .is-portal .portal-footer .container { width: calc(100% - 40px); }
  .is-portal:not(.is-home) main > .container { padding-inline: 20px; }
  .portal-footer-main { gap: 30px 20px; padding-block: 36px 30px; }
  .portal-footer-about, .portal-footer-team { grid-column: 1 / -1; }
  .portal-footer-bottom { flex-wrap: wrap; gap: 12px 20px; }
  .portal-footer-bottom > span:first-child { flex-basis: 100%; }
  .portal-breadcrumb { font-size: 12px; }
  .emulator-section-nav { gap: 14px 22px; }
  .emulator-section-nav a { font-size: 13px; }
  .emulator-resource { grid-template-columns: 42px minmax(0, 1fr); gap: 10px 16px; }
  .emulator-resource > a, .emulator-resource-pending { grid-column: 2; justify-self: start; }
  .emulator-project-resource { grid-template-columns: minmax(0, 1fr) auto; }
  .emulator-project-resource > a { grid-column: auto; justify-self: end; }
  .emulator-resource-type { align-self: start; padding-top: 2px; }
  .emulator-resource h3 { font-size: 15px; }
  .emulator-resource p { font-size: 13px; }
}
/* 12. Responsive layout: narrow-screen logo and controls. */
@media (max-width: 380px) {
  .portal-brand-logo { width: 210px; }
  .portal-header .menu-toggle { padding: 7px; }
}

/* 13. Not-found page: return to the homepage. */
.portal-not-found { padding: 48px 32px !important; }
.portal-not-found > p { margin-bottom: 20px; }
.portal-not-found h1 { margin-bottom: 20px; }

/* 14. Project screenshots: readable captions and uncropped images. */
.screenshot-gallery { display: grid; gap: 32px; }
.emulator-screenshot { margin: 0; min-width: 0; }
.emulator-screenshot > a { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.emulator-screenshot img { display: block; width: 100%; max-height: 560px; object-fit: contain; }
.emulator-screenshot figcaption { padding-top: 16px; }
.emulator-screenshot figcaption p { margin-top: 8px; color: var(--muted); }

/* GitHub avatars retain the existing circular card dimensions. */
.team-member-avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.team-member-avatar[hidden] { display: none; }
