@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Source+Serif+4:ital,wght@0,400;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* fonts */
    --theme--font-text:    'Source Serif 4', Georgia, serif;
    --theme--font-heading: 'Instrument Serif', Georgia, serif;
    --theme--font-mono:    'JetBrains Mono', monospace;

    /* palette */
    --color-cream:      #fdf1dd;
    --color-cream-dark: #ede6d9;
    --color-ink:        #1c1814;
    --color-ink-muted:  #5a5650;
    --color-ink-faint:  #9a9490;
    --color-red:        #b83232;
    --color-orange:     #c0622a;
    --color-border:     #d8d0c4;

    /* theme tokens */
    --theme--color-text:    var(--color-ink);
    --theme--color-heading: var(--color-ink);
    --theme--color-link:    var(--color-ink);
    --theme--color-em:      var(--color-red);

    /* layout */
    --h-bottom-margin: 0.5em;
}

/* ── base & layout ── */
html { background: var(--color-cream); }

body {
    background: var(--color-cream);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 50em;
    padding: 0 .5rem;
    font-family: var(--theme--font-text);
    color: var(--theme--color-text);
    font-weight: 400;
    font-size: max(100%, 18px);
}

@media (min-width: 768px) {
    body { margin: .5rem auto; }
    main { padding: 0 1rem; }
}

@media (max-width: 767px) {
    body { margin-bottom: 6rem; }
}

main {
    flex: 1;
    animation: fadeUp .35s ease both;
}

@media (prefers-reduced-motion: no-preference) {
    main { animation: fadeUp .35s ease both; }
}

/* ── typography ── */
h1, h2, h3, h4 {
    font-family: var(--theme--font-heading);
    font-weight: 400;
    color: var(--theme--color-heading);
    line-height: 120%;
    margin: 0 0 var(--h-bottom-margin);
    max-width: 75%;
}

h1 { font-size: 1.4em; }
h2 { font-size: 1.2em; }
h3 { font-size: 1.1em; }
h4 { font-size: 1em; }

h1 + h2 { margin: calc(-1 * var(--h-bottom-margin)) 0 var(--h-bottom-margin); }
h2 + h3 { margin: calc(-1 * var(--h-bottom-margin)) 0 var(--h-bottom-margin); }
h3 + h4 { margin: calc(-1 * var(--h-bottom-margin)) 0 var(--h-bottom-margin); }

p {
    margin: 0 0 1em;
    line-height: 160%;
    color: var(--color-ink-muted);
}

body main > p:first-child { margin-top: 1em; }

em {
    color: var(--theme--color-em);
    font-style: normal;
}

/* ── links ── */
main a {
    position: relative;
    z-index: 1;
    transition: color .3s ease-in-out;
    color: var(--theme--color-link);
    overflow-wrap: break-word;
}

main a:hover {
    text-decoration-color: var(--color-red);
    transition: text-decoration-color .3s cubic-bezier(1,0,1,1);
}

/* ── lists (plain CSS markers, no Font Awesome) ── */
ul, ol, dl {
    list-style-position: outside;
}

li::marker, dt::before {
    content: "–  ";
    color: var(--color-ink-faint);
}

li > ul > li::marker { content: "·  "; }

.no-marker::marker { content: ""; }

dl {
    padding-inline-start: 40px;
    display: grid;
    grid-template-columns: auto auto;
    gap: 1em 1em;
    align-items: center;
}

dl dt { font-weight: 700; }
dl dd { margin: 0; }

dt::before {
    content: "–  ";
    margin-left: -1rem;
}

/* ── nav ── */
nav {
    border-bottom: 1px solid var(--color-border);
    padding: 1rem .5rem;
    max-width: 50em;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 768px) { nav { padding: 1rem 1rem; } }

.nav-links {
    display: flex;
    gap: 1.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li::marker { content: ""; }

.nav-links a {
    font-family: var(--theme--font-mono);
    font-size: .74rem;
    color: var(--color-ink-muted);
    text-decoration: none;
    letter-spacing: .06em;
    text-transform: lowercase;
    transition: color .15s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--color-ink); }

/* ── footer ── */
footer {
    border-top: 1px solid var(--color-border);
    max-width: 50em;
    margin: 0 auto;
    width: 100%;
    padding: 1.25rem .5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 768px) { footer { padding: 1.25rem 1rem; } }
@media (max-width: 480px) { footer { flex-direction: column; gap: .75rem; } }

.footer-note,
.footer-links a {
    font-family: var(--theme--font-mono);
    font-size: .7rem;
    color: var(--color-ink-faint);
    text-decoration: none;
    letter-spacing: .02em;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li::marker { content: ""; }
.footer-links a:hover { color: var(--color-ink); }

/* ── homepage hero ── */
.hero {
    padding: 3rem 0 2.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-family: var(--theme--font-heading);
    font-size: clamp(2.4rem, 7vw, 3.8rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -.01em;
    max-width: 100%;
    margin-bottom: .75rem;
    color: var(--color-ink);
}

.hero h1 em { color: var(--color-red); font-style: italic; }

.hero-tagline {
    color: var(--color-ink-muted);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.hero-status {
    font-family: var(--theme--font-mono);
    font-size: .72rem;
    color: var(--color-ink-faint);
    letter-spacing: .02em;
    margin: 0;
}

.hero-status::before {
    content: '● ';
    color: #6daa6d;
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── section label ── */
.section-label {
    font-family: var(--theme--font-mono);
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--color-ink-faint);
    margin-bottom: 1.25rem;
    display: block;
}

/* ── post list ── */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li::marker { content: ""; }

.post-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0 1.25rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    color: inherit;
    align-items: start;
}

.post-list li:first-child .post-item { border-top: 1px solid var(--color-border); }

.post-date {
    font-family: var(--theme--font-mono);
    font-size: .68rem;
    color: var(--color-ink-faint);
    padding-top: .3rem;
}

.post-title {
    display: block;
    font-family: var(--theme--font-heading);
    font-size: 1.05rem;
    color: var(--color-red);
    margin-bottom: .15rem;
    transition: color .15s;
}

a.post-item:hover .post-title { color: var(--color-red); }

.post-desc {
    display: block;
    font-size: .86rem;
    color: var(--color-ink-muted);
    line-height: 1.5;
}

/* ── about teaser ── */
.about-teaser {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--color-border);
}

.about-teaser p { color: var(--color-ink-muted); font-size: .95rem; }

.arrow-link {
    font-family: var(--theme--font-mono);
    font-size: .78rem;
    color: var(--color-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--color-ink);
    padding-bottom: 1px;
    transition: color .15s, border-color .15s;
}

.arrow-link:hover { color: var(--color-red); border-color: var(--color-red); }

/* ── page header ── */
.page-header {
    padding: 2.5rem 0 1.75rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    max-width: 100%;
    margin-bottom: .4rem;
}

.page-subtitle {
    font-family: var(--theme--font-mono);
    font-size: .72rem;
    color: var(--color-ink-faint);
    margin: 0;
}

/* ── single post ── */
.post-header {
    padding: 2.5rem 0 1.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2rem;
}

.post-header h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    max-width: 100%;
    margin-bottom: .5rem;
}

.post-meta {
    font-family: var(--theme--font-mono);
    font-size: .72rem;
    color: var(--color-ink-faint);
    margin: 0;
}

.back-link {
    display: inline-block;
    margin-top: 2.5rem;
    font-family: var(--theme--font-mono);
    font-size: .75rem;
    color: var(--color-ink-faint);
    text-decoration: none;
    transition: color .15s;
}

.back-link:hover { color: var(--color-ink); }

/* ── about page ── */
.about-simple p {
    color: var(--color-ink-muted);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.about-hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--color-border);
    width: 100%;
}

.about-meta {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.about-meta h4 {
    font-family: var(--theme--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-ink-faint);
    margin-bottom: 0.75rem;
    max-width: 100%;
}

.about-meta ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.about-meta li {
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
    color: var(--color-ink-muted);
    line-height: 2;
}

.about-meta li::marker { content: ""; }

.about-meta a {
    color: var(--color-ink-muted);
    text-decoration: none;
}

.about-meta a:hover { color: var(--color-ink); }

@media (max-width: 480px) {
    .about-meta {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* ── products placeholder ── */
.empty-state {
    padding: 5rem 0;
    text-align: center;
    color: var(--color-ink-faint);
    font-family: var(--theme--font-mono);
    font-size: .78rem;
    letter-spacing: .04em;
}

/* ── 404 page ── */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

.error-page h1 {
    font-size: 6rem;
    margin-bottom: 0.5rem;
    color: var(--color-red);
    max-width: 100%;
}

.error-page p {
    font-family: var(--theme--font-mono);
    color: var(--color-ink-muted);
}

/* ── misc ── */
hr {
    width: 50%;
    margin: 1rem auto;
    color: var(--color-orange);
    border: none;
    border-top: solid;
    border-bottom: solid;
    border-width: 2px;
    border-radius: 20px;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
