/*
Theme Name: SatisPress Theme
Theme URI: https://github.com/bitfactory-nl/internal-satispressnobearsdev
Author: Bitfactory
Author URI: https://www.bitfactory.nl
Description: Minimal theme for the SatisPress package repository. WordPress requires a theme to be present; this one has a single landing template and no build step.
Version: 1.2.0
Requires at least: 6.7
Requires PHP: 8.2
License: Proprietary
Text Domain: satispress-theme
*/

/* -------------------------------------------------------------------------
   Tokens — drafting paper by default, machine room in the dark
   ---------------------------------------------------------------------- */

:root {
    --ink: #16181c;
    --ink-muted: #5c6169;
    --paper: #f2efe8;
    --paper-deep: #e9e5db;
    --rule: rgb(22 24 28 / 14%);
    --rule-faint: rgb(22 24 28 / 7%);
    --rule-strong: rgb(22 24 28 / 32%);
    --accent: #b3400d;

    --font-plate: "Berkeley Mono", "IBM Plex Mono", "JetBrains Mono", "SF Mono",
        ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;

    --grid-minor: 30px;
    --grid-major: 150px;
    --gutter: clamp(1.5rem, 6vw, 7rem);
    --ease: cubic-bezier(0.16, 0.84, 0.28, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e7e4dd;
        --ink-muted: #8b8f97;
        --paper: #0b0c0e;
        --paper-deep: #060708;
        --rule: rgb(231 228 221 / 16%);
        --rule-faint: rgb(231 228 221 / 8%);
        --rule-strong: rgb(231 228 221 / 34%);
        --accent: #e8963c;
    }
}

/* -------------------------------------------------------------------------
   Stage
   ---------------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--paper);
    color: var(--ink);
    font-family: var(--font-plate);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

.stage {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100svh;
    padding: var(--gutter);
    overflow: hidden;
    background-image: radial-gradient(120% 90% at 78% 8%, transparent 20%, var(--paper-deep) 100%);
}

.admin-bar .stage {
    min-height: calc(100svh - var(--wp-admin--admin-bar--height, 32px));
}

/* Blueprint grid: a fine mesh with a heavier module every fifth line,
   masked so it dissolves before it reaches the edges. */
.stage__grid {
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--rule-faint) 1px, transparent 1px),
        linear-gradient(to bottom, var(--rule-faint) 1px, transparent 1px),
        linear-gradient(to right, var(--rule) 1px, transparent 1px),
        linear-gradient(to bottom, var(--rule) 1px, transparent 1px);
    background-size:
        var(--grid-minor) var(--grid-minor),
        var(--grid-minor) var(--grid-minor),
        var(--grid-major) var(--grid-major),
        var(--grid-major) var(--grid-major);
    mask-image: radial-gradient(110% 80% at 30% 50%, #000 30%, transparent 78%);
    animation: settle 1.1s var(--ease) both;
}

/* Registration marks, as on a technical drawing */
.mark {
    position: absolute;
    width: 15px;
    height: 15px;
    pointer-events: none;
    opacity: 0;
    animation: register 0.6s var(--ease) 0.32s both;
}

.mark::before,
.mark::after {
    position: absolute;
    background-color: var(--ink);
    content: "";
    opacity: 0.4;
}

.mark::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
}

.mark::after {
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
}

.mark--tl { top: calc(var(--gutter) / 2); left: calc(var(--gutter) / 2); }
.mark--tr { top: calc(var(--gutter) / 2); right: calc(var(--gutter) / 2); }
.mark--bl { bottom: calc(var(--gutter) / 2); left: calc(var(--gutter) / 2); }
.mark--br { bottom: calc(var(--gutter) / 2); right: calc(var(--gutter) / 2); }

/* -------------------------------------------------------------------------
   Plate
   ---------------------------------------------------------------------- */

.plate {
    position: relative;
    z-index: 1;
    max-width: 62rem;
    margin-left: clamp(0rem, 8vw, 9rem);
    padding-left: clamp(1.25rem, 4vw, 3rem);
}

/* The margin rule the plate hangs from */
.plate::before {
    position: absolute;
    top: 0.25em;
    bottom: 0.25em;
    left: 0;
    width: 1px;
    background-color: var(--ink);
    content: "";
    opacity: 0.22;
    transform-origin: top;
    animation: drop 0.8s var(--ease) 0.1s both;
}

.plate__status {
    display: block;
    width: 7px;
    height: 7px;
    margin-bottom: 1.5rem;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
    animation: reveal 0.6s var(--ease) 0.2s both, beacon 3.4s ease-out 1.2s infinite;
}

.plate__name {
    margin: 0;
    color: var(--ink);
    font-size: clamp(2.5rem, 8.5vw, 6rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 0.94;
    animation: reveal 0.7s var(--ease) 0.28s both;
}

.plate__rule {
    width: 100%;
    max-width: 34rem;
    height: 1px;
    margin: clamp(1.75rem, 4vw, 2.75rem) 0;
    border: 0;
    background-image: linear-gradient(to right, var(--accent) 0 4.5rem, var(--rule-strong) 4.5rem 100%);
    transform-origin: left;
    animation: extend 0.9s var(--ease) 0.44s both;
}

.plate__note {
    max-width: 58ch;
    margin: 0;
    color: var(--ink-muted);
    font-size: clamp(0.9375rem, 0.55rem + 0.5vw, 1.0625rem);
    letter-spacing: 0.005em;
    line-height: 1.75;
    text-wrap: pretty;
    animation: reveal 0.7s var(--ease) 0.54s both;
}

/* -------------------------------------------------------------------------
   Motion
   ---------------------------------------------------------------------- */

@keyframes reveal {
    from { opacity: 0; transform: translate3d(0, 0.7rem, 0); }
    to   { opacity: 1; transform: none; }
}

@keyframes extend {
    from { opacity: 0; transform: scaleX(0); }
    to   { opacity: 1; transform: none; }
}

@keyframes drop {
    from { opacity: 0; transform: scaleY(0); }
    to   { opacity: 0.22; transform: none; }
}

@keyframes settle {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes register {
    from { opacity: 0; transform: scale(1.6); }
    to   { opacity: 1; transform: none; }
}

@keyframes beacon {
    0%        { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
    45%, 100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
    .stage__grid,
    .mark,
    .plate::before,
    .plate__status,
    .plate__name,
    .plate__rule,
    .plate__note {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .plate::before { opacity: 0.22; }
    .mark { opacity: 1; }
}
