:root {
  color-scheme: dark;
  --ink: #080c15;
  --ink-soft: #0d1422;
  --panel: #121c2c;
  --ivory: #f3eee2;
  --muted: #aab2bd;
  --gold: #f0b23f;
  --gold-hot: #ffc75b;
  --cyan: #55c7d7;
  --line: rgba(243, 238, 226, .16);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .7rem 1rem;
  background: var(--ivory);
  color: var(--ink);
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1320px, calc(100% - 4rem));
  margin: 0 auto;
  padding: 1.35rem 0;
  border-bottom: 1px solid rgba(255,255,255,.18);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: white;
  font-size: .88rem;
  line-height: 1.05;
  letter-spacing: .02em;
  text-decoration: none;
}
.brand strong { font-family: var(--serif); font-size: 1.15rem; font-style: italic; font-weight: 600; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid rgba(255,255,255,.55);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.35rem;
  transform: rotate(45deg);
}
.brand-mark::after { content: "A"; transform: rotate(-45deg); }
.site-header nav { display: flex; align-items: center; gap: 2rem; }
.site-header nav a {
  color: rgba(255,255,255,.78);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-header nav a:hover { color: white; }
.site-header .nav-download { color: var(--gold); }

.hero {
  position: relative;
  min-height: 94vh;
  display: grid;
  align-items: center;
  isolation: isolate;
  padding: 8.5rem max(2rem, calc((100vw - 1320px) / 2)) 7rem;
}
.hero-image, .hero-shade { position: absolute; inset: 0; z-index: -2; }
.hero-image {
  background: url("assets/altyria-hero.webp") center 36% / cover no-repeat;
  image-rendering: auto;
  transform: scale(1.02);
}
.hero-shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(4,8,16,.96) 0%, rgba(4,8,16,.83) 39%, rgba(4,8,16,.24) 74%, rgba(4,8,16,.55) 100%),
    linear-gradient(0deg, var(--ink) 0%, transparent 30%, rgba(2,4,9,.22) 100%);
}
.hero-content { width: min(680px, 64vw); }
.eyebrow, .chapter-label {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}
h1, h2 { font-family: var(--serif); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
h1 { margin: 0; font-size: clamp(4rem, 8.4vw, 8.5rem); text-shadow: 0 .2rem 2rem rgba(0,0,0,.35); }
h1 span { display: block; font-family: var(--sans); font-size: .27em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero-lede { max-width: 560px; margin: 1.8rem 0 2.3rem; color: rgba(255,255,255,.8); font-size: clamp(1.05rem, 1.35vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: .85rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  min-height: 3.55rem;
  padding: .85rem 1.2rem;
  border: 1px solid transparent;
  border-radius: .25rem;
  font-size: .79rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.25;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.button span { font-size: .67rem; font-weight: 600; letter-spacing: .04em; opacity: .75; }
.button-primary { background: var(--gold); color: #181006; }
.button-primary:hover { background: var(--gold-hot); }
.button-ghost, .button-secondary { border-color: rgba(255,255,255,.3); background: rgba(7,11,19,.45); color: white; }
.button-ghost:hover, .button-secondary:hover { border-color: var(--ivory); background: rgba(255,255,255,.08); }
.hero-actions .button-primary { flex-direction: column; align-items: flex-start; padding-inline: 1.45rem; }
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  color: rgba(255,255,255,.66);
  font-size: .69rem;
  letter-spacing: .18em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-50%);
}
.hero-scroll i { width: 1px; height: 2.6rem; background: linear-gradient(var(--gold), transparent); }

.chapter { position: relative; width: min(1320px, calc(100% - 4rem)); margin: 0 auto; padding: 8rem 0 8rem 7.5rem; }
.chapter-rail { position: absolute; top: 8rem; bottom: 8rem; left: 0; width: 3rem; border-right: 1px solid var(--line); color: var(--muted); }
.chapter-rail::after { content: ""; position: absolute; top: 0; right: -3px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.chapter-rail span { position: sticky; top: 2rem; display: block; padding-right: 1.25rem; font-family: var(--serif); font-size: 1rem; text-align: right; }
.section-heading h2, .mac-heading h2 { margin: 0 0 1.5rem; font-size: clamp(3rem, 5.8vw, 6.1rem); }
.text-link { display: inline-flex; gap: .65rem; margin-top: 1rem; color: var(--ivory); font-size: .82rem; font-weight: 800; letter-spacing: .1em; text-decoration-color: var(--gold); text-underline-offset: .35rem; text-transform: uppercase; }
.text-link span { color: var(--gold); }
.mac-images figcaption { margin-top: .7rem; color: var(--muted); font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; }

.gallery-section { padding-bottom: 10rem; }
.section-heading { max-width: 820px; margin-bottom: 3.5rem; }
.section-heading > p:last-child { max-width: 38rem; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: .9rem; }
.gallery-item {
  position: relative;
  grid-column: span 4;
  overflow: hidden;
  aspect-ratio: 1.3;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .15rem;
  background: var(--panel);
  color: white;
  cursor: zoom-in;
}
.gallery-item-featured { grid-column: span 8; grid-row: span 2; aspect-ratio: auto; }
.gallery-item-wide { grid-column: span 8; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, filter .35s ease; }
.gallery-item span { position: absolute; right: .75rem; bottom: .75rem; padding: .35rem .55rem; background: rgba(4,7,13,.78); font-size: .67rem; letter-spacing: .08em; opacity: 0; text-transform: uppercase; transition: opacity .2s ease; }
.gallery-item:hover img { transform: scale(1.025); filter: brightness(1.05); }
.gallery-item:hover span, .gallery-item:focus-visible span { opacity: 1; }

.downloads { width: 100%; max-width: none; margin: 0; padding-right: max(2rem, calc((100vw - 1320px) / 2)); padding-left: max(9.5rem, calc((100vw - 1320px) / 2 + 7.5rem)); background: var(--ink-soft); }
.downloads .chapter-rail { left: max(2rem, calc((100vw - 1320px) / 2)); }
.downloads-heading { display: grid; grid-template-columns: 1fr .62fr; column-gap: 5rem; max-width: none; }
.downloads-heading .chapter-label { grid-column: 1 / -1; }
.downloads-heading p:last-child { align-self: end; margin-bottom: 1.7rem; }
.platforms { display: grid; grid-template-columns: 1.18fr 1fr 1fr; gap: 1rem; }
.platform { display: flex; flex-direction: column; min-height: 350px; padding: 1.35rem; border: 1px solid var(--line); background: #101927; }
.platform-primary { border-color: rgba(240,178,63,.55); background: linear-gradient(145deg, #182235, #111925); }
.platform-topline { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .71rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.platform-topline strong { color: var(--cyan); }
.platform-main { display: flex; align-items: center; gap: 1.25rem; margin: 3rem 0 auto; }
.platform-main img { width: 4rem; max-height: 4rem; object-fit: contain; filter: grayscale(1) brightness(2.2); }
.platform-main h3 { margin: 0; font-family: var(--serif); font-size: 2.2rem; font-weight: 500; }
.platform-main p { margin: .1rem 0 0; color: var(--muted); font-size: .83rem; }
.platform .button { width: 100%; margin-top: 2rem; }
.platform-help { margin-top: .85rem; color: var(--muted); font-size: .76rem; text-align: center; text-underline-offset: .25rem; }

.mac-guide { width: min(1120px, calc(100% - 4rem)); margin: 0 auto; padding: 9rem 0; }
.mac-heading { display: grid; grid-template-columns: 1fr .65fr; column-gap: 5rem; margin-bottom: 4.5rem; }
.mac-heading .chapter-label { grid-column: 1 / -1; }
.mac-heading p:last-child { align-self: end; margin-bottom: 1.4rem; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 5rem; padding: 0; list-style: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 2rem 1.5rem; border-right: 1px solid var(--line); }
.steps li:last-child { border-right: 0; }
.step-number { color: var(--gold); font-family: var(--serif); }
.steps h3 { margin: 0 0 .5rem; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; line-height: 1.2; }
.steps p { margin: 0; color: var(--muted); font-size: .9rem; }
kbd { padding: .08rem .3rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: .2rem; background: var(--panel); font: inherit; color: var(--ivory); }
.mac-images { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mac-images figure { margin: 0; }
.mac-images img { width: 100%; border: 1px solid var(--line); }
.mac-actions { display: flex; align-items: center; gap: 2rem; margin-top: 2.5rem; }
.mac-actions .text-link { margin-top: 0; }

footer { display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding: 2.25rem max(2rem, calc((100vw - 1320px) / 2)); border-top: 1px solid var(--line); background: #060911; color: var(--muted); font-size: .78rem; }
footer a { text-underline-offset: .25rem; }
.footer-brand { color: var(--ivory); }
.footer-brand .brand-mark { width: 2rem; height: 2rem; font-size: 1rem; }

.lightbox { width: min(1100px, calc(100vw - 2rem)); max-width: none; padding: 0; border: 1px solid rgba(255,255,255,.25); background: #03050a; color: white; }
.lightbox::backdrop { background: rgba(1,3,7,.92); backdrop-filter: blur(5px); }
.lightbox img { width: 100%; height: auto; max-height: 82vh; object-fit: contain; }
.lightbox-close { position: absolute; top: .75rem; right: .75rem; z-index: 1; padding: .6rem .8rem; border: 1px solid rgba(255,255,255,.35); background: rgba(5,8,14,.85); color: white; cursor: pointer; }

@media (max-width: 900px) {
  .site-header { width: calc(100% - 2rem); }
  .site-header nav { gap: 1rem; }
  .site-header nav a { font-size: .68rem; }
  .hero { padding-inline: 2rem; }
  .hero-content { width: min(680px, 78vw); }
  .chapter { width: calc(100% - 2rem); padding: 6rem 0 6rem 4.5rem; }
  .chapter-rail { top: 6rem; bottom: 6rem; width: 2.3rem; }
  .downloads { width: 100%; padding-right: 1rem; padding-left: 5.5rem; }
  .downloads .chapter-rail { left: 1rem; }
  .downloads-heading, .mac-heading { grid-template-columns: 1fr; }
  .downloads-heading .chapter-label, .mac-heading .chapter-label { grid-column: auto; }
  .downloads-heading p:last-child, .mac-heading p:last-child { margin-top: 0; }
  .platforms { grid-template-columns: 1fr; }
  .platform { min-height: 300px; }
  .gallery-item, .gallery-item-wide { grid-column: span 6; }
  .gallery-item-featured { grid-column: span 12; }
  .mac-guide { width: calc(100% - 2rem); padding: 6rem 0; }
  .steps { grid-template-columns: 1fr; }
  .steps li { border-right: 0; border-bottom: 1px solid var(--line); }
  .steps li:last-child { border-bottom: 0; }
}

@media (max-width: 620px) {
  .site-header { align-items: flex-start; }
  .site-header nav a:not(.nav-download) { display: none; }
  .site-header .nav-download { display: inline-flex; min-height: 2.55rem; align-items: center; padding: 0 .8rem; border: 1px solid rgba(240,178,63,.5); }
  .hero { min-height: 900px; align-items: start; padding: 10rem 1rem 7rem; }
  .hero-image { background-position: 60% center; }
  .hero-shade { background: linear-gradient(180deg, rgba(4,8,16,.82), rgba(4,8,16,.34) 40%, rgba(4,8,16,.97) 79%, var(--ink)); }
  .hero-content { width: 100%; }
  h1 { font-size: clamp(3.5rem, 18vw, 5.2rem); }
  h1 span { font-size: .24em; }
  .hero-lede { margin-top: 1.25rem; }
  .hero-actions { position: absolute; left: 1rem; right: 1rem; bottom: 7rem; }
  .hero-actions .button { width: 100%; align-items: center; }
  .hero-scroll { bottom: 1rem; }
  .chapter { width: calc(100% - 2rem); padding: 5rem 0; }
  .chapter-rail { display: none; }
  .section-heading h2, .mac-heading h2 { font-size: clamp(2.8rem, 14vw, 4.2rem); }
  .gallery { display: flex; gap: .75rem; overflow-x: auto; margin-right: -1rem; padding: 0 1rem 1.25rem 0; scroll-snap-type: x mandatory; }
  .gallery-item, .gallery-item-featured, .gallery-item-wide { flex: 0 0 86%; aspect-ratio: 1.3; scroll-snap-align: start; }
  .gallery-item span { opacity: 1; }
  .downloads { width: 100%; padding: 5rem 1rem; }
  .platform-main { margin-top: 2.3rem; }
  .mac-guide { width: calc(100% - 2rem); padding: 5rem 0; }
  .mac-heading { margin-bottom: 3rem; }
  .mac-images { display: flex; gap: .75rem; overflow-x: auto; margin-right: -1rem; padding: 0 1rem 1rem 0; scroll-snap-type: x mandatory; }
  .mac-images figure { flex: 0 0 88%; scroll-snap-align: start; }
  .mac-actions { align-items: stretch; flex-direction: column; gap: 1rem; }
  .mac-actions .button { width: 100%; }
  .mac-actions .text-link { justify-content: center; text-align: center; }
  footer { align-items: flex-start; flex-direction: column; padding-inline: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
