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

:root {
    --bg: #29292a;
    --surface: #29292a;
    --surface2: #29292a;
    --border: #000000;
    --green: #39d353;
    --green-dim: #1a6630;
    --cyan: #58a6ff;
    --orange: #f0883e;
    --text: #c9d1d9;
    --muted: #484f58;
    --white: #f0f6fc;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --sans: 'Space Grotesk', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    font-weight: 200;
    line-height: 1.7;
    overflow-x: hidden;
}

/* scanline effect */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px);
    pointer-events: none;
    z-index: 9999;
}

/* grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(57, 211, 83, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57, 211, 83, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 13px;
    background: var(--green);
    animation: blink 1.1s step-end infinite;
    vertical-align: middle;
    margin-left: 4px;
}

/* header */
header {
    padding: 1rem 0 3rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: start;
    animation: fadeUp 0.8s 0.1s ease both;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.logo-wrap img {
    height: 120px;
    width: auto;
}

.logo-name {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: var(--white);
}

.logo-name span {
    color: var(--green);
}

h1 {
    font-family: var(--mono);
    font-size: clamp(1.7rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--white);
    letter-spacing: -0.02em;
}

h1 .comment {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--green-dim);
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

h1 .highlight {
    color: var(--orange);
}

h1 .highlight-o {
    color: var(--orange);
}

.subtitle {
    margin-top: 0.9rem;
    font-size: 0.82rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.subtitle .sep {
    color: var(--border);
    margin: 0 0.5rem;
}

/* portrait */
.portrait-wrap {
    position: relative;
    flex-shrink: 0;
}

.portrait-frame {
    width: 148px;
    position: relative;
}

.portrait-frame::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid var(--orange);
    z-index: 0;
}

.portrait-frame img {
    width: 148px;
    height: 185px;
    object-fit: cover;
    object-position: center top;
    display: block;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border);
    filter: grayscale(20%) contrast(1.05);
}

.portrait-tag {
    font-size: 0.62rem;
    color: var(--green);
    letter-spacing: 0.1em;
    margin-top: 0.6rem;
    text-align: left;
}

/* sections */
section {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
    animation: fadeUp 0.7s ease both;
}

section:nth-of-type(1) {
    animation-delay: 0.25s;
}

section:nth-of-type(2) {
    animation-delay: 0.35s;
}

section:nth-of-type(3) {
    animation-delay: 0.45s;
}

section:nth-of-type(4) {
    animation-delay: 0.55s;
}

.section-header {
    margin-bottom: 1.4rem;
}

.fn {
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.06em;
}

.fn-kw {
    color: #ff7b72;
}

.fn-name {
    color: var(--cyan);
}

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

.fn-ret {
    color: var(--orange);
}

h2 {
    font-family: var(--sans);
    font-size: clamp(1.2rem, 2.5vw, 1.55rem);
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0.8rem;
}

p {
    font-family: var(--hack);
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text);
    max-width: 680px;
    margin-bottom: 0.9rem;
}

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

.inline-code {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.2);
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 0.8em;
    padding: 0.1em 0.45em;
    border-radius: 3px;
}

/* cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1px;
    border: 1px solid var(--border);
    margin-top: 1.5rem;
}

.card {
    background: var(--surface);
    padding: 1.5rem;
    transition: background 0.2s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--oran);
    transition: background 0.2s;
}

.card:hover {
    background: var(--surface2);
}

.card:hover::before {
    background: var(--orange);
}

.card-num {
    font-size: 0.62rem;
    color: var(--muted);
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
}

.card h3 {
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--orange);
    margin-bottom: 0.5rem;
    letter-spacing: 0.04em;
}

.card p {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0;
    font-family: var(--sans);
}

/* tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1.2rem;
}

.tag {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 2px;
    transition: all 0.18s;
}

.tag:hover {
    border-color: var(--orange);
    color: var(--green);
}

.tag.hi {
    border-color: var(--orange);
    color: var(--orange);
}

/* contact */
.contact-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
}

.contact-links a {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--cyan);
    text-decoration: none;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}

.contact-links a:hover {
    color: var(--white);
}

.contact-links a::before {
    content: '→';
    color: var(--green);
    font-size: 0.7rem;
}

/* footer */
footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0 2.5rem;
    font-size: 0.68rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* responsive */
@media (max-width: 580px) {
    header {
        grid-template-columns: 1fr;
    }

    .portrait-frame img {
        width: 110px;
        height: 138px;
    }

    .portrait-frame {
        width: 110px;
    }

    .logo-wrap img {
        width: 95%;
        height: auto;
    }
}