/* -------------------------------------------------------------------------
 * shrinkingman.fit — public styles
 * ---------------------------------------------------------------------- */

:root {
    --teal: #0f766e;
    --teal-bright: #14b8a6;
    --teal-soft: #d7f3ef;
    --ink: #14212b;
    --muted: #5b6b77;
    --bg: #f5f8f8;
    --card: #ffffff;
    --line: #e2e9e9;
    --danger: #b42318;
    --success: #0a6b45;
    --warning: #8a5a00;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(20, 33, 43, 0.04), 0 8px 24px rgba(20, 33, 43, 0.05);
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--teal);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--teal-bright);
}

h1, h2, h3, h4 {
    line-height: 1.2;
    margin: 0 0 0.4em;
    letter-spacing: -0.015em;
}

p {
    margin: 0 0 1em;
}

p:last-child {
    margin-bottom: 0;
}

code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: #eef3f3;
    padding: 0.1em 0.35em;
    border-radius: 5px;
}

.wrap {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
}

.wrap-wide {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Header ---------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.brand:hover {
    color: var(--ink);
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--teal-soft);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-kicker {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 8px 12px;
    border-radius: 9px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.nav-link:hover {
    background: var(--teal-soft);
    color: var(--teal);
}

.nav-link.is-active {
    color: var(--teal);
    background: var(--teal-soft);
}

.nav-search {
    display: flex;
    margin-left: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.nav-search input {
    border: 0;
    padding: 8px 10px;
    width: 150px;
    font: inherit;
    font-size: 14px;
    outline: none;
    background: transparent;
}

.nav-search button {
    border: 0;
    background: var(--teal);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 0 12px;
    cursor: pointer;
}

.nav-search button:hover {
    background: var(--teal-bright);
}

/* Main ------------------------------------------------------------------ */

.site-main {
    padding: 40px 0 64px;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--teal);
}

.hero {
    margin-bottom: 28px;
    max-width: 760px;
}

.hero h1 {
    font-size: clamp(30px, 5vw, 46px);
    margin-bottom: 10px;
}

.lede {
    font-size: 18px;
    color: var(--muted);
    max-width: 60ch;
}

.page-head {
    margin-bottom: 28px;
}

.page-head h1 {
    font-size: clamp(28px, 4vw, 38px);
}

/* Panels ---------------------------------------------------------------- */

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
    margin-bottom: 24px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.panel-head h2 {
    font-size: 20px;
    margin-bottom: 2px;
}

.panel-head-padded {
    padding: 20px 22px 0;
    margin-bottom: 8px;
}

.muted {
    color: var(--muted);
}

.text-link {
    color: var(--teal);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

.text-link:hover {
    text-decoration: underline;
}

/* Graph ----------------------------------------------------------------- */

.graph-panel {
    padding-bottom: 18px;
}

.stat-row {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stat-value small {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-left: 3px;
}

.stat-value.is-down {
    color: var(--success);
}

.graph-wrap {
    position: relative;
    height: 320px;
    margin-top: 6px;
}

.graph-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    margin: 0;
}

/* Post ------------------------------------------------------------------ */

.post {
    padding: 34px;
}

.post-head {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.post-date {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.post-title {
    font-size: clamp(26px, 3.6vw, 38px);
    margin: 0;
}

.post-title a {
    color: var(--ink);
    text-decoration: none;
}

.post-title a:hover {
    color: var(--teal);
}

.post-body {
    font-size: 17px;
    line-height: 1.75;
    max-width: 72ch;
}

.post-body h2 {
    font-size: 24px;
    margin-top: 1.4em;
}

.post-body h3 {
    font-size: 20px;
    margin-top: 1.3em;
}

.post-body blockquote {
    margin: 1.4em 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--teal-bright);
    color: var(--muted);
    font-style: italic;
}

.post-body ul,
.post-body ol {
    padding-left: 1.4em;
}

.post-body img {
    border-radius: 12px;
    margin: 1em 0;
}

.post-body video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1em 0;
}

.post-body figure {
    margin: 1.4em 0;
}

.post-body figcaption {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin-top: 6px;
}

.post-body a {
    font-weight: 600;
}

.post-foot {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    text-decoration: none;
    color: var(--ink);
}

.post-nav-link:hover {
    border-color: var(--teal-bright);
    background: #f8fdfc;
    color: var(--ink);
}

.post-nav-link.is-next {
    text-align: right;
}

.post-nav-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.post-nav-title {
    font-weight: 600;
    font-size: 14px;
}

/* Archive --------------------------------------------------------------- */

.archive-month {
    margin-bottom: 30px;
}

.archive-month-label {
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--teal);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
}

.archive-day {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px dashed #e8eeee;
}

.archive-day:last-child {
    border-bottom: 0;
}

.archive-day-label {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
    padding-top: 2px;
}

.archive-posts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.archive-posts li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 3px 0;
}

.archive-posts a {
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
}

.archive-posts a:hover {
    color: var(--teal);
}

.archive-posts time {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* Search ---------------------------------------------------------------- */

.search-form {
    display: flex;
    gap: 10px;
    max-width: 560px;
}

.search-form input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    background: #fff;
}

.search-form input:focus {
    outline: 2px solid var(--teal-soft);
    border-color: var(--teal-bright);
}

.result-count {
    margin-bottom: 16px;
    font-size: 14px;
}

.search-results {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

.search-result h2 a {
    color: var(--ink);
    text-decoration: none;
}

.search-result h2 a:hover {
    color: var(--teal);
}

.search-snippet {
    color: var(--muted);
    margin: 0;
}

mark {
    background: #fdf0b5;
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
}

/* Buttons --------------------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--teal);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.button:hover {
    background: var(--teal-bright);
    color: #fff;
}

.button.is-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
}

.button.is-ghost:hover {
    border-color: var(--teal-bright);
    background: #f8fdfc;
    color: var(--ink);
}

.button-wide {
    width: 100%;
}

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.text-button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.text-button.is-danger,
.text-link.is-danger {
    color: var(--danger);
}

.inline-form {
    display: inline;
    margin: 0;
}

/* Forms ----------------------------------------------------------------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.field > span {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}

.field input,
.field select,
.field textarea {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 2px solid var(--teal-soft);
    border-color: var(--teal-bright);
}

.field input[readonly] {
    background: #f4f7f7;
    color: var(--muted);
}

.field-hint {
    color: var(--muted);
    font-size: 12px;
}

.field-error {
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    cursor: pointer;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--teal);
}

.stack > * + * {
    margin-top: 4px;
}

/* Alerts and badges ----------------------------------------------------- */

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-success {
    background: #e8f7f0;
    border-color: #b9e6d2;
    color: var(--success);
}

.alert-error {
    background: #fdeceb;
    border-color: #f5c6c2;
    color: var(--danger);
}

.alert-warning {
    background: #fdf6e3;
    border-color: #f0dfae;
    color: var(--warning);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge-hidden {
    background: #eef1f2;
    color: var(--muted);
}

.badge-live {
    background: #e8f7f0;
    color: var(--success);
}

.notice {
    padding: 12px 14px;
    background: #fdf6e3;
    border-radius: 10px;
    color: var(--warning);
}

/* Empty states ---------------------------------------------------------- */

.empty-state {
    text-align: center;
    padding: 46px 26px;
}

.empty-state h2 {
    font-size: 22px;
}

.empty-state p {
    color: var(--muted);
    max-width: 46ch;
    margin-left: auto;
    margin-right: auto;
}

.empty-state .button,
.empty-state .button-row {
    margin-top: 16px;
}

.not-found h1 {
    font-size: clamp(28px, 4vw, 40px);
}

/* Login ----------------------------------------------------------------- */

body.is-minimal .site-main {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 70px);
}

body.is-minimal .wrap {
    max-width: 460px;
}

.auth-card {
    padding: 34px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 22px;
}

.auth-brand img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--teal-soft);
    margin-bottom: 12px;
}

.auth-brand h1 {
    font-size: 26px;
    margin: 0;
}

.auth-back {
    text-align: center;
    margin: 20px 0 0;
}

/* Footer ---------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
    padding: 22px 0;
    font-size: 13px;
    color: var(--muted);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-logo {
    display: block;
    height: 30px;
    width: auto;
}

.footer-logo-link {
    display: block;
    line-height: 0;
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 760px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .site-nav {
        width: 100%;
        flex-wrap: wrap;
    }

    .nav-search {
        flex: 1;
        min-width: 180px;
    }

    .nav-search input {
        width: 100%;
    }

    .site-main {
        padding-top: 24px;
    }

    .post {
        padding: 22px;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .archive-day {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .post-nav {
        grid-template-columns: 1fr;
    }

    .post-nav-link.is-next {
        text-align: left;
    }

    .panel {
        padding: 20px;
    }

    .stat-row {
        gap: 16px;
    }
}
