:root {
    --paper: #f6f3ec;
    --panel: #fbf9f4;
    --ink: #1b1a17;
    --muted: #5c5850;
    --rule: #d9d3c5;
    --accent: #0f5c55;
    --warn: #8a5f00;
    --fail: #a33a2a;
    --head: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --radius: 10px;
    --display: 'Barlow Condensed', 'Arial Narrow', 'Inter', sans-serif;
    --night: #161512;
    --signal: #46c7b6;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
    --wrap: 1040px;
    --gutter: 24px;
}

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

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--rule);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

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

h1,
h2,
h3 {
    font-family: var(--head);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.022em;
    margin: 0;
}

p {
    margin: 0 0 1em;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.label {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
}

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

/* Header */

.site-header {
    padding: 28px 0;
}

.site-header .wrap {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 32px;
    flex-wrap: wrap;
}

.site-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
}

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

.site-mark {
    width: 24px;
    height: 24px;
    flex: none;
}

.site-mark-dot {
    fill: var(--accent);
}

.site-tag {
    margin: 7px 0 0;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.site-nav {
    padding-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site-nav a {
    text-decoration: none;
    color: var(--muted);
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
    color: var(--ink);
}

/* Hero */

.hero {
    position: relative;
    margin: 12px 0 44px;
    padding: 120px 56px 104px;
    overflow: hidden;
    border-radius: 14px;
    background: var(--night);
    color: var(--paper);
}

.hero-text {
    position: relative;
    max-width: 640px;
}

.hero h1 {
    font-family: var(--display);
    font-size: clamp(54px, 9.6vw, 108px);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    margin: 0 0 32px;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero-lead {
    font-size: 18px;
    color: rgba(246, 243, 236, 0.72);
    max-width: 500px;
    margin: 0;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.cta {
    display: inline-block;
    padding: 13px 26px 12px;
    border: 1px solid var(--signal);
    border-radius: 4px;
    font-family: var(--display);
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cta-solid {
    background: var(--signal);
    color: var(--night);
}

.cta-solid:hover {
    background: var(--paper);
    border-color: var(--paper);
    color: var(--night);
}

.cta-ghost {
    border-color: rgba(246, 243, 236, 0.35);
    color: var(--paper);
}

.cta-ghost:hover {
    border-color: var(--paper);
    color: var(--paper);
}

.hero-mark {
    position: absolute;
    right: -40px;
    top: 50%;
    width: 400px;
    height: 400px;
    transform: translateY(-50%);
    pointer-events: none;
    -webkit-mask-image: radial-gradient(circle, #000 40%, transparent 70%);
    mask-image: radial-gradient(circle, #000 40%, transparent 70%);
}

.hero-ring {
    stroke: rgba(246, 243, 236, 0.16);
    stroke-width: 1;
}

.hero-wave,
.hero-glow,
.hero-dot {
    transform-box: fill-box;
    transform-origin: center;
}

.hero-wave {
    stroke: var(--signal);
    stroke-width: 1.5;
    opacity: 0;
    animation: hero-wave 4.5s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}

.hero-wave-2 {
    animation-delay: 1.5s;
}

.hero-wave-3 {
    animation-delay: 3s;
}

.hero-dot {
    fill: var(--signal);
    animation: hero-dot 1.5s ease-in-out infinite;
}

.hero-glow {
    fill: var(--signal);
    animation: hero-glow 1.5s ease-out infinite;
}

@keyframes hero-wave {
    0% {
        transform: scale(0.04);
        opacity: 0;
    }

    8% {
        opacity: 0.75;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes hero-dot {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }
}

@keyframes hero-glow {
    0% {
        transform: scale(1);
        opacity: 0.45;
    }

    100% {
        transform: scale(4.5);
        opacity: 0;
    }
}

.page-head {
    padding: 56px 0 44px;
    max-width: 720px;
}

.page-head h1 {
    font-family: var(--display);
    font-size: clamp(46px, 7.5vw, 84px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    margin: 16px 0 22px;
}

.page-head p:last-child {
    color: var(--muted);
    margin: 0;
}

/* Sections */

.section {
    padding: 20px 0;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px 32px;
}

.section--wide {
    grid-template-columns: minmax(0, 1fr);
}

.section h2 {
    font-family: var(--display);
    font-size: clamp(30px, 4.4vw, 42px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.section-body,
.lab {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 28px;
}

.section-body,
.lab {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.section-body:hover,
.lab:hover {
    border-color: #a9a292;
    box-shadow: 0 1px 0 #a9a292;
}

.section > .label {
    padding-top: 30px;
}

.lab-head > .label {
    padding-top: 8px;
}

.section-body > :last-child {
    margin-bottom: 0;
}

.prose {
    max-width: 640px;
}

.more {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.04em;
}

/* Rows: notes, experience, credentials */

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

.row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 4px 24px;
    padding: 20px 0;
    border-top: 1px solid var(--rule);
}

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

.row:last-child {
    padding-bottom: 0;
}

.row-meta {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 3px;
}

.row h3 {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.row h3 a {
    text-decoration: none;
}

.row p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
}

.row .row-org {
    color: var(--ink);
}

.row .more {
    display: inline-block;
    margin-top: 8px;
    color: var(--ink);
}

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

.pairs dt {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.pairs dd {
    margin: 0;
    font-size: 16px;
}

/* RF Lab */

.lab-head {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px 32px;
}

.lab {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    margin-top: 20px;
    align-items: start;
}

.lab-canvas-wrap {
    position: relative;
    border: 1px solid var(--rule);
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    background: var(--panel);
    line-height: 0;
}

#rf-canvas {
    display: block;
    width: 100%;
    touch-action: none;
    cursor: crosshair;
}

.lab-readout {
    position: absolute;
    z-index: 2;
    display: grid;
    gap: 2px;
    max-width: 260px;
    padding: 8px 10px;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.45;
    pointer-events: none;
}

.lab-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    border: 1px solid var(--rule);
    border-top: 0;
    border-radius: 0 0 6px 6px;
}

.lab-stats div {
    padding: 12px 14px;
    border-left: 1px solid var(--rule);
}

.lab-stats div:first-child {
    border-left: 0;
}

.lab-stats dt,
.lab-score dt,
.lab-field > span,
.lab-field > label {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.lab-stats dd {
    margin: 2px 0 0;
    font-family: var(--head);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
}

.lab-side {
    display: grid;
    gap: 18px;
}

.lab-field {
    display: grid;
    gap: 6px;
}

.seg {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--rule);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.seg button {
    flex: 1 1 auto;
    padding: 8px 6px;
    border: 0;
    border-left: 1px solid var(--rule);
    background: transparent;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.seg button:first-child {
    border-left: 0;
}

.seg button:hover {
    background: var(--panel);
}

.seg button.active {
    background: var(--ink);
    color: var(--paper);
}

.lab select,
.lab input[type='number'] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--rule);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 14px;
    border-radius: 6px;
}

.lab-inline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.lab-inline label {
    display: grid;
    gap: 4px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.lab-score {
    margin: 0;
    border-top: 1px solid var(--rule);
}

.lab-score div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--rule);
}

.lab-score dd {
    margin: 0;
    font-family: var(--mono);
    font-size: 13px;
    text-align: right;
}

.pass {
    color: var(--accent);
}

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

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

.lab-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.btn {
    padding: 10px 8px;
    border: 1px solid var(--ink);
    background: transparent;
    color: var(--ink);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover,
.btn.active {
    background: var(--ink);
    color: var(--paper);
}

.lab-hint,
.lab-note {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
    margin: 0;
}

.lab-note {
    margin-top: 16px;
}

/* Lists on the credentials page */

.tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags li {
    padding: 5px 11px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: #fff;
    font-family: var(--mono);
    font-size: 13px;
}

.plain {
    margin: 8px 0 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 16px;
}

/* Post */

.post {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 0 88px;
}

.post-back {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
}

.post-header {
    padding: 40px 0 36px;
    margin-bottom: 36px;
    border-bottom: 1px solid var(--rule);
}

.post-header h1 {
    font-family: var(--display);
    font-size: clamp(40px, 6.4vw, 68px);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    margin: 16px 0 20px;
}

.post-body h2 {
    font-size: 25px;
    margin: 48px 0 16px;
}

.post-body p {
    margin-bottom: 1.25em;
}

.post-figure {
    margin: 36px 0;
}

.post-figure img {
    width: 100%;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

.post-figure figcaption {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.post-disclaimer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--rule);
    font-size: 15px;
    color: var(--muted);
}

/* Contact */

.contact-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contact-links li {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 4px 24px;
    padding: 16px 0;
    border-top: 1px solid var(--rule);
}

.contact-links li:first-child {
    border-top: 0;
    padding-top: 0;
}

.contact-links a {
    font-family: var(--head);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--rule);
    margin-top: 44px;
    padding: 32px 0 48px;
    font-size: 14px;
    color: var(--muted);
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 32px;
}

.site-footer p {
    margin: 0;
    max-width: 520px;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

@media (max-width: 900px) {
    .lab {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-mark {
        opacity: 0.55;
        right: -130px;
    }
}

@media (max-width: 720px) {
    :root {
        --gutter: 16px;
    }

    body {
        font-size: 16px;
    }

    .hero {
        margin: 4px 0 28px;
        padding: 64px 22px 56px;
    }

    .hero-mark {
        display: none;
    }

    .section,
    .lab-head {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .section {
        padding: 14px 0;
    }

    .section-body,
    .lab {
        padding: 20px 16px;
    }

    .section > .label,
    .lab-head > .label {
        padding-top: 14px;
    }

    .section--wide > .lab-head > .label {
        padding-top: 14px;
    }

    .row,
    .contact-links li {
        grid-template-columns: minmax(0, 1fr);
    }

    .pairs {
        grid-template-columns: minmax(0, 1fr);
    }

    .lab-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lab-stats div:nth-child(3) {
        border-left: 0;
    }

    .lab-stats div:nth-child(n + 3) {
        border-top: 1px solid var(--rule);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-wave,
    .hero-glow,
    .hero-dot {
        animation: none;
    }
}

.section-body.prose {
    max-width: none;
}
