/* nightotter.com, version 1. Rules in DESIGN.md. */

@font-face {
    font-family: "Saira";
    src: url("/fonts/saira-latin-wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --font: "Saira", system-ui, sans-serif;
    --bg: #000209;
    --panel-bg: #070b18;
    --panel-border: #16203a;
    --text: #ffffff;
    --text-2: #b8c4dc;
    --accent: #6fc8ff;
    --accent-deep: #245dcc;
    --gutter: clamp(16px, 4vw, 48px);
}

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

html {
    background: var(--bg);
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.55;
}

h1,
h2 {
    font-weight: 700;
    line-height: 1.15;
}

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

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Header */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem var(--gutter);
}

.wordmark {
    display: inline-flex;
    align-items: baseline;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
}

.blue-cube {
    width: 0.72em;
    height: 0.72em;
    margin-left: 0.12em;
    background: linear-gradient(145deg, #6fc8ff, #245dcc);
    background-size: 200% 200%;
    animation: blueShift 6s ease-in-out infinite;
}

@keyframes blueShift {
    0%, 100% { background-position: 0% 0%;     filter: brightness(1.15); }
    50%      { background-position: 100% 100%; filter: brightness(0.65); }
}

@media (prefers-reduced-motion: reduce) {
    .blue-cube { animation: none; }
}

.shop {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    column-gap: 0.6rem;
    text-align: right;
}

.tag,
.status,
.bulletin {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.tag,
.status {
    color: var(--accent);
}

/* Hero */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    aspect-ratio: 1671 / 941;
    min-height: 420px;
    max-height: 941px;
    padding: 2rem var(--gutter);
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    right: 0;
    width: min(100%, 1671px);
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: right top;
}

.hero-text {
    position: relative;
    max-width: min(34rem, 38%);
}

.hero h1 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--accent);
    text-wrap: balance;
}

.sub {
    margin: 0 0 2rem;
    font-size: clamp(1.25rem, 1.6vw, 1.5rem);
    line-height: 1.4;
    color: var(--text);
}

.button {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    border: 2px solid var(--accent);
    border-radius: 2px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.button:hover,
.button:focus-visible {
    background: var(--accent);
    color: var(--bg);
}

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

@media (max-width: 700px) {
    .hero {
        display: block;
        aspect-ratio: auto;
        min-height: 0;
        max-height: none;
        padding: 0 0 2.5rem;
    }

    .hero-image {
        position: static;
        height: auto;
        aspect-ratio: 4 / 3;
        object-position: right top;
    }

    .hero-text {
        max-width: none;
        padding: 1.5rem var(--gutter) 0;
    }
}

/* Panels */

.panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 3rem var(--gutter);
}

@media (min-width: 640px) {
    .panels { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1100px) {
    .panels { grid-template-columns: repeat(4, 1fr); }
}

.panel {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
}

@media (hover: hover) {
    .panel {
        transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .panel:hover {
        transform: translateY(-6px);
        border-color: var(--accent);
        box-shadow: 0 8px 24px rgba(111, 200, 255, 0.25);
    }
}

@media (hover: hover) and (prefers-reduced-motion: reduce) {
    .panel { transition: none; }
    .panel:hover { transform: none; }
}

.panel-media {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.word-stream {
    background: var(--bg);
}

/* Word stream: one <symbol> per page, shown through <use> (DESIGN.md) */

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

#word-stream text {
    font-family: var(--font);
    white-space: pre;
}

.panel-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.25rem 1.25rem 1.5rem;
}

.panel h2 {
    margin: 0 0 0.6rem;
    font-size: 1.3rem;
}

.panel p {
    margin: 0 0 1rem;
    color: var(--text-2);
}

.panel .bulletin {
    color: var(--text);
}

.panel .status {
    margin: auto 0 0;
    color: var(--accent);
}

/* Panel link: one real link, stretched over the whole panel */

.panel-link {
    margin-top: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.panel-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
}

.panel-link:hover,
.panel-link:focus-visible {
    text-decoration: underline;
}

.panel-link:focus-visible {
    outline: none;
}

.panel-link:focus-visible::after {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* Sub-pages */

.subpage {
    max-width: calc(720px + 2 * var(--gutter));
    margin: 0 auto;
    padding: 1.5rem var(--gutter) 3rem;
}

.subpage-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
}

.subpage h1 {
    margin: 2rem 0 0.5rem;
    font-size: clamp(2rem, 5vw, 2.75rem);
}

.subpage h2 {
    margin: 2.5rem 0 1rem;
    font-size: 1.6rem;
}

.subpage p,
.subpage li {
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--text-2);
}

.subpage p {
    margin: 0 0 1.25rem;
}

.subpage .status {
    margin: 0 0 1.5rem;
    font-size: 0.75rem;
    line-height: 1.55;
    color: var(--accent);
}

.subpage .lead {
    margin: 0 0 2rem;
    font-size: 1.25rem;
}

.subpage ul {
    margin: 0 0 1.25rem;
    padding-left: 1.25rem;
}

.subpage li {
    margin-bottom: 0.35rem;
}

.features {
    margin: 0 0 1.25rem;
    padding-left: 1.25rem;
}

.features li {
    margin-bottom: 0.75rem;
}

.subpage strong {
    color: var(--text);
    font-weight: 700;
}

.subpage h3 {
    margin: 2rem 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
}

.subpage h2 + h3 {
    margin-top: 1rem;
}

.subpage blockquote {
    margin: 2rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 3px solid var(--accent);
}

.subpage blockquote p {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
}

.subpage blockquote p:last-child {
    margin-bottom: 0;
}

.subpage code {
    padding: 0.1em 0.35em;
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    background: var(--panel-bg);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.subpage a {
    color: var(--accent);
}

.ws-accent {
    width: 100%;
    margin: 2.5rem 0;
}

.back-link a {
    text-decoration: none;
}

.back-link a:hover,
.back-link a:focus-visible {
    text-decoration: underline;
}

/* About page: no status label under the title; closing line instead of the back link */

.about h1 {
    margin-bottom: 1.5rem;
}

/* Closing line with the otter twins: they stand on the text baseline, or drop below when space runs out */

.subpage .closing {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.6em;
    row-gap: 0.3em;
    margin: 2.5rem 0 0;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.15;
}

.subpage .closing a {
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.closing-twins {
    display: block;
    flex: none;
    width: auto;
    height: 1.4em;
}

.subpage .closing a:hover,
.subpage .closing a:focus-visible {
    text-decoration: underline;
}

/* Footer */

.site-footer {
    padding: 2rem var(--gutter) 2.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-2);
}

.site-footer p {
    margin: 0.25rem 0;
}

.site-footer a {
    color: var(--text-2);
}
