@font-face {
    font-family: 'Instrument Sans';
    src: url('/fonts/InstrumentSans-Variable.woff2') format('woff2');
    font-weight: 400 700;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/fonts/JetBrainsMono-Variable.woff2') format('woff2');
    font-weight: 100 800;
    font-display: swap;
}

:root {
    --bg: #ffffff;
    --text: #18181b;
    --muted: #63636b;
    --line: #e4e4e7;
    --hover: #f4f4f5;
    --accent: #1b6b7c;
    --amber: #8f5a00;
    --red: #dc2626;
    --orange: #b24606;
    --kali: #2563d9;
    --sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    color-scheme: light;
}

[data-theme='dark'] {
    --bg: #09090b;
    --text: #fafafa;
    --muted: #a1a1aa;
    --line: #27272a;
    --hover: #18181b;
    --accent: #45dbff;
    --amber: #fbbf24;
    --red: #f87171;
    --orange: #fb923c;
    --kali: #6ea8ff;
    color-scheme: dark;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 1.5rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 1rem/1.6 var(--sans);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
dl,
dd,
blockquote {
    margin: 0;
    padding: 0;
}

ul {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 0.2em;
    transition: text-decoration-color 0.15s, color 0.15s;
}

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

a[href^='http']::after {
    content: '';
    display: inline-block;
    width: 0.625em;
    height: 0.625em;
    margin-left: 0.3em;
    background: currentColor;
    opacity: 0.55;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M2 8 8 2M3 2h5v5'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: opacity 0.15s;
}

a[href^='http']:hover::after {
    opacity: 1;
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

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

.layout {
    display: grid;
    grid-template-columns: 10rem minmax(0, 46rem);
    gap: 4rem;
    justify-content: center;
    padding: 3rem 1.5rem 6rem;
}

.side {
    position: sticky;
    top: 3rem;
    align-self: start;
    font: 400 0.8125rem/1.5 var(--mono);
}

.side nav {
    display: flex;
    flex-direction: column;
}

.side nav a {
    padding: 0.3125rem 0 0.3125rem 0.875rem;
    border-left: 1px solid var(--line);
    color: var(--muted);
    text-decoration: none;
}

.side nav a:hover {
    color: var(--text);
}

.side nav a[aria-current] {
    border-left-color: var(--accent);
    color: var(--text);
}

.controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
    color: var(--muted);
}

.controls a {
    text-decoration: none;
}

.controls a[aria-current] {
    color: var(--text);
}

.controls button {
    padding: 0 0 0 0.75rem;
    border: 0;
    border-left: 1px solid var(--line);
    background: none;
}

.controls button:hover {
    color: var(--accent);
}

[data-theme='dark'] .to-dark,
[data-theme='light'] .to-light {
    display: none;
}

.head {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.head img {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    object-fit: cover;
}

h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.role {
    margin-top: 0.375rem;
    font-size: 1.125rem;
    color: var(--muted);
}

.contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin-top: 0.875rem;
    font: 400 0.8125rem/1.6 var(--mono);
    color: var(--muted);
}

.downloads {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 1.125rem;
    font: 400 0.8125rem/1.6 var(--mono);
    color: var(--muted);
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.875rem;
    border-radius: 6px;
    background: var(--accent);
    color: var(--bg);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s;
}

.button::before {
    content: '';
    width: 0.75rem;
    height: 0.75rem;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M6 1v7M3 5.5 6 8.5 9 5.5M1.5 11h9'/%3E%3C/svg%3E") center / contain no-repeat;
}

.button:hover {
    color: var(--bg);
    opacity: 0.85;
}

.pgp {
    margin-left: 0.375rem;
    padding: 0 0.3125rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    font-size: 0.6875rem;
    text-decoration: none;
}

.pgp:hover {
    border-color: var(--accent);
}

.facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 2.5rem 0 0.5rem;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.facts li + li {
    border-left: 1px solid var(--line);
}

.facts a {
    display: block;
    height: 100%;
    padding: 0.875rem 1rem 1rem;
    text-decoration: none;
    transition: background 0.15s;
}

.facts a:hover {
    background: var(--hover);
    color: inherit;
}

.facts strong {
    display: block;
    font-size: 1.625rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--accent);
}

.facts span {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--muted);
}

section {
    padding: 2.25rem 0;
    border-bottom: 1px solid var(--line);
}

section:last-child {
    border-bottom: 0;
}

h2 {
    margin-bottom: 1.125rem;
    font: 500 0.75rem/1.6 var(--mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.count {
    margin-left: 0.25rem;
    color: var(--accent);
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.prose p + p {
    margin-top: 0.875rem;
}

.lead {
    margin: -0.375rem 0 1rem;
    color: var(--muted);
}

.cert {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.125rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
}

.cert:first-child {
    padding-top: 0;
}

.cert img {
    width: 3.5rem;
    height: 3.5rem;
    object-fit: contain;
}

.cert h3 {
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

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

.cert .status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.25rem 1rem;
    font: 400 0.8125rem/1.6 var(--mono);
    text-align: right;
}

.status span::before {
    content: '';
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.5rem;
    border: 1px solid var(--accent);
    border-radius: 50%;
}

.is-earned .status span {
    color: var(--text);
}

.is-earned .status span::before {
    background: var(--accent);
}

.is-in_progress .status span {
    color: var(--amber);
}

.is-in_progress .status span::before {
    border-color: var(--amber);
}

.is-planned .status span::before {
    border-color: var(--muted);
    border-style: dashed;
}

.is-in_progress h3,
.is-planned h3 {
    font-weight: 500;
}

.is-planned h3 {
    color: var(--muted);
}

.toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.3125rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none;
    font: 400 0.8125rem/1.6 var(--mono);
    color: var(--muted);
    transition: border-color 0.15s, color 0.15s;
}

.js .toggle {
    display: inline-flex;
}

.toggle::after {
    content: '';
    width: 0.4375rem;
    height: 0.4375rem;
    margin-top: -0.25rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s;
}

.toggle[aria-expanded='true']::after {
    margin-top: 0.1875rem;
    transform: rotate(-135deg);
}

.toggle:hover {
    border-color: var(--accent);
    color: var(--text);
}

.js .collapsible:not(.open) .extra {
    display: none;
}

.toggle + .rows {
    margin-top: 0.875rem;
}

.row {
    display: grid;
    gap: 0.125rem 1.25rem;
    align-items: baseline;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--line);
}

.row:first-child {
    border-top: 1px solid var(--line);
}

.rows > .row:last-child {
    border-bottom: 0;
}

.row p {
    color: var(--muted);
    font-size: 0.9375rem;
}

.row-path {
    grid-template-columns: minmax(0, 1fr) auto;
    font-size: 0.9375rem;
}

.row-featured {
    grid-template-columns: 12.5rem minmax(0, 1fr);
}

.row-advisory {
    grid-template-columns: 12.5rem minmax(0, 1fr) 6rem;
}

.row-repo {
    grid-template-columns: 11.5rem minmax(0, 1fr) 6.5rem 3.75rem;
}

.row-ctf {
    grid-template-columns: 5.5rem minmax(0, 1fr) auto 2.75rem;
    align-items: center;
}

.row blockquote {
    margin: 0.625rem 0 0.25rem;
    padding-left: 0.875rem;
    border-left: 2px solid var(--accent);
}

.row blockquote p {
    color: var(--text);
    font-style: italic;
}

.row cite {
    display: block;
    margin-top: 0.125rem;
    font: 400 0.75rem/1.6 var(--mono);
    color: var(--muted);
}

.row .more {
    margin-top: 0.375rem;
    font: 400 0.8125rem/1.6 var(--mono);
}

.key {
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.mono {
    font: 500 0.875rem/1.6 var(--mono);
}

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

.row-repo .key.mono {
    color: var(--accent);
}

.meta {
    font: 400 0.75rem/1.6 var(--mono);
    color: var(--muted);
}

.row-repo .meta {
    align-self: start;
    line-height: 1.5rem;
}

.stars {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.star {
    flex: none;
    width: 0.8125rem;
    height: 0.8125rem;
    fill: var(--amber);
}

.lang i {
    background: var(--muted);
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.4375rem;
    border-radius: 50%;
}

.tag {
    margin-left: 0.375rem;
    font: 400 0.75rem/1.6 var(--mono);
    color: var(--accent);
    white-space: nowrap;
}

.kali {
    display: inline-block;
    margin-left: 0.375rem;
    padding: 0.0625rem 0.5rem;
    border: 1px solid color-mix(in srgb, var(--kali) 45%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--kali) 12%, transparent);
    color: var(--kali);
    font: 500 0.6875rem/1.6 var(--mono);
    text-decoration: none;
    white-space: nowrap;
}

.kali:hover {
    border-color: var(--kali);
    color: var(--kali);
}

.sev {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
}

.sev-critical {
    color: var(--red);
}

.sev-high {
    color: var(--orange);
}

.sev-medium {
    color: var(--amber);
}

.thumb {
    display: block;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: none;
    overflow: hidden;
    cursor: zoom-in;
    transition: border-color 0.15s;
}

.thumb:hover {
    border-color: var(--accent);
}

.thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.label {
    padding: 0 0.4375rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    font: 400 0.75rem/1.6 var(--mono);
    white-space: nowrap;
}

.label.solo {
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
    color: var(--accent);
}

.row-ctf time {
    text-align: right;
}

dialog {
    max-width: min(60rem, 92vw);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
}

dialog::backdrop {
    background: rgb(0 0 0 / 0.75);
}

dialog img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
}

dialog form {
    padding: 0.625rem 0.875rem;
    text-align: right;
}

dialog button {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none;
    font: 400 0.8125rem/1.6 var(--mono);
}

.entry + .entry {
    margin-top: 1.5rem;
}

.entry header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.entry time {
    flex: none;
    font: 400 0.8125rem/1.6 var(--mono);
    color: var(--muted);
}

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

.entry ul {
    margin-top: 0.5rem;
}

.entry li {
    position: relative;
    padding-left: 1.125rem;
    font-size: 0.9375rem;
}

.entry li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75em;
    width: 0.5rem;
    height: 1px;
    background: var(--muted);
}

.skills {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: 0.5rem 1.25rem;
}

.skills dt {
    font-weight: 600;
}

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

@media (max-width: 900px) {
    .layout {
        display: block;
        padding: 1.25rem 1.25rem 4rem;
    }

    .side {
        position: static;
    }

    .side nav {
        display: none;
    }

    .controls {
        justify-content: flex-end;
        margin: 0 0 1.5rem;
    }
}

@media (max-width: 640px) {
    .head {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .facts li:nth-child(3) {
        border-left: 0;
    }

    .facts li:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }

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

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

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

    .row-repo p,
    .row-advisory p {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .row-ctf {
        grid-template-columns: 4.5rem minmax(0, 1fr) auto;
    }

    .row-ctf .label {
        grid-column: 2;
        justify-self: start;
    }

    .row-ctf time {
        grid-column: 3;
        grid-row: 1;
    }

    .entry header {
        flex-direction: column;
        gap: 0.125rem;
    }

    .cert {
        grid-template-columns: 3rem minmax(0, 1fr);
        gap: 0.25rem 0.875rem;
    }

    .cert img {
        width: 3rem;
        height: 3rem;
        grid-row: span 2;
    }

    .cert-blank {
        grid-row: span 2;
    }

    .cert .status {
        justify-content: flex-start;
        text-align: left;
    }

    .skills {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .skills dd {
        margin-bottom: 0.75rem;
    }
}

@page {
    margin: 12mm 14mm;
}

.print-note {
    display: none;
}

@media print {
    :root,
    [data-theme='dark'] {
        --bg: #ffffff;
        --text: #000000;
        --muted: #444444;
        --line: #cccccc;
        --accent: #000000;
        --amber: #000000;
        --red: #000000;
        --orange: #000000;
        --kali: #000000;
        color-scheme: light;
    }

    html {
        font-size: 11px;
    }

    .layout {
        display: block;
        padding: 0;
    }

    .side,
    .toggle,
    .downloads,
    .thumb,
    .collapsible > .rows.extra,
    dialog,
    a[href^='http']::after {
        display: none !important;
    }

    .js .collapsible:not(.open) .entry.extra {
        display: block;
    }

    .print-note {
        display: block;
        margin-top: 0.5rem;
        font: 400 0.8125rem/1.6 var(--mono);
        color: var(--muted);
    }

    .head img {
        width: 4.5rem;
        height: 4.5rem;
    }

    .facts {
        margin: 1.25rem 0 0;
    }

    .facts a {
        padding: 0.5rem 0.75rem 0.625rem;
    }

    .facts strong {
        font-size: 1.375rem;
    }

    section {
        padding: 1rem 0;
    }

    h2 {
        margin-bottom: 0.625rem;
    }

    .row {
        padding: 0.3125rem 0;
    }

    .cert {
        padding: 0.375rem 0;
    }

    .cert,
    .cert img {
        grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    }

    .cert img {
        width: 2.5rem;
        height: 2.5rem;
    }

    .row-ctf {
        grid-template-columns: minmax(0, 1fr) auto 2.75rem;
    }

    .row-ctf div {
        display: flex;
        flex-wrap: wrap;
        gap: 0 0.75rem;
        align-items: baseline;
    }

    .entry + .entry {
        margin-top: 0.875rem;
    }

    .entry ul {
        margin-top: 0.25rem;
    }

    .entry,
    .row,
    .cert,
    .facts,
    h2 {
        break-inside: avoid;
    }

    h2 {
        break-after: avoid;
    }
}
