/*
 * Purple Footsteps Tools — styles for the plugin's parts: game windows,
 * panels, buttons, the Qualifications browser and the Work Timeline.
 *
 * They read the Purple Footsteps theme's colour and font variables. The
 * defaults below apply with any other theme (zero specificity, so a theme's
 * own values always win).
 */
:where(:root) {
  --paper: #ffffff;
  --paper-2: #f4f5f8;
  --ink: #2c2c33;
  --ink-soft: #707680;
  --line: #e2e2ea;
  --blue: #7b3fb0;
  --blue-ink: #5f2e94;
  --blue-deep: #3a1b5e;
  --shadow: 0 2px 4px rgba(44,44,51,.05), 0 14px 30px -18px rgba(44,44,51,.28);
  --font-head: inherit;
  --font-body: inherit;
}

/* =======================================================================
   Project-page shortcodes: [pf_game] [pf_panel] [pf_button]
   ===================================================================== */
.pf-game { margin: 1.6rem 0; }
.pf-game-stage { position: relative; width: 100%; background: #000; border: 1px solid #000; overflow: hidden; display: grid; place-items: center; }
.pf-game-screen { line-height: 0; }
.pf-game-screen canvas, .pf-game-screen > div { display: block; }
/* CheerpJ's required "Community Edition" line, just under the game, small and readable on black. */
.pf-game--cheerpj #cheerpjDisplay::before { color: #8a909c !important; background: transparent !important; border: 0 !important; box-shadow: none !important; font: 600 9px/14px var(--font-head) !important; letter-spacing: .04em !important; text-align: center !important; left: 0 !important; right: 0 !important; width: auto !important; height: auto !important; padding-top: 6px !important; white-space: normal !important; }
/* Centre the Java window in the game area (the program decides where its window goes; this only moves it on screen). */
.pf-game--cheerpj #cheerpjDisplay > .cjWindow,
.pft-classic-slot #cheerpjDisplay > .window { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
/* CheerpJ's hidden typing boxes are white by default and show as thin lines on black. */
.pf-game-screen textarea, .pft-has-classic-game #holder textarea { background: transparent !important; border: 0 !important; outline: 0 !important; color: transparent !important; box-shadow: none !important; }
.pf-game-launch { position: absolute; inset: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; cursor: pointer; border: 0; color: #fff; background: linear-gradient(rgba(17,19,26,.35), rgba(17,19,26,.6)); font-family: var(--font-head); }
.pf-game-launch:hover { background: linear-gradient(rgba(17,19,26,.25), rgba(17,19,26,.5)); }
.pf-game-launch .pf-play-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--blue-ink); font-size: 1.4rem; box-shadow: var(--shadow); }
.pf-game-launch > span:not(.pf-play-icon) { font-weight: 700; font-size: 1rem; letter-spacing: .02em; }
.pf-game-launch small { color: #e8eef2; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }
.pf-game-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; color: #e8eef2; font-family: var(--font-head); text-align: center; }
.pf-game [hidden] { display: none !important; }
.pf-game-loading small { color: #9aa2b0; font-size: .68rem; }
.pf-spin { width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: pf-spin 0.8s linear infinite; }
@keyframes pf-spin { to { transform: rotate(360deg); } }
.pf-game.is-running .pf-game-stage { place-items: start; }
.pf-game-note { color: var(--ink-soft); font-size: .82rem; margin: .5rem 0 0; }
.pf-game-error { color: #ffd7d7; background: rgba(120,20,20,.85); padding: 1rem 1.2rem; font-family: var(--font-head); font-size: .86rem; text-align: center; max-width: 90%; }
.pf-game--soon .pf-game-stage, .pf-game--soon p { color: var(--ink-soft); }

.pf-game--iframe .pf-game-frame { position: relative; width: 100%; border: 1px solid #000; background: #000; overflow: hidden; }
.pf-game--iframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.pf-panel { margin: 1.4rem 0; line-height: 1.7; }
.pf-panel > :first-child { margin-top: 0; }
.pf-panel > :last-child { margin-bottom: 0; }

.pf-button-wrap { margin: 1.3rem 0; }
.pf-button { border-radius: 0; transition: transform .14s ease, filter .14s ease; }
.pf-button:hover { transform: translateY(-2px); filter: brightness(1.05); }

@media (prefers-reduced-motion: reduce) { .pf-spin { animation: none; } .pf-button:hover { transform: none; } }

/* =======================================================================
   [pf_qualifications] — each year on the left, its subjects in two columns
   ===================================================================== */
/* Fonts for the Qualifications list (served from this plugin; SIL Open Font License). */
@font-face { font-family: 'PFT Poppins'; font-weight: 300; font-display: swap; src: url(../fonts/poppins-300-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'PFT Poppins'; font-weight: 300; font-display: swap; src: url(../fonts/poppins-300-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'PFT Poppins'; font-weight: 700; font-display: swap; src: url(../fonts/poppins-700-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'PFT Poppins'; font-weight: 700; font-display: swap; src: url(../fonts/poppins-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'PFT Roboto Slab'; font-weight: 700; font-display: swap; src: url(../fonts/robotoslab-700-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'PFT Roboto Slab'; font-weight: 700; font-display: swap; src: url(../fonts/robotoslab-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
.pft-quals { --pfq-ink: #3c4858; --pfq-line: #d5d8dc; max-width: 940px; margin: 0 auto; color: var(--pfq-ink); }
.pfq { margin: 0 0 50px; }
.pfq-head { text-align: center; margin: 0 0 50px; }
.pft-quals .pfq-title { font-family: "PFT Poppins", Poppins, sans-serif; font-size: 37px; font-weight: 700; line-height: 1.618; letter-spacing: normal; text-transform: none; color: var(--pfq-ink); margin: 0 0 15px; }
.pfq-meta { font-family: "PFT Poppins", Poppins, sans-serif; font-size: 18px; font-weight: 300; line-height: 1.618; color: var(--pfq-ink); margin: 0; }
.pfq-meta strong { font-weight: 700; }
.pfq-year { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; align-items: start; margin: 0 0 50px; }
.pft-quals .pfq-year-name { font-family: "PFT Poppins", Poppins, sans-serif; font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: normal; text-transform: none; text-decoration: underline; color: var(--blue, #1bb5c6); margin: 0 0 15px; }
.pfq-list { list-style: none; margin: 0; padding: 0; }
.pfq-list li { margin: 0; padding: 0; }
.pft-quals .pfq-item, .pft-quals a.pfq-item:visited, .pft-quals button.pfq-item { width: 100%; text-align: left; background: none; border-width: 0 0 1px; border-radius: 0; cursor: default; display: block; padding: 15px; border-bottom: 1px solid var(--pfq-line); font-family: "PFT Roboto Slab", "Roboto Slab", "Times New Roman", serif; font-size: 18px; font-weight: 700; line-height: 1.1; color: var(--pfq-ink); text-decoration: none; }
.pft-quals a.pfq-item, .pft-quals button.pfq-item { cursor: pointer; }
.pft-quals a.pfq-item:hover, .pft-quals a.pfq-item:focus-visible, .pft-quals button.pfq-item:hover, .pft-quals button.pfq-item:focus-visible { color: var(--blue, #1bb5c6); }
.pfq-icon { display: inline-block; width: 15px; height: 15px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.pft-quals .pfq-item:hover .pfq-icon { opacity: 1; }
.pfq-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(80vh, 640px); padding: 0; border: 0; border-radius: 14px; background: #fff; color: var(--pfq-ink, #3c4858); box-shadow: 0 30px 70px -20px rgba(0,0,0,.45); }
.pfq-dialog::backdrop { background: rgba(20, 22, 34, .5); }
.pfq-dialog-in { position: relative; padding: 28px 28px 24px; }
.pfq-dialog h3 { font-family: "PFT Poppins", Poppins, sans-serif; font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: normal; text-transform: none; color: var(--pfq-ink, #3c4858); margin: 0 36px 14px 0; }
.pfq-dialog-body { font-size: 16px; line-height: 1.65; }
.pfq-dialog-body > :first-child { margin-top: 0; }
.pfq-dialog-body > :last-child { margin-bottom: 0; }
.pfq-dialog-body a { color: var(--blue, #1bb5c6); text-underline-offset: 2px; }
/* Links that stand on their own: cards with where they go. */
.pfq-dialog-body ul.pfq-links { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.pfq-dialog-body .pfq-link-row { margin: 10px 0 0; }
.pfq-dialog-body ul.pfq-links .pfq-link-row { margin: 0; }
.pfq-dialog-body a.pfq-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #e3e1ea; border-radius: 10px; background: #faf9fc; color: var(--pfq-ink, #3c4858); font-weight: 600; line-height: 1.3; text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.pfq-dialog-body a.pfq-link:hover, .pfq-dialog-body a.pfq-link:focus-visible { border-color: var(--blue, #1bb5c6); background: color-mix(in srgb, var(--blue, #1bb5c6) 7%, #fff); outline: none; }
.pfq-link-where { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: #8a8797; }
.pfq-link-where::after { content: "↗"; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .pfq-dialog-body a.pfq-link { transition: none; } }
.pfq-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; font-size: 26px; line-height: 1; color: inherit; cursor: pointer; }
.pfq-close:hover, .pfq-close:focus-visible { background: #f0f0f3; outline: none; }
.pfq-nb { white-space: nowrap; }
@media (max-width: 767px) {
  .pft-quals .pfq-title { font-size: 28px; }
  .pfq-year { grid-template-columns: 1fr; }
  .pft-quals .pfq-year-name { text-align: center; }
}



/* =======================================================================
   Work Timeline page — Leaflet map + month-scaled rail
   ===================================================================== */
.timeline-page .tl-legend { display: flex; gap: 1.1rem; justify-content: center; flex-wrap: wrap; align-items: center; margin: .6rem 0 .5rem; font-family: var(--font-head); font-size: .76rem; font-weight: 600; color: var(--ink-soft); }
.timeline-page .tl-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.tl-key.study { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; background: #d98324; font-size: 10px; }
.tl-legend-note { color: var(--ink-soft); }
.tl-months { display: flex; flex-wrap: wrap; gap: .35rem .8rem; justify-content: center; margin: 0 auto 1.2rem; font-family: var(--font-head); font-size: .66rem; font-weight: 600; color: var(--ink-soft); max-width: 640px; }
.tl-months .pf-ml { display: inline-flex; align-items: center; gap: .32rem; }
.tl-months .pf-ml i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.tl-months .pf-ml.dim { opacity: .38; }

#pf-map { height: clamp(360px, 55vw, 480px); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 0; }
.pf-pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0,0,0,.35); border: 2px solid #fff; }
.pf-pin-cap { transform: rotate(45deg); font-size: 12px; line-height: 1; }
.pf-pin-logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35); display: grid; place-items: center; overflow: hidden; }
.pf-pin-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.pf-pop-logo { text-align: center; margin: 0 0 .5rem; }
.pf-pop-logo img { max-width: 170px; max-height: 72px; width: auto; height: auto; object-fit: contain; }
.tl-dot-logo { background: #fff !important; display: grid; place-items: center; overflow: hidden; }
.tl-dot-logo img { width: 100%; height: 100%; object-fit: contain; padding: 1px; }
.leaflet-popup-content { font-family: var(--font-body); margin: .7rem .9rem; }
.pf-pop-role { font-family: var(--font-head); font-weight: 800; color: var(--blue-ink); font-size: 1rem; margin: 0; }
.pf-pop-name { font-weight: 700; margin: .1rem 0 0; }
.pf-pop-town { color: var(--ink-soft); font-size: .85rem; margin: .1rem 0; }
.pf-pop-dates { font-family: var(--font-head); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); margin: .3rem 0 .4rem; }
.pf-pop-desc { font-size: .9rem; line-height: 1.55; margin: .4rem 0 .6rem; color: var(--ink); }
.pf-pop-study { display: inline-block; background: #d98324; color: #fff; font-family: var(--font-head); font-weight: 700; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; padding: .25em .6em; margin-bottom: .4rem; }

/* rail */
.tl-rail { margin: 1.6rem 0 0; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); padding: 1.1rem 1.2rem 1.4rem; }
.tl-rail h3 { font-family: var(--font-head); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.tl-hint { font-size: .62rem; font-weight: 600; letter-spacing: .06em; color: #b4b8c2; text-transform: none; }
.tl-zoom { margin-left: auto; display: inline-flex; gap: .3rem; }
.tl-zoom-btn { width: 26px; height: 26px; display: grid; place-items: center; font-size: 1rem; line-height: 1; font-family: var(--font-head); font-weight: 700; color: var(--blue-ink); background: color-mix(in srgb, var(--blue) 8%, #fff); border: 1px solid var(--line); cursor: pointer; border-radius: 4px; }
.tl-zoom-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
/* compact (very zoomed out): dots only, no labels */
.tl-axis.compact .tl-label { display: none; }
.tl-axis.compact .tl-dot { width: 12px; height: 12px; border-width: 2px; }
.tl-track { position: relative; overflow-x: auto; overflow-y: visible; padding: 56px 0; }
.tl-axis { position: relative; height: 4px; background: var(--line); margin: 0 4px; }

/* year dividers */
.tl-year { position: absolute; top: 50%; transform: translateY(-50%); }
.tl-year-line { position: absolute; left: 0; top: -40px; height: 80px; width: 1px; background: color-mix(in srgb, var(--ink-soft) 28%, transparent); }
.tl-year-label { position: absolute; left: 4px; top: -52px; font-family: var(--font-head); font-weight: 800; font-size: .82rem; color: var(--ink); }

/* stops */
.tl-stop { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 20px; height: 20px; padding: 0; background: none; border: 0; cursor: pointer; z-index: 2; }
.tl-dot { display: block; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--line), 0 2px 5px rgba(0,0,0,.2); transition: transform .14s ease, box-shadow .14s ease; }
.tl-stop:hover .tl-dot, .tl-stop:focus-visible .tl-dot { transform: scale(1.35); box-shadow: 0 0 0 2px var(--blue); outline: none; }
.tl-label { position: absolute; left: 50%; transform: translateX(-50%); width: 92px; text-align: center; font-family: var(--font-head); line-height: 1.15; }
.tl-stop.up .tl-label { bottom: 26px; }
.tl-stop.down .tl-label { top: 26px; }
.tl-when { display: block; font-weight: 800; font-size: .72rem; color: var(--ink); }
.tl-where { display: block; font-weight: 600; font-size: .66rem; color: var(--ink-soft); }

/* a neat, themed scrollbar for the rail (and anywhere with .pf-scroll) */
.tl-track, .pf-scroll { scrollbar-width: thin; scrollbar-color: var(--blue) transparent; }
.tl-track::-webkit-scrollbar, .pf-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.tl-track::-webkit-scrollbar-track, .pf-scroll::-webkit-scrollbar-track { background: color-mix(in srgb, var(--blue) 7%, #fff); border-radius: 999px; }
.tl-track::-webkit-scrollbar-thumb, .pf-scroll::-webkit-scrollbar-thumb { background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 85%, #fff), var(--blue)); border-radius: 999px; border: 2px solid color-mix(in srgb, var(--blue) 7%, #fff); }
.tl-track::-webkit-scrollbar-thumb:hover, .pf-scroll::-webkit-scrollbar-thumb:hover { background: var(--blue-ink); }

@media (prefers-reduced-motion: reduce) { .tl-dot { transition: none; } }

/* ---- Python games: the terminal ---- */
.pf-game--python .pf-game-stage { background: #000; }
.pf-term { position: absolute; inset: 0; margin: 0; padding: 1rem 1.1rem; overflow-y: auto; color: #d6e2ff; background: #000; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.pf-term::-webkit-scrollbar { width: 10px; }
.pf-term::-webkit-scrollbar-thumb { background: #2b3550; border-radius: 999px; }
.pf-term-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem .85rem; background: var(--paper); border: 1px solid var(--line); border-top: 0; font-family: var(--font-head); font-weight: 600; font-size: .66rem; letter-spacing: .02em; color: var(--ink-soft); }
.pf-term-form { display: flex; align-items: center; gap: .5rem; flex: 1; }
.pf-term-form[hidden] { display: none; }
.pf-term-ps { color: var(--blue); font-weight: 800; font-size: 1rem; line-height: 1; }
.pf-term-input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; padding: .45em .7em; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
.pf-term-input:focus { outline: 2px solid color-mix(in srgb, var(--blue) 45%, #fff); outline-offset: 0; border-color: var(--blue); }
.pf-term-send { font-size: 1rem; line-height: 1; color: #fff; background: var(--blue); border: 0; padding: .4em .7em; cursor: pointer; border-radius: 4px; }
.pf-term-send:hover { background: var(--blue-ink); }
.pf-term-form:not([hidden]) ~ .pf-term-hint { display: none; }
.pf-term-restart { font-family: var(--font-head); font-weight: 700; font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--blue); border: 0; padding: .45em .9em; cursor: pointer; }
.pf-term-restart:hover { background: var(--blue-ink); }

/* ---- Java games on the classic runtime: the CheerpJ game box (#holder), framed and sized to the game ---- */
.pft-has-classic-game #holder { width: 100%; max-width: var(--pft-game-w, 800px); margin: 1.8rem auto; background: #000; border: 1px solid #000; box-shadow: var(--shadow); overflow: hidden; }
.pft-has-classic-game #holder #cheerpjDisplay { width: 100% !important; max-width: 100%; height: auto !important; aspect-ratio: var(--pft-game-ratio, 4 / 3); border: 0 !important; }
.pft-has-classic-game #holder canvas { max-width: 100%; }

/* ---- [pf_app] — a code app in a sandboxed frame ---- */
.pf-app { margin: 1.6rem 0; }
.pf-app-frame { display: block; width: 100%; border: 0; background: transparent; }

/* ---- Box size, position and full screen ([pf_game] [pf_app]) ---- */
.pft-box { position: relative; }
.pft-classic-slot { width: fit-content; max-width: 100%; margin-top: 1.8rem; margin-bottom: 1.8rem; }
/* The Java screen keeps its real size (stretching it moves the game window); zoom makes it bigger. */
.pft-classic-slot #holder { width: var(--pft-game-w, 800px); max-width: 100%; margin: 0 auto; }
.pft-classic-slot[data-align="left"] #holder { margin-left: 0; }
.pft-classic-slot[data-align="right"] #holder { margin-right: 0; }
.pft-classic-slot[data-align="left"] .pft-fs-btn { margin-left: 0; }
.pft-classic-slot.pft-too-small { width: auto; }
.pft-classic-slot.pft-too-small #holder, .pft-classic-slot.pft-too-small .pft-fs-btn { display: none; }
.pft-classic-slot.pft-too-small::before { content: attr(data-small); display: block; padding: 1rem 1.1rem; border: 1px dashed var(--line); color: var(--ink-soft); font-size: .95rem; }
.pft-fs-btn { display: inline-flex; align-items: center; gap: .45em; margin: .6rem 0 0; padding: .5em .95em; font-family: var(--font-head); font-weight: 700; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; line-height: 1; color: var(--blue-ink); background: color-mix(in srgb, var(--blue) 8%, #fff); border: 1px solid color-mix(in srgb, var(--blue) 30%, #fff); cursor: pointer; }
.pft-fs-btn:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.pft-no-fullscreen .pft-fs-btn { display: none; }
.pft-box:fullscreen { box-sizing: border-box; width: 100%; max-width: none; margin: 0; padding: 1rem; overflow: auto; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pft-box:fullscreen .pf-app-frame { width: 100%; height: calc(100vh - 5rem) !important; }
.pft-box:fullscreen .pf-game-stage, .pft-box:fullscreen .pf-game-frame { width: min(100%, calc((100vh - 6rem) * var(--pft-ar, 1.333))); }
.pft-box:fullscreen #holder { margin: 0; }

/* ---- Project "Page layout": box beside the text ---- */
.pft-split { display: flex; align-items: flex-start; gap: 2.4rem; }
.pft-split-text { flex: 1 1 0; min-width: min(16rem, 100%); }
.pft-split-text > :first-child { margin-top: 0; }
.pft-split-box { flex: 1 1 0; min-width: 0; overflow-x: auto; }
.pft-split--left .pft-split-box { order: -1; }
.pft-split-box > .pft-box, .pft-split-box > .pf-app { margin-top: 0; margin-bottom: 0; }
.pft-split-box .pft-classic-slot #holder { margin-left: 0; margin-right: 0; }
.pft-split--right .pft-split-box .pft-fs-btn { margin-left: auto; }
@media (max-width: 820px) {
  .pft-split { flex-direction: column; gap: 1.2rem; }
  .pft-split-text { flex: none; min-width: 0; width: 100%; }
  .pft-split-box { flex: none !important; width: 100%; order: 0 !important; }
  .pft-split-box .pft-classic-slot #holder { margin: 0 auto; }
}

/* ---- [pf_contact] — email and social icons ---- */
.pft-contact { margin: 1.4rem 0 0; }
.pft-mail { margin: 0 0 1.2rem; }
.pft-mail a { color: inherit; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.pft-mail a:hover { color: var(--blue-ink); border-bottom-color: currentColor; }
.pft-contact .pft-socials { display: flex; flex-wrap: wrap; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.pft-contact .pft-socials li { margin: 0; padding: 0; }
.pft-socials a { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: #fff; transition: background-color .16s ease, transform .16s ease; }
.pft-socials a:hover, .pft-socials a:focus-visible { background: var(--c, var(--blue)); transform: translateY(-2px); }
.pft-socials svg { width: 21px; height: 21px; fill: currentColor; }
@media (prefers-reduced-motion: reduce) { .pft-socials a { transition: none; } }

/* ---- About Me page: <div class="pf-about"> with a text column and a photo ---- */
.pf-about { display: flex; align-items: center; gap: clamp(1.6rem, 4vw, 3rem); }
.pf-about-text { flex: 1 1 60%; min-width: 0; }
.pf-about-text > h2:first-child { margin-top: 0; color: var(--blue); }
.pf-about-photo { flex: 0 0 auto; }
.pf-about-photo img { display: block; width: clamp(180px, 24vw, 260px); height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
@media (max-width: 700px) { .pf-about { flex-direction: column; align-items: flex-start; } }

/* =======================================================================
   [pf_hobbies] — the fake AI chat
   ===================================================================== */
.pfw { --pfw-tint: color-mix(in srgb, var(--blue) 9%, var(--paper)); max-width: 820px; margin: 0 auto; padding-block: .5rem 2rem; text-align: left; }
.pfw p, .pfw ul, .pfw ol, .pfw h4 { margin-top: 0; }
.pfw [hidden] { display: none !important; }
.pfw button { font: inherit; color: inherit; }
.pfw-empty { text-align: center; padding-block: clamp(.6rem, 3vw, 1.4rem) 1.2rem; }
.pfw-hi { display: inline-flex; align-items: center; gap: .6rem; margin: 0; font-family: var(--font-head); font-weight: 600; font-size: clamp(1.5rem, 4.4vw, 2.3rem); line-height: 1.15; color: var(--ink); }
.pfw-hi svg { width: 1.3em; height: 1.3em; flex: none; padding: .18em; border-radius: 50%; background: var(--blue); fill: #fff; }

.pfw-composer { position: relative; border: 1px solid var(--line); border-radius: 28px; background: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px -14px rgba(44,44,51,.28); transition: border-color .15s, box-shadow .15s; }
.pfw-composer:focus-within { border-color: color-mix(in srgb, var(--blue) 55%, var(--line)); }
.pfw-composer textarea { display: block; width: 100%; min-height: 60px; max-height: 200px; resize: none; border: 0; outline: 0; padding: 1.1rem 1.4rem .3rem; background: transparent; font: inherit; font-size: 1.05rem; line-height: 1.5; color: var(--ink); box-shadow: none; }
.pfw-composer textarea:focus { outline: 0; box-shadow: none; }
.pfw-composer textarea::placeholder { color: color-mix(in srgb, var(--ink-soft) 70%, var(--paper)); }
.pfw-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .3rem .6rem .6rem; }
.pfw-left { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; }
.pfw-hint { font-size: .8rem; color: var(--ink-soft); }
.pfw-tools { display: inline-flex; align-items: center; gap: .25rem; }
.pfw-ico { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink) !important; cursor: pointer; }
.pfw-ico:hover { background: var(--paper-2); }
.pfw-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pfw .pfw-model { display: inline-flex; align-items: center; gap: .2rem; height: 36px; padding: 0 .6rem; border: 0; border-radius: 999px; background: none; color: var(--ink) !important; font-family: var(--font-body); font-size: .92rem; cursor: pointer; white-space: nowrap; }
.pfw-model:hover { background: var(--paper-2); }
.pfw-model svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pfw-send { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--blue); color: #fff !important; cursor: pointer; transition: background .15s, transform .15s; }
.pfw-send:hover { background: var(--blue-ink); }
.pfw-send:active { transform: scale(.94); }
.pfw-send svg { display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pfw-send .i-stop { fill: currentColor; stroke: none; }
.pfw-send.voice .i-voice, .pfw-send.go .i-send, .pfw-send.stop .i-stop { display: block; }
.pfw-composer.shake { animation: pfw-shake .35s; }
@keyframes pfw-shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.pfw-menu { position: absolute; left: .5rem; bottom: calc(100% + 6px); z-index: 6; min-width: 230px; padding: .35rem; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pfw-menu button { display: flex; width: 100%; align-items: center; gap: .6rem; padding: .55rem .8rem; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; }
.pfw-menu button:hover, .pfw-menu button:focus-visible { background: var(--pfw-tint); color: var(--blue-ink); }
.pfw-menu svg { width: 18px; height: 18px; fill: currentColor; }
.pfw-files { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1.1rem; }
.pfw-files:empty { display: none; }
.pfw-files .chip { margin-top: .8rem; display: grid; gap: .3rem; width: min(240px, 100%); padding: .5rem .7rem; border-radius: 12px; border: 1px solid var(--line); background: var(--paper-2); font-size: .85rem; }
.pfw-files .chip .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfw-files .chip .p { position: relative; height: 4px; overflow: hidden; border-radius: 4px; background: var(--line); }
.pfw-files .chip .p i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--blue); transition: width 1.6s cubic-bezier(.2,.9,.3,1); }
.pfw-files .chip.bad { border-color: #e7b4b4; background: #fdf0f0; color: #8a1f1f; }
.pfw-files .chip.bad .p i { background: #c43d3d; }
/* Error toast, like the ones chat apps show: floats just above the box. */
.pfw-dock { position: relative; }
.pfw-oops { position: absolute; left: 50%; bottom: calc(100% + 6px); z-index: 6; transform: translateX(-50%); box-sizing: border-box; width: max-content; max-width: min(440px, 100%); display: flex; align-items: flex-start; gap: .55rem; padding: .65rem .95rem; border-radius: 12px; background: #dc2626; color: #fff; font-size: 14px; line-height: 1.45; text-align: left; box-shadow: 0 12px 32px -12px rgba(0,0,0,.45); animation: pfw-toast .18s ease-out; }
.pfw-oops svg { flex: none; width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pfw-oops.note { background: #2b2b31; }
@keyframes pfw-toast { from { opacity: 0; transform: translate(-50%, 6px); } }
.pfw-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1rem; }
.pfw-chips button { padding: .5rem .95rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: .9rem; cursor: pointer; }
.pfw-chips button:hover { border-color: var(--blue); background: var(--pfw-tint); color: var(--blue-ink); }
.pfw-small { margin: .8rem 0 0; text-align: center; font-size: .78rem; color: var(--ink-soft); }
.pfw-dock.docked { position: sticky; bottom: 0; z-index: 5; margin-inline: -16px; padding-inline: 16px; padding-block: .8rem calc(.6rem + env(safe-area-inset-bottom, 0px)); background: linear-gradient(color-mix(in srgb, var(--paper) 0%, transparent), var(--paper) 30%); }

.pfw-thread { display: grid; gap: 1.6rem; padding-block: 1rem; }
.pfw-thread:empty { display: none; }
.pfw-you { justify-self: end; max-width: 80%; padding: .7rem 1.1rem; border-radius: 20px; background: var(--paper-2); border: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pfw-bot { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: .9rem; align-items: start; }
.pfw-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); }
.pfw-avatar svg { width: 20px; height: 20px; fill: #fff; }
.pfw-name { margin-bottom: .3rem; font-family: var(--font-head); font-weight: 700; font-size: .78rem; letter-spacing: .04em; }
.pfw-thinking { font-style: italic; background: linear-gradient(90deg, var(--ink-soft) 30%, var(--blue) 50%, var(--ink-soft) 70%) 0 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: pfw-shimmer 1.4s linear infinite; }
@keyframes pfw-shimmer { to { background-position: -300% 0; } }
.pfw-thought { margin: 0 0 .8rem; font-size: .9rem; color: var(--ink-soft); }
.pfw-thought summary { cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: .78rem; }
.pfw-thought p { margin: .4rem 0 0; padding-left: .8rem; border-left: 2px solid var(--line); }
.pfw-answer p { margin: 0 0 .9rem; max-width: 68ch; }
.pfw-answer .lead { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.15rem, 3vw, 1.35rem); line-height: 1.3; color: var(--ink); }
.pfw-answer .transition { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--blue); }
.pfw-answer .read { margin: 1.4rem 0 .8rem; font-family: var(--font-head); font-weight: 700; font-size: 1rem; }
.pfw-answer ul, .pfw-answer ol { margin: 0 0 1rem; padding-left: 1.1rem; max-width: 68ch; }
.pfw-answer li { margin: .25rem 0; }
.pfw-answer h3, .pfw-answer h4 { margin: 1.4rem 0 .7rem; }
.pfw-answer sup a { padding: 0 .35em; border-radius: 999px; margin-left: .1em; font-family: var(--font-head); font-weight: 700; font-size: .68rem; text-decoration: none; background: var(--pfw-tint); color: var(--blue-ink); }
.pfw-arts { display: grid; gap: 1rem; margin-bottom: 1rem; }
.pfw-art { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -16px rgba(44,44,51,.3); }
.pfw-art-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem .8rem; border-bottom: 1px solid var(--line); background: var(--paper-2); font-family: var(--font-head); font-weight: 600; font-size: .72rem; color: var(--ink-soft); }
.pfw-art-head .k { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; overflow-wrap: anywhere; }
.pfw-art-head svg { width: 14px; height: 14px; fill: var(--blue); flex: none; }
.pfw-art-head .num { color: var(--blue-ink); letter-spacing: .06em; text-transform: uppercase; }
.pfw-art-body { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1.1rem; padding: 1rem 1.1rem 1.1rem; }
.pfw-art-body.no-cover { grid-template-columns: minmax(0, 1fr); }
.pfw-art-body img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; box-shadow: var(--shadow); }
.pfw-art h4 { margin: 0; font-family: var(--font-head); font-size: 1.25rem; font-weight: 800; }
.pfw-art .own { display: block; margin: .1rem 0 .6rem; font-family: var(--font-head); font-weight: 600; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.pfw-art .meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 .7rem; }
.pfw-art .kind { font-family: var(--font-head); font-weight: 600; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.pfw-art blockquote { margin: 0 0 .7rem; padding: 0 0 0 .9rem; border-left: 3px solid var(--line); font-style: normal; }
.pfw-art blockquote p { margin: 0 0 .5rem; }
.pfw-tag { display: inline-flex; padding: .3em .75em; border-radius: 999px; background: var(--blue); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; }
.pfw-go { display: inline-flex; align-items: center; gap: .4em; padding: .65em 1.15em; border-radius: 999px; background: var(--blue); color: #fff !important; font-family: var(--font-head); font-weight: 700; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.pfw-go:hover { background: var(--blue-ink); }
.pfw-sources { margin: 1.2rem 0 .8rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .9rem; }
.pfw-sources b { display: block; margin-bottom: .3rem; font-family: var(--font-head); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.pfw-sources ol { margin: 0; padding-left: 1.3rem; }
.pfw-sources li { margin: .15rem 0; overflow-wrap: anywhere; }
.pfw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: .5rem; color: var(--ink-soft); }
.pfw-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 28px; height: 28px; padding: 0 5px; border: 0; border-radius: 8px; background: none; color: var(--ink-soft) !important; cursor: pointer; }
.pfw-actions button:hover { background: var(--paper-2); color: var(--ink) !important; }
.pfw-actions button.on { color: var(--blue) !important; }
.pfw-actions svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pfw-actions .down svg { transform: rotate(180deg); }
.pfw-actions .down.spin { animation: pfw-spin .9s cubic-bezier(.5,.1,.2,1); }
@keyframes pfw-spin { 0% { transform: none; } 45% { transform: rotate(180deg) scale(1.25); } 100% { transform: rotate(360deg); } }
.pfw-actions .count { font-family: var(--font-head); font-weight: 700; font-size: .75rem; line-height: 1; }
.pfw-time { margin-left: 8px; font-size: .82rem; line-height: 28px; color: var(--ink-soft); }
.pfw-fb { margin: .3rem 0 0; font-size: .9rem; color: var(--blue-ink); }
.pfw-cursor::after { content: "▍"; color: var(--blue); animation: pfw-blink 1s steps(1) infinite; }
@keyframes pfw-blink { 50% { opacity: 0; } }
.pfw-hide { opacity: 0; transform: translateY(6px); }
.pfw-show { opacity: 1; transform: none; transition: opacity .35s, transform .35s; }
@media (max-width: 700px) {
  .pfw-art-body { grid-template-columns: minmax(0, 1fr); }
  .pfw-art-body img { max-width: 140px; }
  .pfw-you { max-width: 92%; }
  .pfw-bot { grid-template-columns: 30px minmax(0, 1fr); gap: .6rem; }
  .pfw-avatar { width: 30px; height: 30px; }
}
@media (max-width: 520px) {
  .pfw-hint { display: none; }
  .pfw .pfw-model { height: 32px; padding: 0 .45rem; font-size: .8rem; }
  .pfw .pfw-model svg { width: 14px; height: 14px; }
  .pfw-oops { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .pfw *, .pfw *::before, .pfw *::after { animation: none !important; transition: none !important; } }
