/* Engineering notebook design system. */

:root {
    --paper: #f4efe6;
    --paper-deep: #ece4d4;
    --ink: #1a1814;
    --ink-soft: #4a463e;
    --ink-faint: #736d62;
    --rule: #d8cfb8;
    --amber: #b8732a;
    --oxblood: #7a2820;
    --frame: #1a1814;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #15140f;
        --paper-deep: #1c1a14;
        --ink: #e8e2d2;
        --ink-soft: #b0a995;
        --ink-faint: #7a7468;
        --rule: #3a352b;
        --amber: #d99850;
        --oxblood: #c46656;
        --frame: #1a1814;
    }
    body::before { mix-blend-mode: screen; }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* paper grain */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    z-index: 1;
}

a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--amber);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.15s;
}
a:hover { color: var(--amber); }

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
    border-radius: 1px;
}

@media (prefers-reduced-motion: reduce) {
    .hero h1 .caret { animation: none; }
    .writing .post,
    .writing .post .arrow,
    a { transition: none; }
}

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 60px 32px 120px;
    position: relative;
    z-index: 2;
}

/* On post pages, narrow the wrap so site-header rule
   aligns with the article reading column. */
.wrap:has(.post-article) {
    max-width: 720px;
}

/* hero */
.hero h1 {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
}
@keyframes blink { 50% { opacity: 0; } }
.hero h1 .caret {
    color: var(--amber);
    font-weight: 400;
    animation: blink 1.1s steps(2) infinite;
}
.hero .pillars {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
    margin: -16px 0 22px;
    line-height: 1.6;
}
.hero .pillars .sep { color: var(--amber); margin: 0 6px; }
.hero .manifesto {
    font-family: 'JetBrains Mono', monospace;
    font-style: italic;
    font-weight: 500;
    font-size: clamp(18px, 2.4vw, 24px);
    color: var(--ink);
    margin: 0 0 28px;
    letter-spacing: -0.005em;
}
.hero .manifesto::before {
    content: '› ';
    color: var(--amber);
    font-style: normal;
}
.hero .tag {
    font-size: 14px;
    color: var(--ink-soft);
    margin: 0 0 12px;
}
.hero .tag .accent { color: var(--amber); font-weight: 500; }
.hero .tag.quiet {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 17px;
    color: var(--ink-soft);
    margin-top: 4px;
}

/* social/links row */
.links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--rule);
    font-size: 12px;
    color: var(--ink-faint);
}
.links a {
    color: var(--ink-soft);
    text-decoration: none;
}
.links a::before { content: '→ '; color: var(--amber); }
.links a:hover { color: var(--amber); }

/* section header */
section { margin-top: 64px; }
.sec-h {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 28px;
    font-size: 13px;
    color: var(--ink-faint);
}
.sec-h .hash { color: var(--amber); font-weight: 700; }
.sec-h .name {
    color: var(--ink);
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 0;
    font-size: 13px;
    font-family: inherit;
    margin: 0;
}
.sec-h .rule {
    flex: 1;
    border-top: 1px solid var(--rule);
    transform: translateY(-3px);
}

/* experience entries */
.entry {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 24px;
    margin-bottom: 36px;
}
.entry .when {
    font-size: 11px;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.5;
    padding-top: 4px;
}
.entry .when b { display: block; color: var(--amber); font-weight: 500; }
.entry .what h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.entry .what .org {
    font-size: 12px;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}
.entry .what p {
    margin: 0;
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.75;
}

/* skills */
.skills { font-size: 13px; }
.skills-note {
    font-size: 12px;
    color: var(--ink-faint);
    margin: -16px 0 28px;
    line-height: 1.6;
}
.skills-note .slash { color: var(--amber); }
.skills .group {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 24px;
}
.skills .label {
    color: var(--amber);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.1em;
    padding-top: 2px;
}
.skills .vals { color: var(--ink-soft); line-height: 1.85; }
.skills .vals span { display: inline; }
.skills .vals span::after { content: ' · '; color: var(--ink-faint); }
.skills .vals span:last-child::after { content: ''; }

/* MUSIC — disruption */
.music {
    margin: 96px -32px 0;
    padding: 64px 32px 72px;
    background: var(--paper-deep);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    position: relative;
}
.music .ornament {
    position: absolute;
    top: 24px;
    right: 32px;
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 11px;
    color: var(--oxblood);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.music .sec-h .hash,
.music .sec-h .name { color: var(--oxblood); }
.music h2.display {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(24px, 4.2vw, 40px);
    line-height: 1.1;
    margin: 0 0 24px;
    color: var(--ink);
    letter-spacing: -0.005em;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .music h2.display { white-space: normal; }
}
.music h2.display .amp { color: var(--oxblood); }
.music p {
    font-family: 'EB Garamond', serif;
    font-size: 18px;
    line-height: 1.65;
    color: var(--ink-soft);
    margin: 0 0 16px;
}
.music p a {
    color: var(--ink);
    text-decoration-color: var(--oxblood);
    font-style: italic;
}
.music p a:hover { color: var(--oxblood); }
.music .iframe-wrap {
    margin-top: 36px;
    border: 1px solid var(--rule);
    background: var(--frame);
    aspect-ratio: 16 / 9;
}
.music iframe { width: 100%; height: 100%; border: 0; display: block; }

/* awards */
.awards { font-size: 13px; }
.awards ul { padding: 0; margin: 0; }
.awards li {
    list-style: none;
    padding: 10px 0;
    border-bottom: 1px dashed var(--rule);
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: baseline;
    gap: 12px;
}
.awards li:last-child { border-bottom: 0; }
.awards .glyph {
    color: var(--amber);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.awards .yr {
    font-size: 11px;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* writing teasers (used on home + blog index) */
.writing { margin-top: 56px; }
.writing .post {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 24px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--rule);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.writing .post:first-of-type { border-top: 1px dashed var(--rule); }
.writing .post:hover { background: var(--paper-deep); }
.writing .post .when {
    font-size: 11px;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-top: 4px;
}
.writing .post .body h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: var(--ink);
}
.writing .post .body p {
    margin: 0;
    font-size: 12.5px;
    color: var(--ink-soft);
    line-height: 1.6;
}
.writing .post .arrow {
    color: var(--amber);
    font-size: 13px;
    align-self: center;
    opacity: 0.8;
    padding-right: 12px;
    transition: opacity 0.15s, transform 0.15s;
}
.writing .post:hover .arrow {
    opacity: 1;
    transform: translateX(3px);
}
.writing .all {
    display: inline-block;
    margin-top: 16px;
    font-size: 12px;
    color: var(--ink-soft);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.writing .all::before { content: '→ '; color: var(--amber); }
.writing .all:hover { color: var(--amber); }

/* site header for blog pages */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--rule);
    margin-bottom: 48px;
    font-size: 12px;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.site-header .home {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
    text-decoration: none;
    text-transform: none;
    letter-spacing: -0.01em;
}
.site-header .home:hover { color: var(--amber); }
.site-header .crumb { color: var(--ink-faint); }
.site-header .crumb a {
    color: var(--ink-soft);
    text-decoration: none;
}
.site-header .crumb a::before { content: '→ '; color: var(--amber); }
.site-header .crumb a:hover { color: var(--amber); }

/* blog post article — fills the (already narrowed) wrap */
.post-article {
    max-width: 100%;
}
.post-article .post-back {
    margin-bottom: 24px;
    font-size: 11px;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.post-article .post-back a {
    color: var(--ink-soft);
    text-decoration: none;
}
.post-article .post-back a::before { content: '← '; color: var(--amber); }
.post-article .post-back a:hover { color: var(--amber); }
.post-article h1 {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin: 0 0 12px;
    color: var(--ink);
}
.post-article .dek {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: clamp(18px, 2.2vw, 22px);
    color: var(--ink-soft);
    margin: 0 0 24px;
    line-height: 1.35;
}
.post-article .post-meta {
    font-size: 11px;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px dashed var(--rule);
}
.post-article .body {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 19px;
    line-height: 1.65;
    color: var(--ink);
}
.post-article .body p {
    margin: 0 0 1.1em;
}
.post-article .body h2 {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-weight: 500;
    font-size: 26px;
    color: var(--oxblood);
    margin: 2em 0 0.5em;
    letter-spacing: -0.005em;
}
.post-article .body h3 {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink);
    margin: 1.8em 0 0.5em;
}
.post-article .body a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--amber);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.post-article .body a:hover { color: var(--amber); }
.post-article .body strong { font-weight: 700; color: var(--ink); }
.post-article .body em { font-style: italic; }
.post-article .body code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.85em;
    background: var(--paper-deep);
    padding: 1px 6px;
    border-radius: 2px;
    color: var(--ink);
}
.post-article .body pre {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    background: var(--paper-deep);
    padding: 16px 20px;
    border-left: 3px solid var(--amber);
    overflow-x: auto;
    line-height: 1.6;
    margin: 1.2em 0;
}
.post-article .body pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}
.post-article .body ul,
.post-article .body ol {
    margin: 0 0 1.1em;
    padding-left: 1.4em;
}
.post-article .body ul li,
.post-article .body ol li {
    margin-bottom: 0.4em;
}
.post-article .body ul {
    list-style: none;
    padding-left: 1.6em;
}
.post-article .body ul li {
    position: relative;
}
.post-article .body ul li::before {
    content: '—';
    position: absolute;
    left: -1.4em;
    color: var(--amber);
}
.post-article .body blockquote,
.post-article .body .tldr {
    margin: 1.4em 0;
    padding: 8px 0 8px 20px;
    border-left: 3px solid var(--oxblood);
    font-style: italic;
    color: var(--ink-soft);
}
.post-article .body .tldr strong {
    font-style: normal;
    color: var(--oxblood);
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    display: inline-block;
    margin-right: 4px;
}
.post-article .body sup { font-size: 0.65em; vertical-align: super; line-height: 0; }
.post-article .body iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--rule);
    background: var(--frame);
    margin: 1.4em 0;
}

/* end-of-post return link */
.post-article .post-end {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px dashed var(--rule);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.post-article .post-end a {
    color: var(--ink-soft);
    text-decoration: none;
}
.post-article .post-end a::before { content: '← '; color: var(--amber); }
.post-article .post-end a:hover { color: var(--amber); }

/* print */
@media print {
    body { background: #fff; color: #000; }
    body::before { display: none; }
    .music { background: #fff; border-color: #999; }
    .music .ornament { display: none; }
    .music h2.display, .music p, .music p a { color: #000; }
    .music .iframe-wrap, .hero h1 .caret { display: none; }
    a { color: #000; text-decoration-color: #000; }
    .sec-h .hash, .sec-h .name, .entry .when b,
    .skills .label, .awards .glyph, .writing .post .arrow,
    .links a::before, .writing .all::before {
        color: #000;
    }
    .wrap { padding: 0; max-width: 100%; }
    section { margin-top: 32px; }
    .music { margin: 32px 0 0; padding: 16px 0; border: none; border-top: 1px solid #999; }
    .post-article .body { color: #000; }
    .post-article .body h2 { color: #000; }
    .post-article .body code,
    .post-article .body pre { background: #f4f4f4; }
}

/* mobile */
@media (max-width: 600px) {
    .entry { grid-template-columns: 1fr; gap: 6px; }
    .skills .group { grid-template-columns: 1fr; gap: 4px; }
    .music { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
    .wrap { padding: 32px 16px 80px; }
    .writing .post { grid-template-columns: 90px 1fr; }
    .writing .post .arrow { display: none; }
    .post-article .body { font-size: 18px; }
}
