/* Deep-plum portfolio theme for Ghost posts and pages. */
:root {
  color-scheme: dark;
  --paper: #080408;
  --surface: #1b101b;
  --ink: #f9f4f9;
  --muted: #c7bdc7;
  --faint: #ab9fab;
  --line: #483447;
  --line-soft: #291a29;
  --red: #ec2fa5;
  --red-dark: #f477c4;
  --warm: #211321;
  --radius: 11px;
  --page-gutter: clamp(20px, 4.4vw, 72px);
  --section-space: clamp(64px, 7.5vw, 108px);
  --sans: var(--gh-font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif);
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--red); color: #080408; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, h3 { font-family: var(--gh-font-heading, var(--sans)); }
img, svg, video { max-width: 100%; }
img { height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #ff9ad8; outline-offset: 4px; }
.wrap { width: min(calc(100% - 2 * var(--page-gutter)), 1300px); margin-inline: auto; }
.skip { position: fixed; z-index: 30; top: 10px; left: 10px; padding: 12px 20px; border: 1px solid var(--line); border-radius: 9px; background: #291329; color: var(--ink); transform: translateY(-150%); }
.skip:focus { transform: translateY(0); }
.eyebrow, .tag, .article-number, .metadata, .breadcrumbs, .card-footer, .toc, .back-link, .footer { font-size: 13px; line-height: 1.5; }
.eyebrow { margin: 0; color: var(--red-dark); font-weight: 650; letter-spacing: .04em; }

/* Open navigation and a portrait-first opening, not a dashboard. */
.header { display: flex; align-items: center; gap: clamp(14px, 3vw, 40px); min-height: 96px; border-bottom: 1px solid var(--line); }
.brand { flex-shrink: 0; font-size: 23px; font-weight: 760; letter-spacing: -.075em; line-height: 1; }
.brand-dot { color: var(--red); }
.brand-logo { display: inline-flex; align-items: center; justify-content: center; width: 96px; padding: 7px; line-height: 0; }
.brand-logo img { display: block; width: 100%; height: auto; }
.footer .brand-logo { width: 80px; }
.nav { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-left: auto; }
.nav a { padding: 9px 14px; border-radius: 8px; font-size: 14px; color: var(--muted); transition: background .2s ease, color .2s ease; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--line-soft); color: var(--ink); }
.contact-link { flex-shrink: 0; padding: 10px 17px; border: 1px solid #a55a8c; border-radius: 9px; background: #2c1227; color: var(--ink); font-size: 14px; font-weight: 600; transition: background .2s ease, border-color .2s ease; }
.contact-link:hover { border-color: var(--red); background: #4a1737; }

/* A quieter, portrait-led opening: the source portrait is never replaced by decoration. */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(30px, 6vw, 92px); align-items: center; min-height: 610px; overflow: hidden; padding: clamp(34px, 5vw, 70px) clamp(28px, 6vw, 86px); border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(ellipse at 76% 35%, rgba(166, 43, 112, .12), transparent 53%), linear-gradient(140deg, #1b101b, #110b12 72%); }
.hero::before { content: ""; position: absolute; top: 0; right: 8%; width: 38%; height: 1px; background: linear-gradient(90deg, transparent, rgba(244, 119, 196, .48), transparent); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; padding-block: 22px; }
.hero-label { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 clamp(32px, 5vw, 64px); color: var(--red-dark); font-size: 13px; font-weight: 650; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(236, 47, 165, .14); }
.hero h1 { max-width: 14ch; margin: 0; font-size: clamp(42px, 4.65vw, 72px); font-weight: 720; line-height: 1.08; letter-spacing: -.065em; text-wrap: balance; }
.hero h1 span { color: var(--red); }
.intro { max-width: 29ch; margin: 30px 0 0; font-size: clamp(20px, 1.8vw, 25px); font-weight: 550; line-height: 1.36; letter-spacing: -.025em; }
.hero-detail { max-width: 43ch; margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 16px; padding: 11px 20px; border: 1px solid #e958b0; border-radius: 9px; background: linear-gradient(135deg, #c61a85, #a8096b); color: #fff; font-size: 14px; font-weight: 650; line-height: 1.3; text-align: center; box-shadow: 0 7px 24px rgba(171, 17, 112, .22); transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.button:hover { border-color: #ff8dd1; background: linear-gradient(135deg, #d52c96, #b81278); box-shadow: 0 10px 30px rgba(210, 34, 143, .3); transform: translateY(-2px); }
.button.secondary { border-color: #80617d; background: rgba(61, 37, 58, .44); color: var(--ink); box-shadow: none; }
.button.secondary:hover { border-color: #c981af; background: #3b2338; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.hero-photo { position: relative; align-self: stretch; min-height: 500px; margin: 0; overflow: hidden; border: 1px solid #6a4c67; border-radius: var(--radius); background: #261c27; }
.hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.hero:hover .hero-photo img { transform: scale(1.025); }
.hero-photo figcaption { position: absolute; z-index: 2; right: 16px; bottom: 16px; left: 16px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 16px; padding: 10px 16px; border: 1px solid rgba(246, 194, 228, .3); border-radius: 8px; background: rgba(22, 10, 21, .88); backdrop-filter: blur(16px); color: var(--ink); font-size: 12px; font-weight: 650; box-shadow: 0 8px 32px rgba(0,0,0,.22); }
/*
 * Border Beam: CSS adaptation of Magic UI's offset-path component.
 * https://github.com/magicuidesign/magicui/blob/main/apps/www/registry/magicui/border-beam.tsx
 * MIT License — Copyright (c) Magic UI
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
.border-beam { position: absolute; inset: 0; z-index: 3; border: 2px solid transparent; border-radius: inherit; pointer-events: none; mask: linear-gradient(transparent, transparent), linear-gradient(#000, #000); mask-clip: padding-box, border-box; mask-composite: intersect; }
.border-beam::before { content: ""; position: absolute; width: 160px; aspect-ratio: 1; background: linear-gradient(to left, #fff0fa, #ec2fa5 36%, transparent); offset-path: rect(0 auto auto 0 round 12px); animation: border-travel 9s linear infinite; }
@keyframes border-travel { to { offset-distance: 100%; } }
.button { position: relative; overflow: hidden; isolation: isolate; }
.button::before { content: ""; position: absolute; inset: -100% auto -100% -60%; width: 36%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent); transform: rotate(22deg); pointer-events: none; }
.button:hover::before, .button:focus-visible::before { animation: button-sheen .7s ease-out both; }
@keyframes button-sheen { to { left: 130%; } }
@media (prefers-reduced-motion: reduce) {
  .border-beam, .button::before { display: none; }
}

/* Motion choreography for the public homepage; content remains real DOM text. */
@media (prefers-reduced-motion: no-preference) {
  .hero::after { content: ""; position: absolute; z-index: 0; inset: -35%; pointer-events: none; background: radial-gradient(ellipse at 24% 48%, rgba(236,47,165,.24), transparent 38%), radial-gradient(ellipse at 72% 60%, rgba(110,63,182,.2), transparent 35%); animation: hero-light-drift 12s ease-in-out infinite alternate; }
  .hero-photo { z-index: 1; animation: hero-arrive 1.1s cubic-bezier(.16,1,.3,1) .12s both; }
  .hero-copy > * { position: relative; z-index: 1; animation: hero-arrive .95s cubic-bezier(.16,1,.3,1) both; }
  .hero-copy > :nth-child(2) { animation-delay: .1s; }
  .hero-copy > :nth-child(3) { animation-delay: .2s; }
  .hero-copy > :nth-child(4) { animation-delay: .3s; }
  .hero-copy > :nth-child(5) { animation-delay: .4s; }
  .hero h1 span { background: linear-gradient(110deg, #ec2fa5 12%, #ffbbdf 40%, #ec2fa5 63%, #a97cfa 84%, #ec2fa5); background-size: 250% 100%; background-clip: text; -webkit-background-clip: text; color: transparent; animation: name-light 7s ease-in-out infinite alternate; }
  .live-dot { animation: live-pulse 3s ease-in-out infinite; }
  .home-project-grid .reveal-pending:nth-child(2) { transition-delay: 70ms; }
  .home-project-grid .reveal-pending:nth-child(3) { transition-delay: 140ms; }
  .home-project-grid .reveal-pending:nth-child(4) { transition-delay: 70ms; }
  .home-project-grid .reveal-pending:nth-child(5) { transition-delay: 140ms; }
  .hero.motion-paused::after, .hero.motion-paused h1 span, .hero.motion-paused .live-dot, .hero.motion-paused .border-beam::before { animation-play-state: paused; }
}
@keyframes hero-arrive { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hero-light-drift { from { transform: translate(-4%, -3%) rotate(-8deg); } to { transform: translate(6%, 5%) rotate(10deg); } }
@keyframes name-light { to { background-position: 100% 50%; } }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 8px rgba(236,47,165,0), 0 0 20px rgba(236,47,165,.5); } }

/* Real Ghost records inside a CSS-only adaptation of Magic UI Bento Grid / Bento Card:
 * https://github.com/magicuidesign/magicui/blob/main/apps/www/registry/magicui/bento-grid.tsx
 * MIT License, Copyright (c) Magic UI. Full MIT notice is retained above.
 * The responsive cards keep their full-card links without React or a hover-only CTA.
 */
.section { padding-block: var(--section-space); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px 30px; margin-bottom: 28px; }
.section-head h2, .about-grid > h2, .contact-section h2 { margin: 7px 0 0; font-size: clamp(31px, 3.5vw, 49px); font-weight: 700; line-height: 1.13; letter-spacing: -.055em; }
.text-link, .back-link { display: inline-flex; align-items: center; gap: 8px; width: fit-content; color: var(--red-dark); font-size: 14px; font-weight: 650; transition: color .2s ease; }
.text-link:hover, .back-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.section > .text-link { margin-top: 28px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.project-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; isolation: isolate; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, rgba(43, 27, 43, .86), rgba(24, 14, 24, .94)); box-shadow: 0 8px 28px rgba(0, 0, 0, .16); transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.project-card:hover, .project-card:focus-visible { transform: translateY(-5px); border-color: #a65384; box-shadow: 0 20px 50px rgba(0, 0, 0, .34), 0 0 25px rgba(236, 47, 165, .07); }
.card-top, .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; }
.card-top { min-height: 52px; padding: 12px 20px; border-bottom: 1px solid rgba(228, 171, 211, .1); }
.tag { color: var(--muted); text-align: right; }
.project-visual { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 270px; aspect-ratio: 1.67; margin: 0 12px; overflow: hidden; border-radius: 8px; }
.project-visual.has-photo { display: block; background: var(--warm); }
.project-visual.has-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .65s cubic-bezier(.2,.7,.2,1); }
.project-card:hover .project-visual.has-photo img, .project-card:focus-visible .project-visual.has-photo img { transform: scale(1.04); }
.project-visual::after { content: "↗"; position: absolute; right: 14px; bottom: 14px; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #95698c; border-radius: 8px; background: #281629; color: var(--red-dark); font-size: 23px; line-height: 1; opacity: 0; transform: translate(-6px, 6px) scale(.8); transition: opacity .25s ease, transform .25s ease; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.project-card:hover .project-visual::after, .project-card:focus-visible .project-visual::after { opacity: 1; transform: none; }
.cover { min-height: 180px; aspect-ratio: auto; align-items: center; justify-content: center; background: radial-gradient(circle at 80% 10%, rgba(236,47,165,.16), transparent 48%), repeating-linear-gradient(120deg, transparent 0 46px, rgba(244,119,196,.045) 47px 48px), #211622; }
.cover-glyph { position: relative; display: block; width: 94px; height: 94px; border: 1px solid rgba(244,119,196,.54); border-radius: 26px; transform: rotate(-18deg); }
.cover-glyph::before, .cover-glyph::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(244,119,196,.45); border-radius: 18px; }
.cover-glyph::after { inset: 30px; border-radius: 10px; background: rgba(236,47,165,.13); }
.project-grid:not(.home-project-grid) .project-card:nth-child(even) .cover-glyph { border-radius: 50%; transform: rotate(18deg); }
.project-grid:not(.home-project-grid) .project-card:nth-child(even) .cover-glyph::before, .project-grid:not(.home-project-grid) .project-card:nth-child(even) .cover-glyph::after { border-radius: 50%; }
.card-body { flex: 1; padding: 24px 22px 22px; }
.card-body h3 { margin: 0 0 10px; font-size: clamp(21px, 2vw, 27px); font-weight: 675; line-height: 1.23; letter-spacing: -.035em; overflow-wrap: anywhere; }
.card-body p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.card-footer { min-height: 50px; padding: 12px 22px; border-top: 1px solid var(--line); color: var(--muted); }
.card-footer span:last-child { color: var(--red-dark); font-weight: 650; white-space: nowrap; }
.platform-feature { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(26px, 4vw, 58px); align-items: start; padding: clamp(22px, 3.5vw, 46px); border: 1px solid #704265; border-radius: var(--radius); background: radial-gradient(ellipse at 88% 4%, rgba(205, 58, 145, .13), transparent 55%), linear-gradient(140deg, #291627, #160e19 72%); }
.platform-feature-copy { min-width: 0; padding-block: clamp(8px, 2vw, 30px); }
.platform-feature h3 { max-width: 15ch; margin: 16px 0 20px; font-size: clamp(32px, 3.5vw, 49px); font-weight: 700; line-height: 1.13; letter-spacing: -.055em; text-wrap: balance; }
.platform-feature-lead { max-width: 40ch; margin: 0; font-size: clamp(17px, 1.65vw, 21px); line-height: 1.48; }
.platform-feature-detail { max-width: 50ch; margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.platform-feature-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 32px; }
.platform-feature-actions .text-link { min-height: 48px; }
.platform-feature-disclaimer { max-width: 48ch; margin: 28px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.platform-feature-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.platform-shot { min-width: 0; margin: 0; overflow: hidden; border: 1px solid #564158; border-radius: 9px; background: #0d111d; }
.platform-shot-main { grid-column: 1 / -1; }
.platform-shot img { display: block; width: 100%; aspect-ratio: 1.55; object-fit: cover; object-position: center top; }
.platform-shot-main img { aspect-ratio: 1.7; }
.platform-shot figcaption { padding: 10px 14px; border-top: 1px solid #41394b; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.4; }
.service-showcase { padding-block: 48px; }
.service-screen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.service-screen { margin: 0; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #160e18; }
.service-screen > img { display: block; width: 100%; height: auto; aspect-ratio: 1.55; object-fit: contain; background: #0d111d; }
.service-screen figcaption { padding: 20px; }
.service-screen h3 { margin: 0 0 10px; font-size: 22px; }
.service-screen p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.service-screen figcaption a { color: var(--red-dark); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.service-screen > .shknv-image-open { margin: 12px 20px 0; }
@media (max-width: 700px) { .service-screen-grid { grid-template-columns: 1fr; } }
.home-project-grid { margin-top: 20px; }
/* A simpler reading list offsets the gallery, without a schematic grid. */
.article-list { border-top: 1px solid var(--line); }
.article-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 32px; gap: clamp(12px, 3vw, 34px); align-items: start; padding: 25px 8px; border-bottom: 1px solid var(--line); transition: background .2s ease, padding-left .2s ease; }
.article-row:hover { padding-left: 18px; background: rgba(64, 33, 59, .48); }
.article-number { padding-top: 3px; color: var(--faint); }
.article-info { min-width: 0; }
.article-info h3 { margin: 7px 0; font-size: clamp(21px, 2.3vw, 29px); font-weight: 675; line-height: 1.25; letter-spacing: -.037em; }
.article-info p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 0; color: var(--muted); font-size: 14px; }
.arrow { justify-self: end; color: var(--red-dark); font-size: 22px; line-height: 1; }

.about-grid { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: clamp(28px, 7vw, 110px); align-items: start; }
.about-copy { max-width: 65ch; }
.about-copy p, .about-copy blockquote { margin: 0 0 1em; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; }
.about-copy p:last-child { margin-bottom: 0; }
.contact-section { padding: clamp(64px, 7vw, 100px) clamp(22px, 5vw, 70px); margin: var(--section-space) 0; border: 1px solid #67415f; border-radius: var(--radius); background: radial-gradient(ellipse at 88% 15%, rgba(188, 35, 128, .2), transparent 55%), linear-gradient(140deg, #2b1828, #160d17); }
.contact-section h2 { max-width: 18ch; margin-bottom: 28px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.contact-links a { padding-bottom: 4px; border-bottom: 1px solid currentColor; color: var(--red-dark); font-size: clamp(17px, 1.7vw, 22px); font-weight: 600; overflow-wrap: anywhere; transition: color .2s ease; }
.contact-links a:hover { color: var(--ink); }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 26px; padding-block: 18px 32px; border-top: 1px solid var(--line); color: var(--muted); }
.footer p { margin: 0; }
.footer .brand { color: var(--ink); }
.footer a:hover { color: var(--red-dark); }

/* Catalog and article pages keep the same human scale. */
.page-head { padding: clamp(42px, 7vw, 90px) 0 clamp(34px, 5vw, 66px); border-bottom: 1px solid var(--line); }
.page-head h1, .detail-head h1, .not-found h1 { max-width: 19ch; margin: 13px 0 18px; font-size: clamp(41px, 6vw, 78px); font-weight: 710; line-height: 1.09; letter-spacing: -.06em; overflow-wrap: anywhere; }
.lead { max-width: 65ch; margin: 0; color: var(--muted); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.5; }
.project-grid, .article-list { min-width: 0; }
.empty-state { padding: 35px 0; color: var(--muted); }
.empty-state a { color: var(--red-dark); text-decoration: underline; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 24px; color: var(--muted); }
.breadcrumbs a:hover { color: var(--red-dark); text-decoration: underline; }
.detail-head { padding: clamp(42px, 6vw, 78px) 0 clamp(36px, 5vw, 62px); border-bottom: 1px solid var(--line); }
.detail-head h1 { max-width: 21ch; font-size: clamp(38px, 5vw, 67px); }
.metadata { display: flex; flex-wrap: wrap; gap: 8px 30px; margin-top: 28px; color: var(--muted); }
.metadata > * { margin: 0; }
.reading-layout { display: grid; grid-template-columns: minmax(135px, .32fr) minmax(0, 1fr); gap: clamp(30px, 6vw, 100px); padding-block: clamp(44px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.toc { min-width: 0; align-self: start; position: sticky; top: 24px; max-height: calc(100dvh - 48px); overflow-y: auto; color: var(--muted); }
.toc > :first-child { margin-top: 0; }
.toc a { display: block; padding: 10px 4px; color: var(--red-dark); overflow-wrap: anywhere; }
.toc a:hover { text-decoration: underline; }
.toc .eyebrow { font-size: 12px; }
.toc-list { margin: 14px 0 0; padding: 0; list-style: none; }
.toc-list li + li { border-top: 1px solid var(--line-soft); }
.toc-subheading { padding-left: 14px; }
.series-jump { margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.toc a:focus-visible, .series-links a:focus-visible, .metadata a:focus-visible { outline: 2px solid var(--red-dark); outline-offset: -2px; }
.metadata a { text-decoration: underline; text-underline-offset: 3px; }
.etl-series { scroll-margin-top: 24px; }
.etl-series .section-head { margin-bottom: 18px; }
.series-entry { display: flex; flex-direction: column; align-items: start; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.series-entry p { margin: 0; max-width: 65ch; color: var(--muted); }
.series-neighbours { margin-top: 32px; }
.series-neighbours h3 { margin: 0 0 12px; font-size: 21px; }
.series-links { list-style: none; margin: 0; padding: 0; }
.series-links li { border-bottom: 1px solid var(--line); }
.series-links a { display: block; padding: 15px 4px; color: var(--red-dark); }
.series-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.guide-nav { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 28px; border-bottom: 1px solid var(--line); }
.guide-nav a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--red-dark); font-size: 14px; }
.guide-nav a:hover { border-color: var(--red-dark); }
.guide-group { scroll-margin-top: 24px; }
.guide-intro { max-width: 70ch; margin: 0 0 28px; color: var(--muted); font-size: 17px; }
.prose { min-width: 0; max-width: 74ch; padding-block: 44px; font-size: 17px; line-height: 1.75; overflow-wrap: break-word; }
.reading-layout .prose { padding: 0; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { line-height: 1.23; letter-spacing: -.035em; scroll-margin-top: 28px; }
.prose h2 { margin: 1.9em 0 .6em; font-size: clamp(27px, 2.6vw, 35px); }
.prose h3 { margin: 1.5em 0 .55em; font-size: clamp(22px, 2vw, 27px); }
.prose h4 { margin: 1.4em 0 .5em; font-size: 20px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose figure, .prose table { margin: 0 0 1.45em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose a, .source-note a { color: var(--red-dark); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover, .source-note a:hover { color: var(--ink); }
.prose blockquote { margin-left: 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--red); font-size: 1.08em; }
.prose figure img, .prose > img { display: block; width: auto; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 9px; }
.prose figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.prose :not(pre) > code { padding: .12em .32em; border-radius: 3px; background: var(--line-soft); font: .86em/1.4 var(--mono); overflow-wrap: anywhere; }
.prose pre { max-width: 100%; padding: 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: #170e18; color: var(--ink); font: 13px/1.65 var(--mono); }
.prose pre code { font: inherit; }
.prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.prose th, .prose td { padding: 12px 16px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--line-soft); }
.back-link { margin-block: 36px var(--section-space); }
.not-found { min-height: 55vh; }
.not-found .actions { margin-top: 26px; }

/* Pointer glow is progressive enhancement: no cursor tracking is needed to read a card. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .project-card::before, .hero-photo::after { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s ease; background: radial-gradient(420px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(236, 47, 165, .15), transparent 72%); }
  .project-card:hover::before, .hero-photo:hover::after { opacity: 1; }
  .hero-photo::after { background: radial-gradient(300px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(236, 47, 165, .16), transparent 75%); }
}

/* Only hide content after the observer has been set up successfully. */
.reveal-pending { opacity: 1; translate: 0 0; transition: opacity .55s ease, translate .55s cubic-bezier(.2,.7,.2,1), transform .3s ease, border-color .3s ease, box-shadow .3s ease, grid-template-columns .55s ease, background .2s ease, padding-left .2s ease; }
.reveal-pending:not(.is-revealed) { opacity: 0; translate: 0 18px; }
.reading-progress { position: fixed; z-index: 40; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, #ec2fa5, #ff9bda); transform: scaleX(0); transform-origin: left center; transition: transform .12s linear; pointer-events: none; }
.back-to-top { position: fixed; z-index: 20; right: clamp(16px, 3vw, 36px); bottom: clamp(16px, 3vw, 36px); display: inline-grid; min-width: 46px; min-height: 46px; place-items: center; padding: 8px 13px; border: 1px solid #b36396; border-radius: 9px; background: rgba(37, 19, 36, .94); backdrop-filter: blur(14px); color: var(--ink); cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.28); transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.back-to-top:hover { border-color: var(--red); background: #4b2240; transform: translateY(-3px); }

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, .88fr); gap: 24px; padding: 32px; }
  .hero h1 { font-size: clamp(38px, 5vw, 55px); }
  .hero-photo { min-height: 440px; }
  .project-visual { min-height: 220px; }
  .platform-feature { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .header { min-height: 0; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-block: 18px; }
  .nav { order: 3; width: 100%; justify-content: center; margin-left: 0; }
  .nav a { flex: 1; text-align: center; }
  .contact-link { padding: 9px 15px; }
  .hero { grid-template-columns: 1fr; gap: 10px; min-height: 0; padding: 28px; align-items: stretch; }
  .hero-copy { display: contents; }
  .hero-label { grid-row: 1; margin-bottom: 14px; }
  .hero h1 { grid-row: 2; max-width: 14ch; font-size: clamp(38px, 7.7vw, 53px); }
  .hero-photo { grid-row: 3; min-height: 0; height: clamp(250px, 65vw, 390px); margin-block: 12px 8px; }
  .intro { grid-row: 4; max-width: 34ch; margin-top: 10px; }
  .hero-detail { grid-row: 5; margin-top: 0; }
  .actions { grid-row: 6; margin-top: 14px; }
  .project-grid, .home-project-grid { grid-template-columns: 1fr; gap: 16px; }
  .platform-feature { gap: 22px; }
  .platform-feature-copy { padding-block: 0; }
  .project-visual { min-height: 190px; }
  .card-body { padding: 18px; }
  .card-top, .card-footer { padding-inline: 18px; }
  .reading-layout { grid-template-columns: 1fr; gap: 20px; }
  .toc { position: static; max-height: none; overflow: visible; }
  .about-grid { grid-template-columns: 1fr; gap: 18px; }
  .about-grid figure { max-width: 480px; }
}
@media (max-width: 560px) {
  .project-visual { min-height: 220px; aspect-ratio: 1.55; }
  .project-visual.cover { min-height: 160px; aspect-ratio: auto; }
  .platform-feature-gallery { grid-template-columns: 1fr; }
  .platform-shot-main { grid-column: auto; }
  .platform-shot img, .platform-shot-main img { aspect-ratio: auto; height: auto; }
  .section-head { align-items: start; flex-direction: column; margin-bottom: 22px; }
  .article-row { grid-template-columns: 30px minmax(0, 1fr) 20px; padding-inline: 0; }
  .article-row:hover { padding-left: 8px; }
  .article-info h3 { font-size: 21px; }
  .card-footer { flex-wrap: wrap; }
  .contact-section { margin-block: 65px; }
  .footer { padding-top: 20px; }
}
@media (max-width: 390px) {
  .hero { padding: 19px; }
  .hero h1 { font-size: 36px; }
  .hero-photo figcaption { bottom: 10px; left: 10px; right: 10px; }
  .nav a { padding-inline: 8px; font-size: 13px; }
  .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal-pending:not(.is-revealed) { opacity: 1; translate: none; }
  .hero:hover .hero-photo img, .project-card:hover, .project-card:focus-visible,
  .project-card:hover .project-visual.has-photo img, .project-card:focus-visible .project-visual.has-photo img,
  .button:hover, .back-to-top:hover { transform: none; }
}
@media print {
  :root { color-scheme: light; --paper: #fff; --surface: #fff; --ink: #171217; --muted: #343034; --faint: #555; --line: #bbb; --line-soft: #f4f4f4; --red: #9a005d; --red-dark: #7d0048; }
  body { background: #fff; }
  .header, .footer, .actions, .menu-toggle, .toc, .reading-progress, .back-to-top { display: none; }
  .wrap { width: 100%; }
  .hero, .project-card, .platform-feature, .platform-shot, .contact-section { break-inside: avoid; background: #fff; box-shadow: none; }
  .cover { background: #eee !important; color: #171217; }
  .reveal-pending:not(.is-revealed) { opacity: 1; translate: none; }
}

/* Navigation remains open without JavaScript; enhanced mobile menu collapses on demand. */
.menu-toggle, .nav-contact { display: none; }
.nav a[aria-current="page"] { background: var(--line-soft); color: var(--ink); }
.menu-toggle { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); cursor: pointer; }
.menu-toggle:hover, .menu-toggle[aria-expanded="true"] { border-color: var(--red-dark); background: #3b2338; }
.menu-toggle span { padding-left: 6px; }
.hero-photo figcaption { right: auto; }
.project-grid > .empty-state { grid-column: 1 / -1; }
.project-card .card-top .arrow { font-size: 17px; }
.project-visual.has-photo img { aspect-ratio: 1.67; object-fit: contain; background: var(--surface); }
.card-footer > :first-child:empty { display: none; }
.card-footer a { color: inherit; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; text-align: center; }
.pagination > * { flex: 1; }
.pagination a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); transition: border-color .2s ease, background .2s ease; }
.pagination a:hover { border-color: var(--red-dark); background: var(--line-soft); }
.post-hero { margin: 38px 0 0; }
.post-hero img { display: block; width: 100%; max-height: 680px; border: 1px solid var(--line); border-radius: var(--radius); object-fit: contain; background: var(--surface); }
.post-hero figcaption { margin-top: 12px; color: var(--muted); font-size: 13px; }
.page-content { max-width: 74ch; padding-block: clamp(44px, 6vw, 80px); }
.reading-layout .prose { max-width: none; }
.reading-layout .prose > :not(.kg-width-wide):not(.kg-width-full) { max-width: 74ch; }
.prose figure, .prose img, .prose video, .prose iframe { max-width: 100%; }
.prose .kg-card { width: 100%; margin: 0 0 1.8em; }
.prose .kg-image-card img, .prose .kg-gallery-card img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 9px; }
.prose .kg-image-card img { width: 100%; }
.prose .kg-image-card figcaption, .prose .kg-gallery-card figcaption, .prose .kg-video-card figcaption, .prose .kg-embed-card figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
.prose .kg-gallery-container { display: flex; flex-direction: column; gap: 8px; }
.prose .kg-gallery-row { display: flex; gap: 8px; }
.prose .kg-gallery-image { flex: 1 1 0; min-width: 0; }
.prose .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }
.prose .kg-bookmark-card a.kg-bookmark-container { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); text-decoration: none; }
.prose .kg-bookmark-content { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 20px; }
.prose .kg-bookmark-title { font-weight: 700; line-height: 1.35; }
.prose .kg-bookmark-description { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.prose .kg-bookmark-metadata { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: auto; padding-top: 16px; color: var(--red-dark); font-size: 13px; overflow-wrap: anywhere; }
.prose .kg-bookmark-icon { width: 18px; height: 18px; }
.prose .kg-bookmark-thumbnail { flex: 0 0 32%; min-width: 0; }
.prose .kg-bookmark-thumbnail img { width: 100%; height: 100%; border: 0; border-radius: 0; object-fit: cover; }
.prose .kg-embed-card iframe { display: block; width: 100%; }
.prose .kg-video-card video, .prose .kg-audio-card audio { display: block; width: 100%; }
.prose .kg-callout-card, .prose .kg-toggle-card, .prose .kg-file-card { padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.prose .kg-callout-card { display: flex; align-items: start; gap: 12px; }
.prose .kg-callout-emoji { flex: none; }
.prose .kg-button-card a.kg-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 11px 20px; border-radius: 9px; background: #a8096b; color: #fff; font-size: 14px; font-weight: 650; text-decoration: none; }
.prose .kg-button-card a.kg-btn:hover { background: #c61a85; }
.prose .kg-card :focus-visible, .pagination a:focus-visible, .menu-toggle:focus-visible { outline: 3px solid #ff9ad8; outline-offset: 4px; }
@media (max-width: 960px) {
  .header { gap: 10px; }
  .nav a { padding-inline: 9px; }
  .contact-link { padding-inline: 12px; }
}
@media (max-width: 700px) {
  .header { align-items: center; }
  .has-menu .menu-toggle { display: inline-flex; align-items: center; margin-left: auto; }
  .contact-link { display: none; }
  .nav { order: 3; width: 100%; margin: 0; }
  .nav a { flex: 0 0 auto; }
  .nav .nav-contact { display: inline-flex; }
  .has-menu .nav { display: none; }
  .has-menu .header.menu-open .nav { display: flex; }
  .post-hero { margin-top: 24px; }
}
@media (max-width: 390px) {
  .nav { justify-content: flex-start; }
  .nav a { flex: 1 1 42%; padding: 11px 8px; }
  .pagination { flex-wrap: wrap; }
  .pagination span { flex-basis: 100%; order: -1; }
  .pagination > span:empty { display: none; }
}
@media (max-width: 560px) {
  .prose .kg-bookmark-card a.kg-bookmark-container { flex-direction: column-reverse; }
  .prose .kg-bookmark-thumbnail { flex-basis: auto; max-height: 210px; }
  .prose .kg-bookmark-thumbnail img { max-height: 210px; }
}
@media print {
  .menu-toggle, .pagination { display: none !important; }
}
