/* Fusi Pustaka
 *
 * Home is the umbra: full night sky with an eclipse.
 * Inner pages are the penumbra: a night band on top, cool daylight paper
 * for reading, and night again at the foot.
 */

:root {
    --void: #060918;
    --night: #0D1330;
    --dusk: #8C97C2;
    --star: #EDF0F8;
    --corona: #F3B544;
    --rose: #C99AB0;
    --youtube: #FF0033;

    --paper: #EEF1F7;
    --ink: #0D1330;
    --ink-soft: #4A5378;
    --gold-ink: #8A5A00;
    --rule: rgba(13, 19, 48, 0.14);
    --rule-dark: rgba(237, 240, 248, 0.16);

    --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --serif: 'Newsreader', Georgia, 'Times New Roman', serif;

    --gutter: clamp(20px, 4vw, 56px);
    --pad-x: max(var(--gutter), env(safe-area-inset-left), env(safe-area-inset-right));
    --max: 1320px;
}

@view-transition { navigation: auto; }

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

* { margin: 0; padding: 0; }

html {
    background: var(--void);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 100%;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

img,
svg,
canvas { display: block; max-width: 100%; }

a { color: inherit; }
ul { list-style: none; }

:focus-visible {
    outline: 2px solid var(--corona);
    outline-offset: 3px;
    border-radius: 2px;
}

.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--star);
    color: var(--void);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

.wrap {
    width: 100%;
    max-width: calc(var(--max) + 2 * var(--pad-x));
    margin: 0 auto;
    padding-left: var(--pad-x);
    padding-right: var(--pad-x);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 550;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-light { background: var(--star); border-color: var(--star); color: var(--void); }
.btn-light:hover { background: #ffffff; border-color: #ffffff; }

.btn-ghost {
    border-color: var(--rule-dark);
    background: rgba(6, 9, 24, 0.35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--star);
}
.btn-ghost:hover { border-color: rgba(237, 240, 248, 0.55); }

.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--star); }
.btn-dark:hover { background: #1B2554; border-color: #1B2554; }

.btn-outline { border-color: var(--rule); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }

.btn-youtube svg {
    width: 0;
    height: 14px;
    opacity: 0;
    margin-right: -8px;
    transition: width 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
}

.btn-youtube:hover,
.btn-youtube:focus-visible,
.btn-youtube:active {
    background: var(--youtube);
    border-color: var(--youtube);
    color: #ffffff;
}

.btn-youtube:hover svg,
.btn-youtube:focus-visible svg,
.btn-youtube:active svg {
    width: 20px;
    opacity: 1;
    margin-right: 0;
}

/* Status line, used in the catalog and on book pages */
.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-soon { color: var(--gold-ink); }


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

.page-home { color: var(--star); overscroll-behavior: none; }

/* Set by sky.js when the page fits the screen, so a finger drag
   bends the stars instead of bouncing the page */
html.sky-fits { touch-action: none; }

.home-sky {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

.home {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: max(24px, env(safe-area-inset-top)) var(--pad-x) 0;
}

.home-hero {
    align-self: end;
    padding-bottom: clamp(28px, 6vh, 72px);
}

.home-hero h1 {
    font-size: clamp(2.5rem, 12.6vw, 4rem);
    font-weight: 700;
    font-variation-settings: "wdth" 88;
    letter-spacing: -0.04em;
    line-height: 0.92;
}

.home-hero h1 span { display: block; }

.home-quote {
    margin-top: clamp(16px, 2.6vh, 28px);
    max-width: 42ch;
    font-size: 1rem;
    font-style: italic;
    color: var(--dusk);
}

.home-actions {
    margin-top: clamp(24px, 4vh, 40px);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.home-base {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    padding: 20px 0 max(24px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--rule-dark);
    font-size: 13px;
    line-height: 1.55;
    color: var(--dusk);
}

.home-base strong { color: var(--star); font-weight: 600; }
.home-base a { text-decoration: none; }
.home-base a:hover { color: var(--star); }

.home-org { grid-column: 1 / 4; }
.home-contact { grid-column: 4 / 7; }
.home-social { grid-column: 7 / 9; }

.home-newest {
    grid-column: 9 / 13;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 14px;
}

.home-newest-cover {
    width: 40px;
    flex: none;
}

.home-newest-cover img {
    width: 100%;
    aspect-ratio: 69 / 100;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease;
}

.home-newest:hover .home-newest-cover img { transform: translateY(-2px) rotate(-2deg); }

.home-newest-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--star);
}

@media (min-width: 761px) {
    .home-hero h1 { font-size: clamp(4rem, 6.6vw, 7rem); }
    .home-quote { font-size: clamp(1rem, 1.2vw, 1.15rem); }
}

@media (max-width: 760px) {
    .home-actions .btn { flex: 1 1 auto; padding: 0 18px; }
    .home-base { grid-template-columns: 1fr 1fr; gap: 14px 20px; font-size: 12.5px; }
    .home-org,
    .home-contact,
    .home-social,
    .home-newest { grid-column: auto; }
    .home-newest { justify-self: start; }
}

@media (max-width: 360px) {
    .home-base { grid-template-columns: 1fr; }
}


/* ------------------------------------------------------------------ */
/* Inner pages                                                         */
/* ------------------------------------------------------------------ */

.page-inner { background: var(--paper); }

/* Night band */
.band {
    position: relative;
    overflow: hidden;
    background: var(--void);
    color: var(--star);
}

.band canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.band .wrap { position: relative; }

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: max(22px, env(safe-area-inset-top));
}

.nav {
    display: flex;
    gap: clamp(18px, 3vw, 32px);
    font-size: 15px;
}

.nav a {
    color: var(--dusk);
    text-decoration: none;
    padding: 10px 0;
    background: linear-gradient(currentColor, currentColor) left calc(100% - 4px) / 0 1px no-repeat;
    transition: color 0.2s ease, background-size 0.25s ease;
}

.nav a:hover { color: var(--star); }

.nav a[aria-current="page"] {
    color: var(--star);
    background-size: 100% 1px;
}

.band-title {
    padding: clamp(56px, 10vh, 112px) 0 clamp(32px, 5vh, 56px);
}

.band-title h1 {
    font-size: clamp(2.75rem, 7vw, 6rem);
    font-weight: 700;
    font-variation-settings: "wdth" 88;
    letter-spacing: -0.04em;
    line-height: 0.92;
}

.band-title p {
    margin-top: 16px;
    max-width: 52ch;
    font-size: clamp(1rem, 1.3vw, 1.125rem);
    color: var(--dusk);
}

/* Paper */
.paper {
    padding: clamp(48px, 8vh, 96px) 0 clamp(64px, 10vh, 120px);
    color: var(--ink);
}

/* Covers */
.cover {
    position: relative;
    border-radius: 2px 4px 4px 2px;
    box-shadow:
        0 1px 0 rgba(13, 19, 48, 0.08),
        0 4px 10px -4px rgba(13, 19, 48, 0.25),
        0 22px 44px -18px rgba(13, 19, 48, 0.55);
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease;
}

.cover img {
    width: 100%;
    aspect-ratio: 69 / 100;
    object-fit: cover;
    border-radius: inherit;
    background: var(--night);
}

/* Spine crease, so the cover reads as a printed book */
.cover::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.22) 0,
        rgba(255, 255, 255, 0.16) 1.6%,
        rgba(0, 0, 0, 0.06) 3.6%,
        rgba(0, 0, 0, 0) 6%);
    pointer-events: none;
}

.cover-empty {
    aspect-ratio: 69 / 100;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(13, 19, 48, 0.3);
    box-shadow: none;
    font-size: 14px;
    color: var(--ink-soft);
}

.cover-empty::after { display: none; }

/* Catalog */
.shelf {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(48px, 7vh, 72px) clamp(24px, 3.5vw, 48px);
}

.book-link {
    display: block;
    text-decoration: none;
}

.book .cover { margin-bottom: 28px; }

.book-link:hover .cover {
    transform: translateY(-6px);
    box-shadow:
        0 1px 0 rgba(13, 19, 48, 0.08),
        0 8px 16px -6px rgba(13, 19, 48, 0.3),
        0 34px 60px -22px rgba(13, 19, 48, 0.6);
}

.book h2 {
    margin-top: 10px;
    font-size: clamp(1.25rem, 1.7vw, 1.5rem);
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.book-link:hover h2 {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.book-author {
    margin-top: 6px;
    font-size: 15px;
    color: var(--ink-soft);
}

.book-desc {
    margin-top: 14px;
    max-width: 60ch;
    font-size: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-upcoming .book-desc { color: var(--ink-soft); }

.book-meta {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 13px;
}

.book-meta dt { color: var(--ink-soft); }
.book-meta dd { font-weight: 550; }

@media (max-width: 1000px) {
    .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 641px) and (max-width: 1000px) {
    .book-upcoming {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 160px 1fr;
        gap: 32px;
        align-items: center;
    }
    .book-upcoming .cover { margin-bottom: 0; }
}

@media (max-width: 640px) {
    .shelf { grid-template-columns: 1fr; gap: 40px; }
    .book-link,
    .book-upcoming {
        display: grid;
        grid-template-columns: 38% 1fr;
        gap: 18px;
        align-items: start;
    }
    .book .cover { margin-bottom: 0; }
    .book h2 { font-size: 1.15rem; }
    .book-author { font-size: 13px; }
    .book-desc { font-size: 14px; -webkit-line-clamp: 3; }
    .book-meta { display: none; }
}

/* Book page */
.page-book .band { padding-bottom: clamp(120px, 20vh, 180px); }

.crumbs {
    padding-top: clamp(40px, 7vh, 72px);
    font-size: 14px;
    color: var(--dusk);
}

.crumbs a { color: var(--star); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 4px; }
.crumbs span[aria-hidden] { margin: 0 6px; }

.page-book .paper { padding-top: 0; }

.detail {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0 clamp(24px, 3.5vw, 48px);
}

.detail-cover {
    grid-column: 1 / 5;
    position: relative;
    z-index: 1;
    margin-top: calc(-1 * clamp(96px, 16vh, 150px));
}

.detail-cover .cover {
    position: sticky;
    top: 32px;
    box-shadow:
        0 1px 0 rgba(13, 19, 48, 0.08),
        0 8px 18px -6px rgba(6, 9, 24, 0.45),
        0 40px 80px -24px rgba(6, 9, 24, 0.7);
}

.detail-body {
    grid-column: 6 / 13;
    padding-top: clamp(40px, 6vh, 64px);
}

.detail-body h1 {
    margin-top: 12px;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    font-variation-settings: "wdth" 88;
    letter-spacing: -0.04em;
    line-height: 0.95;
    text-wrap: balance;
}

.detail-author {
    margin-top: 16px;
    font-size: clamp(1.05rem, 1.4vw, 1.25rem);
    color: var(--ink-soft);
}

.detail-body h2 {
    margin: clamp(40px, 6vh, 64px) 0 16px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    font-size: 15px;
    font-weight: 600;
}

.synopsis p {
    max-width: 62ch;
    font-family: var(--serif);
    font-size: clamp(1.125rem, 1.35vw, 1.25rem);
    line-height: 1.7;
    font-variation-settings: "opsz" 16;
}

.synopsis p + p { margin-top: 1em; }

.facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 32px;
    margin-bottom: 48px;
}

.facts div {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
}

.facts dt {
    font-size: 13px;
    color: var(--ink-soft);
}

.facts dd {
    margin-top: 2px;
    font-size: 15px;
    font-weight: 550;
}

@media (max-width: 760px) {
    .page-book .band { padding-bottom: 96px; }
    .detail-cover {
        grid-column: 1 / -1;
        width: min(62%, 280px);
        margin-top: -72px;
    }
    .detail-cover .cover { position: relative; top: 0; }
    .detail-body { grid-column: 1 / -1; padding-top: 32px; }
    .facts { grid-template-columns: 1fr; }
}

/* Profile */
.row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px clamp(24px, 3.5vw, 48px);
    padding: clamp(28px, 4vh, 40px) 0;
    border-top: 1px solid var(--rule);
}

.row:first-child { border-top: 0; padding-top: 0; }

.row h2 {
    grid-column: 1 / 4;
    font-size: 15px;
    font-weight: 600;
    padding-top: 4px;
}

.row > :not(h2) {
    grid-column: 5 / 13;
    max-width: 64ch;
    font-size: clamp(1rem, 1.25vw, 1.125rem);
    line-height: 1.6;
}

.row .lead {
    font-size: clamp(1.375rem, 2.2vw, 1.875rem);
    font-weight: 450;
    line-height: 1.35;
    letter-spacing: -0.015em;
    max-width: 36ch;
}

.mission li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.mission li:first-child { padding-top: 0; }

.row .btn { margin-top: 20px; }

@media (max-width: 760px) {
    .row h2,
    .row > :not(h2) { grid-column: 1 / -1; }
}

/* Footer */
.site-footer {
    padding: clamp(48px, 8vh, 72px) 0 max(28px, env(safe-area-inset-bottom));
    background: var(--void);
    color: var(--dusk);
    font-size: 14px;
    line-height: 1.6;
}

.site-footer .brand { color: var(--star); margin-bottom: 14px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--star); }

.footer-grid {
    display: grid;
    grid-template-columns: 5fr 2fr 2fr 3fr;
    gap: 32px;
}

.footer-org p + p { margin-top: 10px; }

.site-footer h2 {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--star);
}

.site-footer li + li { margin-top: 4px; }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    margin-top: clamp(40px, 6vh, 64px);
    padding-top: 20px;
    border-top: 1px solid var(--rule-dark);
    font-size: 13px;
}

.heart { color: #ef4444; }

@media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 24px; }
    .footer-org { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
    .nav-home { display: none; }
}


/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after { transition: none !important; animation: none !important; }
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) { animation: none !important; }
}
