/* Dylan Roberts — tactile office-folder theme (Folderfolio-inspired).
   Shared across every page. Plain CSS, no build.
   Fonts are loaded via <link> in the page <head> (preconnect + non-blocking),
   not @import here — @import serialises the request and delays first paint. */
:root {
    --kraft: #c9aa7d;
    --paper: #f5efe1;
    --paper-2: #efe7d4;
    --line: #e4d9c0;
    --ink: #2c2620;
    --ink-soft: #6d6453;
    --faint: #9a8f78;
    --red: #c0392b;
    --edge: #2c262033;
    --tab-green: #8a9a5b;
    --tab-blue: #6f93b0;
    --tab-red: #c2614a;
    --tab-tan: #d2b787;
    --tab-dark: #3d362a;
    --radius: 4px;
    --shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 18px 40px rgba(60,45,25,.28);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    color: var(--ink);
    background-color: var(--kraft);
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(120,90,50,.025) 3px),
        radial-gradient(120% 120% at 50% -10%, rgba(255,255,255,.18), transparent 60%);
    line-height: 1.6; -webkit-font-smoothing: antialiased; padding: 1.5rem; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.serif { font-family: 'Fraunces', Georgia, serif; }

.prop { text-align: right; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
    color: #5b4a30; opacity: .65; max-width: 1100px; margin: 0 auto .6rem; padding: 0 .5rem; }
.prop b { font-weight: 600; }

/* folder tabs */
.tabs { max-width: 1100px; margin: 0 auto; display: flex; gap: 4px; padding-left: 1.5rem; position: relative; z-index: 3; flex-wrap: wrap; }
.tab { font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: #fff; padding: .55rem .9rem .8rem; border-radius: 8px 8px 0 0; transform: translateY(2px);
    transition: transform .15s; white-space: nowrap; box-shadow: 0 -2px 6px rgba(0,0,0,.12) inset; }
.tab:hover { transform: translateY(-2px); }
.tab.active { transform: translateY(0); box-shadow: 0 -3px 8px rgba(0,0,0,.18) inset; }
.tab:nth-child(1) { background: var(--tab-green); }
.tab:nth-child(2) { background: var(--tab-tan); color: #4a3c22; }
.tab:nth-child(3) { background: var(--tab-blue); }
.tab:nth-child(4) { background: var(--tab-red); }
.tab:nth-child(5) { background: var(--tab-dark); }
.tab .n { opacity: .7; margin-right: .35rem; }

/* paper folder */
.folder { max-width: 1100px; margin: 0 auto; background: var(--paper);
    background-image: linear-gradient(var(--paper), var(--paper-2));
    border-radius: var(--radius); box-shadow: var(--shadow); position: relative;
    padding: 3rem 3rem 3rem 5rem; overflow: hidden; }
.folder::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: repeating-linear-gradient(180deg, transparent, transparent 31px, var(--line) 32px); }
.folder::after { content: ''; position: absolute; top: 0; bottom: 0; left: 2.2rem; width: 14px;
    background-image: radial-gradient(circle at 7px 7px, var(--kraft) 6px, transparent 7px);
    background-size: 14px 64px; background-repeat: repeat-y; opacity: .9; }
.folder > * { position: relative; z-index: 1; }

.docref { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
    border-bottom: 1px dashed var(--line); padding-bottom: .9rem; margin-bottom: 2.2rem; flex-wrap: wrap; }
.stamp { color: var(--red); border: 2px solid var(--red); border-radius: 4px; padding: .15rem .5rem;
    font-weight: 600; transform: rotate(-4deg); opacity: .8; font-size: .64rem; }

/* hero */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2.5rem; align-items: start; }
.kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1rem; }
h1.display { font-size: clamp(2.4rem, 5.2vw, 4rem); line-height: 1.02; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 1.3rem; }
h1.display .ink-red { color: var(--red); font-style: italic; }
.lead { font-size: 1rem; color: var(--ink-soft); max-width: 34rem; margin-bottom: 1.8rem; }
.note { font-family: 'Caveat', cursive; color: var(--red); font-size: 1.4rem; line-height: 1.1; transform: rotate(-3deg); display: inline-block; margin: .5rem 0 1.5rem; }
.underline-red { background: linear-gradient(var(--red), var(--red)) bottom/100% 2px no-repeat; padding-bottom: 1px; }

.btns { display: flex; flex-wrap: wrap; gap: .7rem; }
.btn { font-family: 'IBM Plex Mono', monospace; font-size: .74rem; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; padding: .7rem 1.1rem; border: 1.5px solid var(--ink); border-radius: 3px;
    background: transparent; color: var(--ink); cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: .5rem; }
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: var(--red); border-color: var(--red); }
.btn.sm { padding: .4rem .7rem; font-size: .66rem; }

.aside-stack { display: flex; flex-direction: column; gap: 1.2rem; align-items: center; padding-top: .5rem; }
.polaroid { background: #fff; padding: .7rem .7rem 1.4rem; box-shadow: 0 10px 24px rgba(60,45,25,.3); transform: rotate(3deg); position: relative; width: 200px; }
.polaroid::before { content: ''; position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-2deg);
    width: 90px; height: 26px; background: rgba(210,183,135,.6); box-shadow: 0 2px 4px rgba(0,0,0,.1); }
.polaroid .mono-art { aspect-ratio: 1; background: linear-gradient(135deg, var(--tab-dark), #5a4f3c);
    display: grid; place-items: center; color: var(--paper); font-family: 'Fraunces', serif; font-size: 3.4rem; font-weight: 600; }
.polaroid .cap { font-family: 'Caveat', cursive; color: var(--ink); font-size: 1.15rem; text-align: center; margin-top: .5rem; }
.sticky { background: #f3df7e; padding: 1rem 1.1rem; width: 230px; transform: rotate(-2deg); box-shadow: 0 8px 18px rgba(60,45,25,.22); font-size: .8rem; color: #5a4a18; }
.sticky b { display: block; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .3rem; opacity: .7; }

/* tactile index card (quick facts) */
.index-card { background: #fbf7ec; border: 1px solid var(--edge); border-radius: 3px;
    padding: .8rem 1rem .9rem 1.7rem; width: 230px; position: relative; transform: rotate(1.3deg);
    box-shadow: 0 6px 16px rgba(60,45,25,.18);
    background-image: repeating-linear-gradient(180deg, transparent, transparent 23px, #dde6ef 24px); }
.index-card::before { content: ''; position: absolute; left: 1rem; top: 0; bottom: 0; width: 1px; background: var(--red); opacity: .45; }
.index-card .ic-title { font-family: 'Caveat', cursive; font-size: 1.35rem; color: var(--ink); line-height: 24px; margin-bottom: 0; }
.index-card .ic-row { display: flex; justify-content: space-between; gap: .5rem; font-size: .72rem; line-height: 24px; }
.index-card .ic-row span:first-child { color: var(--faint); }
.index-card .ic-row span:last-child { color: var(--ink); font-weight: 500; text-align: right; }

/* terminal command line on project cards */
.cmd { font-size: .72rem; color: var(--ink-soft); background: rgba(44,38,32,.06);
    border: 1px dashed var(--edge); border-radius: 3px; padding: .25rem .5rem; margin-top: .55rem; display: inline-block; }
.cmd .p { color: var(--red); }

.divider-label { display: flex; align-items: center; gap: 1rem; margin: 3.5rem 0 1.8rem;
    font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.divider-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.divider-label .tag-color { width: 12px; height: 12px; border-radius: 2px; }
h2.sec { font-family: 'Fraunces', serif; font-size: 2rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 1.4rem; }

.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; }
.about-grid p { color: var(--ink-soft); margin-bottom: 1rem; max-width: 40rem; }
.facts { font-size: .82rem; }
.facts .row { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.facts .row span:first-child { color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { font-size: .74rem; padding: .4rem .8rem; border: 1px solid var(--edge); border-radius: 3px; background: rgba(255,255,255,.4); }

/* project case files */
.files { display: grid; gap: 1rem; }
.file { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center;
    background: rgba(255,255,255,.45); border: 1px solid var(--edge); border-left: 5px solid var(--tab-green);
    border-radius: 3px; padding: 1.2rem 1.4rem; transition: all .18s; }
.file:nth-child(2) { border-left-color: var(--tab-blue); }
.file:nth-child(3) { border-left-color: var(--tab-red); }
.file:nth-child(4) { border-left-color: var(--tab-tan); }
.file:hover { transform: translateX(4px); box-shadow: 0 8px 20px rgba(60,45,25,.16); background: #fff; }
.file .icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--paper-2); border: 1px solid var(--edge); border-radius: 6px; }
.file .icon img { width: 26px; height: 26px; }
.file .title-row { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.file h3 { font-family: 'Fraunces', serif; font-size: 1.25rem; font-weight: 600; }
.file .status { font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; padding: .12rem .45rem; border-radius: 3px; font-weight: 600; }
.file .status.stable { background: #e3ecd4; color: #5d6b3a; }
.file .status.active { background: #d9e6f0; color: #3f607a; }
.file p { font-size: .84rem; color: var(--ink-soft); margin-top: .2rem; }
.file .meta { text-align: right; font-size: .7rem; min-width: 9rem; }
.file .meta .ftags { color: var(--faint); letter-spacing: .04em; text-transform: uppercase; margin-bottom: .5rem; }
.file .meta .lnks { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }

/* research list */
.research .item { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px dashed var(--line); }
.research .item time { color: var(--faint); font-size: .76rem; }
.research .item h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.1rem; }
.research .item h3 a:hover { color: var(--red); }
.research .item p { color: var(--ink-soft); font-size: .84rem; }

.contact-file { margin-top: 1rem; background: rgba(255,255,255,.5); border: 1px dashed var(--ink-soft); border-radius: 4px; padding: 2.2rem; text-align: center; }
.contact-file h2 { font-family: 'Fraunces', serif; font-size: 1.8rem; margin-bottom: .4rem; }
.contact-file p { color: var(--ink-soft); margin-bottom: 1.4rem; }

/* footer */
.folder-foot { max-width: 1100px; margin: 1.2rem auto 0; background: var(--tab-dark); color: #d8cdb6;
    border-radius: var(--radius); padding: 2rem 3rem 2rem 5rem; font-size: .76rem;
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.folder-foot .filelabel { font-weight: 600; letter-spacing: .1em; color: #b6a888; }
.folder-foot nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.folder-foot a:hover { color: #fff; }

/* ---- long-form document / paper prose ---- */
.doc-head { border-bottom: 1px dashed var(--line); padding-bottom: 1.5rem; margin-bottom: 2rem; }
.doc-head .kicker { margin-bottom: .8rem; }
.doc-head h1 { font-family: 'Fraunces', serif; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 600; line-height: 1.1; margin-bottom: .8rem; }
.doc-head .byline { font-size: .78rem; color: var(--ink-soft); letter-spacing: .04em; }
.paper-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; align-items: start; }
.toc { position: sticky; top: 1.5rem; font-size: .8rem; border: 1px solid var(--edge); border-radius: 4px; padding: 1.1rem 1.2rem; background: rgba(255,255,255,.4); }
.toc b { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-bottom: .7rem; }
.toc a { display: block; color: var(--ink-soft); padding: .25rem 0; }
.toc a:hover { color: var(--red); }
.prose { max-width: 42rem; }
.prose > p, .prose > ul, .prose > ol, .prose > blockquote { font-size: .95rem; color: #3a342b; margin-bottom: 1.15rem; }
.prose h2 { font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 600; margin: 2.4rem 0 .9rem; padding-top: .3rem; }
.prose h2 a { color: var(--ink); }
.prose h2 a:hover { color: var(--red); }
.prose h3 { font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 600; color: var(--ink-soft); margin: 1.6rem 0 .7rem; }
.prose h3 a { color: inherit; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .5rem; }
.prose strong { color: var(--ink); }
.prose em { font-style: italic; }
.prose a { color: var(--red); background: linear-gradient(var(--red), var(--red)) bottom/100% 1px no-repeat; }
.prose blockquote { border-left: 3px solid var(--red); background: rgba(255,255,255,.45); padding: 1rem 1.2rem; border-radius: 0 4px 4px 0; }
.prose blockquote p { margin: 0; }
.prose code { font-size: .85em; background: rgba(44,38,32,.07); border: 1px solid var(--edge); border-radius: 3px; padding: .08rem .35rem; }
.prose figure { margin: 1.8rem 0; text-align: center; }
.prose figure img { width: 100%; height: auto; border: 1px solid var(--edge); border-radius: 6px; background: #0d1117; }
.prose figcaption { font-size: .76rem; color: var(--faint); margin-top: .6rem; }
.prose figcaption b { color: var(--red); }
.prose .refs { font-size: .85rem; }
.disclaim { font-size: .76rem; color: var(--faint); border-top: 1px dashed var(--line); margin-top: 2rem; padding-top: 1rem; }
.backlink { display: inline-block; margin-top: 2rem; }

@media (max-width: 760px) {
    body { padding: .75rem; }
    .folder { padding: 2rem 1.3rem 2rem 3rem; }
    .folder::after { left: 1rem; }
    .hero, .about-grid, .paper-layout { grid-template-columns: 1fr; }
    .toc { position: static; }
    .aside-stack { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
    .tabs { overflow-x: auto; }
    .file { grid-template-columns: auto 1fr; }
    .file .meta { grid-column: 2; text-align: left; }
    .file .meta .lnks { justify-content: flex-start; }
    .research .item { grid-template-columns: 1fr; gap: .2rem; }
}
