/* Ashcroft — minimalist dark-fantasy theme */
:root {
    --bg: #0d0c10;
    --surface: #16141b;
    --surface-2: #1d1a24;
    --line: #2a2630;
    --text: #e8e2d6;
    --muted: #9a9388;
    --accent: #c8a15a;
    --accent-dim: #8f7240;
    --crimson: #9c3a4b;
    --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --radius: 3px;
    --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-image: radial-gradient(ellipse 80% 40% at 50% -10%, rgba(156, 58, 75, .14), transparent 70%);
    background-repeat: no-repeat;
}
main { flex: 1; }
img, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #e6c98a; }
::selection { background: var(--crimson); color: #fff; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Typography */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; letter-spacing: .01em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.4rem, 5vw + .5rem, 4rem); }
h2 { font-size: clamp(1.7rem, 2.4vw + .6rem, 2.4rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1.2em; }
.lead { font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--muted); max-width: 40ch; }
.center .lead, .center.page-header .lead { margin-inline: auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .3em; font-size: .75rem; color: var(--accent); margin-bottom: 1.2rem; }
.meta { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: .6rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.meta a { color: var(--accent); }
.dot { opacity: .5; }
.center { text-align: center; }
.empty { color: var(--muted); font-style: italic; text-align: center; padding: 3rem 0; }

/* Ornament divider */
.ornament { display: flex; align-items: center; gap: 1rem; color: var(--accent); margin: 1.4rem auto; max-width: 260px; }
.ornament::before, .ornament::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-dim)); }
.ornament::after { transform: scaleX(-1); }
.ornament span { font-size: .9rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(13, 12, 16, .82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--text); }
.brand:hover { color: var(--accent); }
.brand-mark { color: var(--accent); font-size: 1rem; }
.brand-name { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; letter-spacing: .08em; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2rem; }
.site-nav a { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .2em; padding: .4rem 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a.active { color: var(--text); border-bottom-color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 0; position: relative; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 1px; background: var(--text); transition: transform .25s, top .25s; }
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 26px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* Hero */
.hero { position: relative; text-align: center; padding: clamp(5rem, 14vw, 10rem) 0 clamp(4rem, 10vw, 7rem); border-bottom: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -2; background: var(--hero-image, none) center / cover no-repeat; opacity: .35; }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(13,12,16,.3), var(--bg) 96%); }
.hero h1 { font-size: clamp(3rem, 9vw, 6.5rem); letter-spacing: .06em; font-weight: 400; margin-bottom: 0; }
.hero-text { font-family: var(--serif); font-size: clamp(1.25rem, 2vw + .6rem, 1.75rem); color: #cfc8ba; max-width: 34em; margin: 0 auto 2rem; font-style: italic; }

/* Buttons */
.button { display: inline-block; padding: .8rem 1.8rem; border: 1px solid var(--accent); background: var(--accent); color: #14110a; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .18em; border-radius: var(--radius); transition: background .2s, color .2s; }
.button:hover { background: transparent; color: var(--accent); }
.button.ghost { background: transparent; color: var(--accent); }
.button.ghost:hover { background: var(--accent); color: #14110a; }
.more { font-size: .78rem; text-transform: uppercase; letter-spacing: .16em; }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* Pages */
.page { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.narrow { max-width: 740px; margin-inline: auto; }
.page-header { margin-bottom: 2.5rem; }
.page-header.center .intro { max-width: 60ch; margin-inline: auto; }
.home-welcome { padding-top: 4rem; }
.center-prose { text-align: center; margin-inline: auto; }
.crumb { font-size: .78rem; text-transform: uppercase; letter-spacing: .16em; margin-bottom: 2rem; }

/* Prose */
.prose { font-size: 1.08rem; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3 { margin-top: 2em; }
.prose a { border-bottom: 1px solid var(--accent-dim); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose img { margin: 2rem auto; border-radius: var(--radius); }
.prose blockquote { margin: 2rem 0; padding: .2rem 0 .2rem 1.5rem; border-left: 2px solid var(--crimson); font-family: var(--serif); font-size: 1.35rem; font-style: italic; color: #cfc8ba; }
.prose hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-dim), transparent); margin: 3rem 0; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li::marker { color: var(--accent); }
.prose code { background: var(--surface-2); padding: .1em .4em; border-radius: 3px; font-size: .9em; }
.prose pre { background: var(--surface); border: 1px solid var(--line); padding: 1rem; overflow: auto; border-radius: var(--radius); }
.prose iframe, .prose video { width: 100%; border: 0; border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { padding: .6rem; border-bottom: 1px solid var(--line); text-align: left; }
.post .prose > p:first-of-type::first-letter { font-family: var(--serif); font-size: 3.6em; float: left; line-height: .85; padding: .08em .12em 0 0; color: var(--accent); }

/* Grids and cards */
.grid { display: grid; gap: 1.75rem; }
.grid-posts { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-works { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s, border-color .3s, box-shadow .3s; }
.card:hover { transform: translateY(-4px); border-color: var(--accent-dim); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .8); }
.card-media { display: block; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; transition: transform .6s; }
.card:hover .card-media img { transform: scale(1.04); }
.work-card .card-media { aspect-ratio: 4 / 5; display: grid; place-items: center; }
.work-card .card-media img { height: 100%; object-fit: cover; }
.card-placeholder { font-size: 2rem; color: var(--accent-dim); }
.card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card-title { margin-bottom: .5rem; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--muted); font-size: .95rem; flex: 1; }
.pin { color: var(--crimson); }
.badge { border: 1px solid var(--accent-dim); color: var(--accent); padding: .05rem .6rem; border-radius: 999px; letter-spacing: .1em; }
.badge-in-development, .badge-upcoming { border-color: var(--crimson); color: #d77a8b; }

/* Home sections */
.home-section { padding: clamp(3rem, 6vw, 4.5rem) 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; padding-bottom: .6rem; }
.section-head h2 { margin: 0; }
.home-about { display: flex; gap: 2rem; align-items: center; padding-bottom: 1rem; }
.home-about h2 { margin-bottom: .4rem; }
.portrait img { border-radius: var(--radius); border: 1px solid var(--line); }
.portrait.small { flex: 0 0 150px; }
.portrait.small img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; }

/* Post */
.post-header { margin-bottom: 2.5rem; }
.post-header .meta { justify-content: center; }
.post-header .lead { margin-inline: auto; }
.post-cover { margin: 0 0 3rem; }
.post-cover img { width: 100%; border-radius: var(--radius); }
.tags { list-style: none; padding: 0; margin: 2.5rem 0 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.tags li { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: .15rem .8rem; color: var(--muted); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 3.5rem 0 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.post-nav a { display: block; color: var(--text); }
.post-nav a:hover { color: var(--accent); }
.post-nav .right { text-align: right; }
.post-nav-title { display: block; font-family: var(--serif); font-size: 1.25rem; line-height: 1.3; }

/* Work page */
.work-hero { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; margin-bottom: 3rem; }
.work-hero:not(:has(.work-cover)) { grid-template-columns: 1fr; text-align: center; }
.work-hero:not(:has(.work-cover)) .meta, .work-hero:not(:has(.work-cover)) .actions { justify-content: center; }
.work-hero:not(:has(.work-cover)) .lead { margin-inline: auto; }
.work-cover { margin: 0; }
.work-cover img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9); }
.facts { display: flex; flex-wrap: wrap; gap: 1.2rem 2.5rem; margin: 1.5rem 0 0; }
.facts div { min-width: 0; }
.facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); }
.facts dd { margin: 0; font-family: var(--serif); font-size: 1.2rem; }
.facts.stacked { flex-direction: column; gap: .9rem; margin: 1.5rem 0; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.narrow-prose { max-width: 740px; margin: 3rem auto 0; }

/* Embeds */
.embed-block { margin: 2rem 0 3rem; }
.play-frame { width: 100%; background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9); }
.play-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.embed-note { text-align: right; font-size: .8rem; margin: .6rem 0 0; }
.itch-widget { margin-top: 1.5rem; display: flex; justify-content: center; }
.itch-widget iframe { border: 0; max-width: 100%; }
.embed-custom { display: flex; justify-content: center; }
.embed-custom iframe { max-width: 100%; border: 0; }

/* About */
.about-layout.has-aside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-layout:not(.has-aside) .prose { max-width: 740px; margin-inline: auto; }
.about-aside { position: sticky; top: 100px; }
.about-aside .portrait img { width: 100%; }

/* Footer */
.site-footer { margin-top: 5rem; border-top: 1px solid var(--line); padding: 3rem 0 2.5rem; text-align: center; color: var(--muted); }
.footer-ornament { color: var(--accent); }
.footer-name { font-family: var(--serif); font-size: 1.6rem; letter-spacing: .1em; color: var(--text); margin: .3rem 0 0; }
.footer-text { font-style: italic; font-family: var(--serif); font-size: 1.1rem; margin: 0; }
.footer-copy { font-size: .75rem; margin: 1.5rem 0 0; opacity: .7; }

/* Responsive */
@media (max-width: 820px) {
    .nav-toggle { display: block; }
    .site-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); display: none; padding: 1rem 1.5rem 1.5rem; }
    .site-nav.open { display: block; }
    .site-nav ul { flex-direction: column; gap: 0; }
    .site-nav li a { display: block; padding: .9rem 0; border-bottom: 1px solid var(--line); }
    .work-hero { grid-template-columns: 1fr; }
    .work-cover { max-width: 320px; margin-inline: auto; }
    .about-layout.has-aside { grid-template-columns: 1fr; }
    .about-aside { position: static; order: -1; max-width: 320px; margin-inline: auto; }
    .home-about { flex-direction: column; text-align: center; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav .right { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* Social icons */
.socials { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.socials a { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 1.05rem; transition: color .2s, border-color .2s, background .2s, transform .2s; }
.socials a:hover { color: var(--accent); border-color: var(--accent); background: rgba(200, 161, 90, .08); transform: translateY(-2px); }
.socials-hero { justify-content: center; margin-top: 2.2rem; }
.site-footer .socials { justify-content: center; margin: 1.5rem 0; }
.about-aside .socials { margin: 0; }
.home-welcome { padding: 4rem 0 0; }
