/* Cardo (headings) and Alegreya Sans (text), self-hosted. Licenses: fonts/cardo/OFL.txt, fonts/alegreya-sans/OFL.txt */
@font-face { font-family: "Cardo"; src: url("fonts/cardo/cardo-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cardo"; src: url("fonts/cardo/cardo-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cardo"; src: url("fonts/cardo/cardo-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cardo"; src: url("fonts/cardo/cardo-latin-ext-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans/alegreya-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans/alegreya-sans-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans/alegreya-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans/alegreya-sans-latin-ext-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans/alegreya-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans/alegreya-sans-latin-ext-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    /* Warmed like a screen's night light: green x0.95, blue x0.88 (hare.webp has the same shift) */
    --paper: #f5e3c9;
    --ink: #2b2016;
    --muted: #6f5b46;
    --edge: clamp(1.25rem, 3vw, 2rem);
    --heading: "Cardo", Georgia, "Times New Roman", serif;
    --text: "Alegreya Sans", "Helvetica Neue", Arial, sans-serif;
}

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

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

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* Hide the blinking text cursor browsers draw in plain text when caret browsing (F7) is on.
   Nothing here is typed into; anything that is gets its cursor back. */
html { caret-color: transparent; }
input, textarea, [contenteditable] { caret-color: auto; }

/* Positioned so the name at the top of inner pages sits at the top of the page */
body {
    position: relative;
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--text);
    font-size: 1.1875rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--heading);
    font-weight: 400;
    line-height: 1.1;
    margin: 0;
}

.intro {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(1.25rem, 3vw, 2rem);
    padding: 5rem 1rem;
    text-align: center;
}

.hare {
    display: block;
    width: min(380px, 72vw);
    max-height: 62svh;
    height: auto;
    object-fit: contain;
}

.intro h1 {
    font-size: clamp(2.5rem, 8vw, 4.25rem);
    letter-spacing: 0.01em;
}

/* Menu: links in the corners, like the marks around a printed plate.
   They stay in the corners of the screen while the page scrolls. */
.corners ul { list-style: none; margin: 0; padding: 0; }
.corners li { position: fixed; padding: var(--edge); }
.corners li:nth-child(1) { top: 0; left: 0; }
.corners li:nth-child(2) { top: 0; right: 0; }
.corners li:nth-child(3) { bottom: 0; left: 0; }

.corners a {
    display: inline-block;
    /* A larger tap target without moving the text */
    padding: 0.75rem;
    margin: -0.75rem;
    color: var(--ink);
    /* Text scrolling past underneath stays hidden behind the link */
    background: var(--paper);
    font-size: calc(0.9rem + 2px);
    line-height: 1.5;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
}

.corners a:focus-visible,
.corners a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.35em;
}

/* Inner pages: the name at the top links home */
.masthead {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    padding-top: var(--edge);
    white-space: nowrap;
}

.masthead a {
    display: inline-block;
    color: var(--ink);
    font-family: var(--heading);
    font-size: 1.2rem;
    line-height: 1.125;
    text-decoration: none;
}

.page {
    max-width: 38rem;
    margin: 0 auto;
    padding: clamp(7rem, 16vh, 10rem) 1.25rem 7rem;
}

.page h1 {
    font-size: clamp(2.5rem, 7vw, 3.5rem);
    margin-bottom: 1.25rem;
}

.page p { margin: 0 0 1em; }

.soon {
    color: var(--muted);
    font-style: italic;
}

/* Read by screen readers, hidden on screen */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* About: the quote fills the first screen, stepping right line by line
   until it lands on the dancing star. The rest of the page follows on scroll. */
.opening {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.25rem;
}

.opening blockquote {
    width: min(52rem, 100%);
    margin: 0;
}

.opening p {
    margin: 0;
    font-family: var(--heading);
    /* The 5.3vw cap only kicks in on the narrowest phones, so each phrase stays on one line */
    font-size: min(clamp(1.3rem, 3.6vw, 2.75rem), 5.3vw);
    line-height: 1.3;
}

.opening .line { display: block; }
.opening .line:nth-child(2) { padding-left: 12%; }
.opening .line:nth-child(3) { padding-left: 30%; }
.opening .line:nth-child(4) {
    text-align: right;
    font-style: italic;
    font-size: 1.35em;
}

@media (max-width: 600px) {
    .opening .line:nth-child(2) { padding-left: 5%; }
    .opening .line:nth-child(3) { padding-left: 15%; }
}

/* About: the sections after the quote, each at least a screen tall */
.chapter {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 40rem;
    margin-inline: auto;
    padding: 6rem 1.25rem;
}

.chapter h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1.5rem;
    text-wrap: balance;
}

.chapter p {
    margin: 0 0 1em;
    font-family: var(--heading);
    font-size: calc(1.1875rem + 2px);
}

/* About: one star per section down the right edge, centred under the end of "Blog".
   The star of the section on screen is larger and darker. */
.stars {
    position: fixed;
    top: 50%;
    right: calc(var(--edge) - 1rem);
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
}

.stars a {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    color: var(--muted);
}

.stars svg {
    width: 0.6rem;
    height: 0.6rem;
    fill: currentColor;
    transition: scale 0.4s ease, color 0.4s ease;
}

.stars a[aria-current] { color: var(--ink); }

.stars a[aria-current] svg { scale: 1.75; }

@media (prefers-reduced-motion: reduce) {
    .stars svg { transition: none; }
}

/* On narrow screens, keep the text clear of the stars */
@media (max-width: 600px) {
    .opening, .chapter { padding-right: 2.5rem; }
}
