.home-loadline {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 3px;
  background: var(--copper);
  pointer-events: none;
  transform-origin: left;
  animation: home-loadline .48s ease-out both;
}

@keyframes home-loadline {
  0% { transform: scaleX(.06); }
  76% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

body[data-page="home"] {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

[data-page="home"] main {
  display: grid;
  flex: 1;
}

[data-page="home"] .head-in {
  max-width: 1392px;
  padding-inline: clamp(28px, 5vw, 72px);
}

.home-stage {
  position: relative;
  display: grid;
  isolation: isolate;
  background: var(--night);
}

.home-landscape,
.home-stage::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-landscape {
  z-index: -2;
}

.home-landscape img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 59%;
}

.home-stage::before {
  content: "";
  z-index: -1;
  background:
    linear-gradient(90deg, #0b1724e8 0%, #0b172494 41%, #0b172429 79%),
    linear-gradient(0deg, var(--night), #0b172426 31%, transparent 62%);
}

.home-stage-in {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
  align-items: center;
  gap: clamp(32px, 5vw, 78px);
  width: min(100%, 1392px);
  margin-inline: auto;
  padding: clamp(44px, 7vh, 92px) clamp(28px, 5vw, 72px);
}

.home-brand {
  min-width: 0;
}

.home-brand h1 {
  margin: 0;
  font-size: clamp(50px, 6.3vw, 96px);
  line-height: 1.06;
  text-wrap: initial;
  overflow-wrap: anywhere;
}

.home-motto {
  margin: 24px 0 0;
  color: var(--copper);
  font: 700 clamp(30px, 4.1vw, 60px)/1.18 var(--serif);
}

.home-motto span {
  display: block;
}

.home-description {
  max-inline-size: 24em;
  margin: 24px 0 0;
  color: var(--mist);
  white-space: pre-line;
}

.home-entry svg {
  width: 26px;
  height: 26px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}

.home-entries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.25vw, 20px);
}

.home-entry {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(140px, 17vh, 184px);
  gap: 10px;
  padding: clamp(16px, 1.8vw, 28px);
  overflow: hidden;
  border: 1px solid #a5b5c388;
  background: #0b1724e8;
  color: var(--ivory);
  transition: color .28s, border-color .28s;
}

.home-entry:disabled {
  appearance: none;
  text-align: left;
  font: inherit;
  opacity: 1;
  cursor: default;
}

.home-entry::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--copper);
  transform: translateY(101%);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}

.home-entry-copy {
  display: grid;
  gap: 8px;
}

.home-entry strong {
  font: 700 clamp(20px, 1.9vw, 28px)/1.3 var(--serif);
  transition: letter-spacing .35s cubic-bezier(.2, .8, .2, 1);
}

.home-entry-copy > span {
  color: var(--mist);
  font-size: 14px;
  line-height: 1.55;
  transition: color .28s;
}


.home-entry-status {
  display: inline-block;
  align-self: flex-end;
  padding: 2px 8px;
  border: 1px solid currentColor;
  color: var(--copper);
  font-size: 11px;
  white-space: nowrap;
}

.home-entry svg {
  align-self: flex-end;
  color: var(--copper);
}

.home-entry:any-link:is(:hover, :focus-visible) {
  color: var(--night);
  border-color: var(--copper);
}

.home-entry:any-link:is(:hover, :focus-visible)::before {
  transform: translateY(0);
}

.home-entry:any-link:is(:hover, :focus-visible) strong {
  letter-spacing: .035em;
}

.home-entry:any-link:is(:hover, :focus-visible) :is(.home-entry-copy > span, svg) {
  color: var(--night);
}

.home-entry:any-link:is(:hover, :focus-visible) svg {
  transform: translate(3px, -3px) rotate(-38deg);
}

.home-entry:focus-visible {
  outline-color: var(--ivory);
}

@media (max-width: 820px) {
  [data-page="home"] .head-in {
    padding-inline: 18px;
  }

  .home-stage-in {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 36px 18px 48px;
  }

  .home-landscape img {
    object-position: 58% center;
  }

  .home-stage::before {
    background: linear-gradient(110deg, #0b1724f0, #0b17246b), linear-gradient(0deg, var(--night), transparent 40%);
  }

  .home-brand h1 {
    font-size: clamp(46px, 12vw, 80px);
  }

  .home-motto {
    margin-top: 14px;
    font-size: clamp(23px, 5.8vw, 38px);
  }

  .home-motto span {
    display: inline;
  }

  .home-description {
    margin-top: 12px;
    font-size: 14px;
  }

  .home-entries {
    gap: 10px;
  }

  .home-entry {
    min-height: 122px;
    gap: 10px;
    padding: 13px;
  }

  .home-entry strong {
    font-size: 17px;
  }

  .home-entry-copy > span {
    font-size: 12px;
  }

  .home-entry svg {
    width: 22px;
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-entry, .home-entry::before, .home-entry strong, .home-entry svg { transition: none; }
  .home-loadline {
    display: none;
  }
}

/* Application-directory adjustments stay local to the apps page. */
body[data-page="apps"] .apps-overview {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}

body[data-page="apps"] .apps-overview .lead {
  margin-bottom: 0;
}

body[data-page="apps"] .apps-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}

body[data-page="apps"] .apps-shortcuts a {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 18px 0;
}

body[data-page="apps"] .app-quiz {
  padding-top: 44px;
  padding-bottom: 44px;
}

body[data-page="apps"] .app-quiz .page-title {
  font-size: clamp(30px, 3.5vw, 44px);
  line-height: 1.2;
}

@media (max-width: 760px) {
  body[data-page="apps"] .apps-overview {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  body[data-page="apps"] .app-quiz {
    padding-top: 36px;
    padding-bottom: 36px;
  }
}

@media (max-width: 480px) {
  body[data-page="apps"] .apps-shortcuts {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page="apps"] .apps-shortcuts a {
    padding-block: 14px;
  }
}

/* A pale landscape keeps the same homepage composition in daylight. */
html[data-reading-theme="day"] .home-stage { background:#e9e5dc; }
html[data-reading-theme="day"] .home-stage::before {
  background:
    linear-gradient(90deg,#f6f2e8f5 0%,#f6f2e8d8 36%,#f6f2e869 72%),
    linear-gradient(0deg,#e6e1d5cc 0%,transparent 48%);
}
html[data-reading-theme="day"] .home-description { color:#263b49; }
html[data-reading-theme="day"] .home-entry {
  background:#fffdf8ed;
  color:#172633;
  border-color:#867a66;
}
html[data-reading-theme="day"] .home-entry::before { background:#e8dbc1; }
html[data-reading-theme="day"] .home-entry:focus-visible { outline-color:#76572f; }
html[data-reading-theme="day"] .home-entry-copy > span { color:#435462; }
@media(max-width:700px) {
  html[data-reading-theme="day"] .home-stage::before {
    background:linear-gradient(180deg,#f6f2e8ef 0%,#f6f2e8bb 48%,#e6e1d59c);
  }
}

/* A shared search entry sits directly below the six existing destinations. */
.home-actions{min-width:0}.home-search{margin-top:20px;color:var(--ivory)}
.home-search label{display:block;font-size:15px;font-weight:500;margin-bottom:8px}
.home-search-row{display:flex;gap:10px;align-items:stretch}
.home-search input{min-width:0;width:100%;min-height:46px;padding:10px 13px;border:1px solid #a5b5c3;background:#0b1724eb;color:#f1eadc;font:inherit;border-radius:0;caret-color:var(--copper)}
.home-search input::placeholder{color:#c3cfd7;opacity:1;font-size:14px}
.home-search button{flex:none;min-width:78px;min-height:46px;border:1px solid var(--copper);background:var(--copper);color:var(--night);padding:8px 18px;font:500 15px var(--sans);cursor:pointer}
.home-search button:hover{background:#f0cd92}.home-search p{font-size:13px;color:var(--mist);line-height:1.6;margin:9px 0 0}
.home-search :focus-visible{outline:3px solid var(--ivory);outline-offset:3px}
@media(max-width:820px){.home-search{margin-top:18px}.home-search input::placeholder{font-size:12px}.home-search-row{gap:8px}.home-search button{min-width:64px;padding-inline:12px}}
