/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is suggested that you use this file to contain the following:
 *
 * 1. Imports
 * 2. Fonts
 * 3. Variables
 * 4. Global styles
 * 5. Components
 *
 *= require_tree .
 *= require_self
 */

.progressive-image { display: block; max-width: 100%; background-size: cover; background-position: center; overflow: hidden; }
.progressive-image > img { display: block; margin: 0 !important; max-width: 100%; height: auto; }
.progressive-image-card, .progressive-image-card > img { width: 100%; height: 100%; }
.progressive-images-enabled .progressive-image > img[data-lqip] { opacity: 0; transition: opacity 240ms ease-out; }
.progressive-images-enabled .progressive-image > img.image-decoded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .progressive-images-enabled .progressive-image > img[data-lqip] { transition: none; }
}

/* Personal homepage: one reading column for thoughts and a quieter article index. */
.blog-navbar { background: rgba(250, 252, 255, .94); border-color: #dce5f1; }
.blog-nav-inner { max-width: 1388px; margin: auto; padding: 0 36px; }
.blog-wordmark { color: #101e3d; font-size: 20px; font-weight: 800; letter-spacing: -.045em; }
.blog-wordmark:hover { color: #0755b6; }

.home-page {
  max-width: 1388px;
  margin: auto;
  padding: 34px 36px 64px;
  color: #102044;
}
.home-intro { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding-bottom: 27px; border-bottom: 1px solid #dbe4f0; }
.home-identity { display: flex; align-items: center; gap: 24px; min-width: 0; }
.home-avatar { width: 78px; height: 78px; flex: none; display: grid; place-items: center; border-radius: 6px; background: #345e91; color: white; font-size: 52px; font-weight: 700; line-height: 1; }
.home-identity h1 { margin: 0 0 4px; font-size: 28px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.home-identity p { margin: 0; color: #597092; font-size: 15px; }
.home-projects { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; font-size: 14px; }
.home-projects span { color: #7587a5; }
.home-projects a, .home-section-heading a { color: #0756b9; text-decoration: none; }
.home-projects a:hover, .home-section-heading a:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-columns { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr); margin-top: 30px; }
.home-thoughts { min-width: 0; padding-right: 32px; }
.home-articles { min-width: 0; border-left: 1px solid #dbe4f0; padding-left: 36px; }
.home-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.home-section-heading h2 { color: #0e1c3b; font-size: 30px; font-weight: 800; letter-spacing: -.045em; line-height: 1.3; }
.home-section-heading a { flex: none; font-size: 13px; }
.home-thought { padding: 18px 0 20px; border-bottom: 1px solid #dbe4f0; overflow-wrap: anywhere; }
.home-thought-meta { display: flex; align-items: center; gap: 8px; color: #7187a8; font-size: 13px; }
.home-thought-meta time { font-variant-numeric: tabular-nums; }
.home-thought-meta a { color: inherit; text-decoration: none; }
.home-thought-meta a:hover { color: #0756b9; text-decoration: underline; }
.home-mini-avatar { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 4px; background: #3b6495; color: white; font-weight: 700; font-size: 15px; }
.home-thought-content { margin-top: 8px; color: #263b61; font-size: 17px; line-height: 1.75; }
.home-thought-content p { margin: .25em 0; }
.home-thought-content a { color: #0756b9; overflow-wrap: anywhere; }
.home-thought-content img { display: block; max-width: 100%; max-height: 380px; width: auto; height: auto; margin: 12px 0 0; border-radius: 6px; }
.home-thought-content .progressive-image { width: fit-content; aspect-ratio: auto !important; }
.home-thought-content pre { max-width: 100%; overflow-x: auto; }
.home-empty { padding: 36px 0; color: #8292aa; font-size: 14px; }
.home-articles .article-preview { padding: 20px 0; border-color: #dbe4f0; }
.home-articles .article-preview > .flex > div:first-child { display: none; }
.home-articles .article-preview-title { font-size: 18px; font-weight: 700; line-height: 1.5; color: #132345; }
.home-articles .article-preview-title a:hover { color: #0756b9; }
.home-articles .article-preview-summary { font-size: 14px; line-height: 1.6; color: #7187a8; }
.home-pagination { display: flex; align-items: center; justify-content: center; gap: 20px; border-top: 1px solid #dbe4f0; margin-top: 22px; padding-top: 20px; color: #8191aa; font-size: 13px; }
.home-page-link { color: #0756b9; }
.home-page-link:hover { text-decoration: underline; }
.home-rhythm { margin: 0 0 6px; padding: 13px 15px 10px; border: 1px solid #dce6f3; border-radius: 7px; background: #f2f6fc; }
.home-rhythm-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.home-rhythm-heading h3 { font-size: 12px; font-weight: 600; }
.home-rhythm-heading span, .home-rhythm-note { color: #586e8c; font-size: 12px; }
.home-rhythm-days { display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); align-items: end; gap: 1px; margin-top: 9px; border-bottom: 1px solid #dbe4f0; }
.home-rhythm-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 62px; min-width: 0; font-variant-numeric: tabular-nums; }
.home-rhythm-count { display: block; height: 15px; margin-top: auto; color: #234b84; font-size: 10px; line-height: 15px; }
.home-rhythm-mark { display: block; flex: none; width: min(12px, 74%); }
.home-rhythm-day.has-posts .home-rhythm-mark { height: var(--bar-height); background: #1762c5; border-radius: 3px 3px 0 0; }
.home-rhythm-day.is-empty .home-rhythm-mark, .home-rhythm-day.is-future .home-rhythm-mark { width: 5px; height: 5px; margin-bottom: 2px; border-radius: 50%; }
.home-rhythm-day.is-empty .home-rhythm-mark { background: #abb9cd; }
.home-rhythm-day.is-future .home-rhythm-mark { border: 1px solid #abb9cd; }
.home-rhythm-label { height: 17px; color: #7890b1; font-size: 10px; line-height: 17px; white-space: nowrap; }
.home-rhythm-note { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
@media (max-width: 640px) {
  .home-rhythm { padding: 12px 10px 9px; }
  .home-rhythm-day:nth-child(30) .home-rhythm-label { visibility: hidden; }
}

@media (max-width: 900px) {
  .home-columns { grid-template-columns: minmax(0, 1fr); }
  .home-thoughts { padding-right: 0; }
  .home-articles { border-left: 0; border-top: 1px solid #dbe4f0; padding: 30px 0 0; margin-top: 36px; }
}
@media (max-width: 640px) {
  .blog-nav-inner, .home-page { padding-left: 18px; padding-right: 18px; }
  .home-page { padding-top: 25px; }
  .home-intro { gap: 18px; padding-bottom: 22px; }
  .home-identity { gap: 14px; }
  .home-avatar { width: 56px; height: 56px; font-size: 37px; }
  .home-identity h1 { font-size: 23px; }
  .home-identity p { font-size: 13px; }
  .home-projects { gap: 7px 14px; font-size: 12px; }
  .home-section-heading h2 { font-size: 25px; }
  .home-thought-content { font-size: 16px; }
}

/* Shared image feedback for quick thoughts and Markdown editors. */
.image-uploads { padding: 0 16px 14px; }
.image-uploads[hidden], .image-upload [hidden] { display: none !important; }
.image-uploads-heading { margin-bottom: 10px; color: #63758f; font-size: 11px; }
.image-uploads-heading span { color: #8893a4; }
.image-uploads-list { display: grid; gap: 12px; }
.image-upload { display: flex; align-items: center; gap: 12px; }
.image-upload-thumbnail { position: relative; flex: none; width: 64px; height: 64px; }
.image-upload-preview { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 6px; background: #edf1f6; }
.image-upload-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image-upload-fallback { font-size: 11px; color: #7587a5; }
.image-upload-remove { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid white; border-radius: 50%; background: #263b61; color: white; font-size: 16px; line-height: 1; }
.image-upload-details { flex: 1; min-width: 0; }
.image-upload-name { margin: 0 0 6px; color: #42516a; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-upload-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #0756b9; font-size: 11px; overflow-wrap: anywhere; }
.image-upload-retry { flex: none; padding: 5px 10px; border-radius: 5px; background: #fcefeb; color: #a63c33; }
.image-upload progress { display: block; appearance: none; width: 100%; height: 3px; margin-top: 8px; border: 0; border-radius: 4px; overflow: hidden; background: #e8edf4; }
.image-upload progress::-webkit-progress-bar { background: #e8edf4; }
.image-upload progress::-webkit-progress-value { background: #1762c5; transition: width 150ms; }
.image-upload progress::-moz-progress-bar { background: #1762c5; }
.image-upload-spinner { position: absolute; top: 22px; left: 22px; width: 20px; height: 20px; border: 2px solid #ffffff80; border-top-color: white; border-radius: 50%; box-shadow: 0 0 0 40px #10204445; animation: image-upload-spin 800ms linear infinite; }
.image-upload[data-state="uploaded"] .image-upload-spinner, .image-upload[data-state="failed"] .image-upload-spinner { display: none; }
.image-upload[data-state="uploaded"] .image-upload-status { color: #21805b; }
.image-upload[data-state="failed"] .image-upload-status { color: #a63c33; }
.image-uploads-hint { margin: 10px 0 0; font-size: 11px; color: #7587a5; }
.image-uploads-hint:focus-visible { outline: 2px solid #1762c5; outline-offset: 3px; }
[data-paste-image-target="submit"]:disabled { background: #e7e5e4; color: #78716c; cursor: wait; }
.image-upload-dialog { position: fixed; inset: 0; margin: auto; padding: 36px 12px 12px; border: 0; border-radius: 8px; max-width: 94vw; max-height: 90dvh; background: white; }
.image-upload-dialog::backdrop { background: #102044b3; }
.image-upload-dialog img { display: block; max-width: 88vw; max-height: 78dvh; object-fit: contain; }
.image-upload-dialog button { position: absolute; right: 6px; top: 2px; width: 32px; height: 32px; color: #42516a; font-size: 24px; }
@keyframes image-upload-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .image-upload-spinner { animation: none; }
  .image-upload progress::-webkit-progress-value { transition: none; }
}

/* Independent project introductions. */
.projects-page{max-width:1192px;margin:auto;padding:24px 36px 28px}
.page-heading{display:flex;justify-content:space-between;align-items:baseline;gap:20px;margin-bottom:22px}
.page-heading h1{font-size:30px;font-weight:800;letter-spacing:-1px;line-height:1.3}
.page-heading p{margin-top:8px;color:#597092;font-size:14px;line-height:1.6}
.back{color:#0756b9;font-size:12px;white-space:nowrap}
.projects-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.project-card{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);border:1px solid #dbe4f0;border-radius:9px;background:#fff;overflow:hidden;min-height:214px;transition:border-color .15s}
.project-card:hover{border-color:#7e9fc9}
.card-copy{padding:22px 20px;display:flex;flex-direction:column;min-width:0}
.project-type{font-size:12px;color:#586e8c;margin-bottom:8px}
.card-copy h2{font-size:21px;font-weight:700;letter-spacing:-.5px;line-height:1.3}
.card-copy p{font-size:14px;line-height:1.75;color:#597092;margin:12px 0 16px}
.visit{font-size:12px;color:#0756b9;margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:10px}
.visit span:last-child{font-size:18px}
.project-image{min-width:0;min-height:100%;background:#f0f3f8;border-left:1px solid #e5ebf3}
.project-image img{display:block;width:100%;height:100%;object-fit:cover;object-position:right center}
.page-note{margin-top:20px;display:flex;justify-content:space-between;gap:12px;color:#586e8c;font-size:12px;line-height:1.6}

@media(max-width:1000px){.project-card{grid-template-columns:1fr}
.project-image{grid-row:1;height:160px;border-left:0;border-bottom:1px solid #e5ebf3;min-height:0}
.project-image img{object-position:right center}
.card-copy{padding:20px}
.card-copy p{margin-bottom:18px}
}

@media(max-width:640px){.projects-page{padding:26px 18px}
.page-heading{align-items:flex-start;gap:10px}
.page-heading h1{font-size:27px}
.page-heading p{font-size:14px;max-width:240px}
.back{padding-top:10px}
.projects-grid{grid-template-columns:1fr;gap:20px}
.project-image{height:170px}
.project-image img{object-fit:cover;object-position:right center}
.card-copy h2{font-size:22px}
.card-copy p{font-size:15px}
.page-note{flex-direction:column}
}

@media(prefers-reduced-motion:reduce){.project-card{transition:none}
}

/* A quiet, thumb-friendly notebook for the home-screen publishing entry. */
.thought-composer-page { margin: 0; background: #fafaf9; color: #292524; }
.thought-composer-shell { max-width: 580px; margin: auto; padding: max(30px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.thought-composer-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.thought-composer-eyebrow { font-size: 11px; letter-spacing: .12em; color: #78716c; }
.thought-composer-heading h1 { margin: 8px 0 0; font-family: "Songti SC", "Noto Serif CJK SC", serif; font-size: 30px; font-weight: 600; }
.thought-composer-heading a { flex: none; padding: 12px 0 12px 8px; color: #57534e; font-size: 13px; }
.thought-composer-paper { border: 1px solid #e7e5e4; border-radius: 12px; background: white; overflow: hidden; }
.thought-composer-paper > label { display: block; padding: 22px 20px 0; color: #78716c; font-size: 13px; }
.thought-composer-paper textarea { display: block; width: 100%; min-height: 36dvh; padding: 14px 20px 22px; resize: vertical; border: 0; background: transparent; color: #292524; font-size: 17px; line-height: 1.85; box-shadow: none; }
.thought-composer-paper textarea::placeholder { color: #a8a29e; }
.thought-composer-tags { display: flex; align-items: center; gap: 14px; border-top: 1px solid #f0eeec; padding: 8px 20px; }
.thought-composer-tags label { flex: none; color: #78716c; font-size: 13px; }
.thought-composer-tags input { width: 100%; min-width: 0; min-height: 44px; border: 0; background: transparent; font-size: 16px; box-shadow: none; }
.thought-composer-tags input::placeholder { color: #a8a29e; font-size: 13px; }
.thought-composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0; }
.thought-composer-photo { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; cursor: pointer; color: #57534e; font-size: 14px; }
.thought-composer-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.thought-composer-publish { min-height: 48px; min-width: 132px; padding: 12px 24px; border: 0; border-radius: 999px; background: #292524; color: white; cursor: pointer; font-size: 15px; font-weight: 600; }
.thought-composer-save, .thought-composer-note { margin: 8px 0; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.thought-composer-save { color: #526b59; }
.thought-composer-note { color: #78716c; }
.thought-composer-notice { margin: 0 0 18px; padding: 12px 16px; border-radius: 8px; background: #edf3ee; color: #375c40; font-size: 14px; }
.thought-composer-error { margin-bottom: 16px; color: #a63c33; font-size: 14px; }
.thought-composer-install { margin-top: 32px; padding-top: 20px; border-top: 1px solid #e7e5e4; color: #78716c; font-size: 12px; line-height: 1.8; }
.thought-composer-install summary { width: fit-content; min-height: 44px; cursor: pointer; color: #57534e; }
.thought-composer-install p { margin: 8px 0; }
.thought-composer :focus-visible, .thought-composer-heading a:focus-visible, .thought-composer-install summary:focus-visible { outline: 2px solid #7c8b70; outline-offset: 3px; }
.thought-composer-paper textarea:focus-visible, .thought-composer-tags input:focus-visible { outline-offset: -3px; }
.thought-composer-toolbar:has(.thought-composer-file:focus-visible) .thought-composer-photo { outline: 2px solid #7c8b70; outline-offset: 3px; }
.thought-composer .image-upload-remove { width: 32px; height: 32px; top: -9px; right: -9px; }
.thought-composer .image-upload-dialog button, .thought-composer .image-upload-retry { min-width: 44px; min-height: 44px; }
@media (max-width: 360px) {
  .thought-composer-shell { padding-left: 16px; padding-right: 16px; }
  .thought-composer-heading h1 { font-size: 27px; }
}
