/* Otterlyneo: shared styles for the home and commission pages.
   Look: a printed star atlas. Navy sheet, faint coordinate grid,
   italic serif labels, Neo's stripe blue for links. */

:root {
    --sky: #14203b;        /* atlas navy */
    --sky-raised: #1a2847; /* slightly lifted areas */
    --rule: #2f4170;       /* lines and borders */
    --paper: #e8edf5;      /* main text */
    --dim: #9eabc4;        /* secondary text */
    --stripe: #72bcec;     /* Neo's stripe blue */
    --rocket: #e0485c;     /* the rocket red, used sparingly */

    --serif: 'Alegreya', 'Iowan Old Style', Georgia, serif;
    --sans: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--sky) url("../img/sky-grid.svg") right top / max(1600px, 100%) auto no-repeat;
    color: var(--paper);
    font: 400 1.125rem/1.55 var(--sans);
    font-variant-numeric: oldstyle-nums;
}

img { max-width: 100%; height: auto; display: block; }

/* Animated pixel star chart (js/sky.js). The SVG above stays as the no-JS fallback. */
.sky {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.sky canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}


a {
    color: var(--stripe);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}
a:hover { color: var(--paper); }
a:focus-visible {
    outline: 2px solid var(--stripe);
    outline-offset: 3px;
}

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 500;
    font-style: italic;
    line-height: 1.1;
    margin: 0;
}

p { margin: 0 0 0.9em; }

/* ---------- Top bar (inner pages) ---------- */

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 2rem;
    max-width: 68rem;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 0;
}
.topbar .home-link {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.5rem;
    color: var(--paper);
    text-decoration: none;
    margin-right: auto;
}
.topbar nav { display: flex; gap: 1.5rem; }
.topbar nav a { color: var(--dim); text-decoration: none; }
.topbar nav a:hover,
.topbar nav a[aria-current="page"] { color: var(--paper); }
.topbar nav a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-color: var(--stripe);
    text-underline-offset: 0.35em;
}

/* ---------- Home ---------- */

.home-sheet {
    display: grid;
    grid-template-columns: minmax(0, 23rem) minmax(0, 30rem);
    gap: 3.5rem;
    align-items: start;
    justify-content: center;
    max-width: 59.5rem;
    margin: 0 auto;
    padding: 7vh 1.5rem 3rem;
}
body.home {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
body.home .site-foot { max-width: 59.5rem; width: 100%; }

.portrait { margin: 0; }
.portrait img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--rule);
    padding: 6px;
    background: var(--sky-raised);
}
.portrait figcaption {
    margin-top: 0.5rem;
    font: italic 0.95rem/1.3 var(--serif);
    color: var(--dim);
}
.portrait figcaption a { color: inherit; }

.about h1 {
    font-size: clamp(3.2rem, 7.5vw, 5.5rem);
    letter-spacing: -0.01em;
    margin: -0.12em 0 1.25rem -0.04em;
}

.about .intro { font-size: 1.25rem; max-width: 28em; }
.about .intro + .intro { color: #b9c4da; font-size: 1.125rem; }
.about, .page, .topbar, .site-foot { text-shadow: 0 0 6px var(--sky), 0 0 2px var(--sky); }

.about h2 {
    font-size: 1.35rem;
    color: #b9c4da;
    margin: 2.25rem 0 0.5rem;
}

/* Catalogue-style link list with dotted leaders. Each row sits on a solid
   label plate so it reads cleanly over the star field; hover lifts it off
   the chart with a hard, unblurred offset like a printed misregistration. */
.index {
    list-style: none;
    margin: 0;
    padding: 0;
}
.index li + li { margin-top: 0.45rem; }
.index a {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem 0.6rem;
    color: var(--paper);
    text-decoration: none;
    background: var(--sky-raised);
    border: 1px solid var(--rule);
    transition: transform 80ms steps(2), box-shadow 80ms steps(2);
}
.index .name { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.01em; }
.index .lead {
    flex: 1;
    border-bottom: 2px dotted #3e5285;
    transform: translateY(-0.3em);
    min-width: 1.5rem;
}
.index .detail { color: #b9c4da; }
.index a:hover,
.index a:focus-visible {
    border-color: var(--stripe);
    transform: translate(-3px, -3px);
    box-shadow: 3px 3px 0 var(--stripe);
    outline: none;
}
.index a:hover .name,
.index a:focus-visible .name { color: var(--stripe); }
.index a:hover .lead,
.index a:focus-visible .lead { border-bottom-color: var(--stripe); }
.index a:active { transform: none; box-shadow: none; }
.index .detail.open { color: var(--stripe); font-weight: 700; }
.index .detail.open.is-closed { color: var(--rocket) !important; background: none !important; }

.site-foot {
    max-width: 68rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 2.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    color: var(--dim);
    font-size: 0.95rem;
}
.site-foot img { height: 20px; opacity: 0.7; }

@media (max-width: 760px) {
    .home-sheet {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
        padding-top: 2rem;
    }
    .portrait { max-width: 15rem; }
}

/* ---------- Commission page ---------- */

.page {
    max-width: 68rem;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2rem;
}

.page-head {
    max-width: 40rem;
    margin-bottom: 3rem;
}
.page-head h1 {
    font-size: clamp(2.6rem, 6vw, 4.25rem);
    margin-bottom: 1rem;
}
.page-head .lede { font-size: 1.25rem; }

.status-line {
    font-size: 1.2rem;
    color: var(--dim);
    margin-bottom: 1rem;
}
.status {
    text-shadow: none;
    display: inline-block;
    color: var(--sky);
    background: var(--stripe);
    font: 600 1.15rem/1 'Pixelify Sans', var(--sans);
    padding: 0.3em 0.55em 0.35em;
    margin-left: 0.3em;
    box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25), inset 3px 3px 0 rgba(255, 255, 255, 0.3);
}
.jump { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 1.25rem; font-size: 1rem; }

/* ---------- Showcase: big stage + thumbnail strip ---------- */

/* Sized so the stage and the thumbnail strip fit on one screen. */
.showcase { margin: 0 0 4rem; max-width: max(28rem, calc((100vh - 15rem) * 16 / 9)); }
.stage {
    position: relative;
    margin: 0;
    background: #0b1224;
    border: 1px solid var(--rule);
    box-shadow: 6px 6px 0 #0b1224;
}
.stage-view {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}
.stage-view img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #0b1224;
}
.stage figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 1rem;
    padding: 0.75rem 1rem 0.85rem;
    border-top: 1px solid var(--rule);
    background: var(--sky-raised);
    color: var(--dim);
}
.stage figcaption b { color: var(--paper); font-weight: 700; }
.stage-count { font: 600 0.95rem/1 'Pixelify Sans', var(--sans); color: var(--stripe); }
#stage-full { margin-left: auto; font-size: 0.95rem; }
.stage-nav {
    position: absolute;
    top: calc(50% - 1.6rem);
    width: 2.75rem;
    height: 3.25rem;
    border: 0;
    background: rgba(11, 18, 36, 0.85);
    color: var(--paper);
    font: 600 2rem/1 'Pixelify Sans', var(--sans);
    cursor: pointer;
    box-shadow: 0 0 0 1px var(--rule);
    opacity: 0.85;
}
.stage-nav.prev { left: 0.75rem; }
.stage-nav.next { right: 0.75rem; }
.stage-nav:hover, .stage-nav:focus-visible { opacity: 1; color: var(--stripe); box-shadow: 0 0 0 2px var(--stripe); }

.thumbs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    list-style: none;
    margin: 1.1rem 0 0;
    padding: 0;
}
.thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--rule);
    background: var(--sky-raised);
    color: var(--dim);
    cursor: pointer;
    text-align: left;
    transition: transform 80ms steps(2), box-shadow 80ms steps(2);
}
.thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: 0.7; }
.thumb span { display: block; padding: 0.35rem 0.55rem 0.4rem; font: 500 0.9rem/1.2 'Pixelify Sans', var(--sans); }
.thumb:hover img, .thumb[aria-current="true"] img { opacity: 1; }
.thumb:hover { border-color: var(--stripe); }
.thumb[aria-current="true"] {
    border-color: var(--stripe);
    color: var(--paper);
    transform: translate(-3px, -3px);
    box-shadow: 3px 3px 0 var(--stripe);
}

.viewer {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 3.5rem 1rem 1rem;
    border: 0;
    background: rgba(5, 8, 15, 0.96);
    color: var(--paper);
}
.viewer[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; }
.viewer::backdrop { background: rgba(5, 8, 15, 0.9); }
.viewer img { max-width: 100%; max-height: calc(100dvh - 7rem); object-fit: contain; box-shadow: 0 0 0 1px var(--rule); }
.viewer-caption { color: var(--dim); margin: 0; text-align: center; }
.viewer-caption b { color: var(--paper); }
.viewer-btn {
    position: absolute;
    border: 0;
    background: rgba(11, 18, 36, 0.85);
    color: var(--paper);
    font: 600 2.2rem/1 'Pixelify Sans', var(--sans);
    width: 3rem;
    height: 3.5rem;
    cursor: pointer;
    box-shadow: 0 0 0 1px var(--rule);
}
.viewer-btn:hover, .viewer-btn:focus-visible { color: var(--stripe); box-shadow: 0 0 0 2px var(--stripe); }
.viewer-btn.close { top: 0.5rem; right: 0.75rem; height: 3rem; }
.viewer-btn.prev { left: 0.75rem; top: calc(50% - 1.75rem); }
.viewer-btn.next { right: 0.75rem; top: calc(50% - 1.75rem); }

.terms { border-top: 1px solid var(--rule); }
.term {
    display: grid;
    grid-template-columns: 14rem minmax(0, 40rem);
    gap: 1rem 2.5rem;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--rule);
}
.term h2 { font-size: 1.6rem; color: var(--paper); }
.term p:last-child, .term ul:last-child { margin-bottom: 0; }
.term .note { color: var(--dim); font-size: 1rem; }
.price { font-size: 1.35rem; }
.price b { font-weight: 700; color: var(--paper); }

.plain-list { margin: 0 0 0.9em; padding-left: 1.1em; }
.plain-list li { margin-bottom: 0.3em; }
.plain-list li::marker { color: var(--rule); }

.bases {
    columns: 2;
    column-gap: 2rem;
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}
.bases li { break-inside: avoid; padding: 0.15em 0; }
.bases span { color: var(--dim); }

.yes-no {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 2rem;
}
.yes-no h3 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}
.yes-no ul { list-style: none; margin: 0; padding: 0; }
.yes-no li { padding: 0.15em 0 0.15em 1.2em; position: relative; }
.yes-no li::before {
    position: absolute;
    left: 0;
    font-weight: 700;
}
.yes-no .yes li::before { content: "+"; color: var(--stripe); }
.yes-no .no li::before  { content: "\2013"; color: var(--rocket); }

.steps { margin: 0 0 0.9em; padding-left: 1.3em; }
.steps li { margin-bottom: 0.4em; padding-left: 0.2em; }
.steps li::marker { color: var(--stripe); font: 600 1rem 'Pixelify Sans', var(--sans); }

/* ---------- Terms of service ---------- */

.tos {
    margin-top: 3.5rem;
    padding: 1.75rem 1.75rem 0.75rem;
    background: rgba(26, 40, 71, 0.85);
    border: 1px solid var(--rule);
    box-shadow: 6px 6px 0 #0b1224;
    scroll-margin-top: 1.5rem;
}
.tos-head { margin-bottom: 1.25rem; }
.tos-head h2 { font-size: clamp(1.9rem, 4vw, 2.5rem); margin-bottom: 0.4rem; }
.tos-head .note { color: var(--dim); font-size: 1rem; margin: 0; }
.tos-list {
    list-style: none;
    counter-reset: tos;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 2.5rem;
}
.tos-list li {
    counter-increment: tos;
    position: relative;
    padding: 1rem 0 1rem 2.6rem;
    border-top: 1px dotted var(--rule);
    break-inside: avoid;
}
.tos-list li::before {
    content: counter(tos);
    position: absolute;
    left: 0;
    top: 1rem;
    width: 1.75rem;
    height: 1.75rem;
    display: grid;
    place-items: center;
    background: var(--stripe);
    color: var(--sky);
    font: 600 1rem/1 'Pixelify Sans', var(--sans);
    box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.25);
}
.tos-list h3 { font-size: 1.25rem; color: var(--paper); margin-bottom: 0.35rem; }
.tos-list p { margin: 0; color: #c9d3e6; }
.term { scroll-margin-top: 1.5rem; }

.foot-admin {
    margin-left: auto;
    background: none;
    border: 0;
    padding: 0.25rem 0;
    color: var(--dim);
    font: 500 0.9rem/1 'Pixelify Sans', var(--sans);
    cursor: pointer;
    opacity: 0.7;
}
.foot-admin:hover, .foot-admin:focus-visible { opacity: 1; color: var(--stripe); }

.contact {
    padding: 2.5rem 0 1rem;
    font-size: 1.25rem;
    max-width: 40rem;
}

@media (max-width: 760px) {
    .page { padding-top: 2rem; }
    .term { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
    .thumbs { gap: 0.5rem; }
    .thumb span { font-size: 0.78rem; padding: 0.3rem 0.4rem; }
    .stage-nav { width: 2.25rem; height: 2.75rem; font-size: 1.6rem; top: calc(50% - 2.6rem); }
    .tos { padding: 1.25rem 1rem 0.5rem; }
    .tos-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
    .bases, .yes-no { columns: 1; grid-template-columns: minmax(0, 1fr); }
    .thumbs { grid-template-columns: repeat(4, minmax(64px, 1fr)); overflow-x: auto; }
    .thumb span { display: none; }
    #stage-full { margin-left: 0; }
}

/* Visitor counter: a small pixel odometer in the home footer. */
.visit-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font: 500 0.9rem/1 'Pixelify Sans', var(--sans);
    color: var(--dim);
    text-shadow: none;
}
.vc-label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.vc-digits { display: inline-flex; gap: 2px; padding: 2px; background: #0b1224; box-shadow: 0 0 0 2px var(--rule); }
.vc-digits span {
    display: inline-block;
    width: 1.05em;
    padding: 0.25em 0 0.3em;
    text-align: center;
    color: #ffd27a;
    background: linear-gradient(#1a2847 0 50%, #14203b 50% 100%);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.vc-today { font-size: 0.8rem; }
