/* ==========================================================================
   Lee's blog — classic mid-2000s blog skin (Blogger "Minima" era).
   Fixed-width page, gradient header, tabs, dated posts, sidebar widgets.
   Sakara uses a dark skin (body.dark) and keeps its original title style.
   Weird mode (html.weird) turns it into an abandoned blog.
   ========================================================================== */

:root {
  --page-bg: #dde2e8;
  --box: #ffffff;
  --box-line: #b8c2cd;
  --text: #333333;
  --muted: #999999;
  --link: #5588aa;
  --visited: #996699;
  --hover: #cc6600;
  --title: #cc6600;
  --rule: #cccccc;
  --head-1: #6f9fd0;
  --head-2: #2d5c8e;
  --tab-bg: #eef2f6;
  --tab-line: #b8c2cd;
  --serif: Georgia, "Times New Roman", "Yu Mincho", serif;
  --sans: "Trebuchet MS", Trebuchet, Verdana, Arial, "Meiryo", sans-serif;
  --small: Verdana, Tahoma, Arial, "Meiryo", "MS PGothic", sans-serif;
  --ja: "Meiryo", "MS PGothic", "Hiragino Kaku Gothic Pro", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 16px 8px 40px;
  background: var(--page-bg) repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 2px, transparent 2px 6px);
  color: var(--text);
  font: 13px/1.6 var(--serif);
}
html[data-lang="ja"] body { font-family: var(--ja); font-size: 13px; line-height: 1.75; }
a:link { color: var(--link); text-decoration: none; }
a:visited { color: var(--visited); text-decoration: none; }
a:hover { color: var(--hover); text-decoration: underline; }
img { max-width: 100%; border: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 4px; left: 4px; z-index: 100; width: auto; height: auto; clip: auto; background: #ffc; padding: 4px 8px; border: 1px solid #000; }
:focus-visible { outline: 2px dotted var(--hover); outline-offset: 2px; }

/* language + mode switching */
html[data-lang="en"] [data-l="ja"],
html[data-lang="ja"] [data-l="en"] { display: none !important; }
html:not(.weird) .w { display: none !important; }
html.weird .n { display: none !important; }

/* ---------- page shell ---------- */
#outer {
  width: 820px; max-width: 100%; margin: 0 auto;
  background: var(--box); border: 1px solid var(--box-line);
  box-shadow: 0 0 0 4px rgba(255,255,255,.6), 2px 3px 8px rgba(0,0,0,.18);
}
#header {
  position: relative; margin: 8px 8px 0; padding: 34px 30px 30px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, var(--head-1), var(--head-2));
  border: 1px solid #234a73;
  color: #fff; overflow: hidden;
}
#header::after { /* glossy 2005 shine */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 50%;
  background: linear-gradient(rgba(255,255,255,.28), rgba(255,255,255,.05)); pointer-events: none;
}
#header h1 { margin: 0; font: bold 34px/1.1 var(--sans); letter-spacing: -.5px; text-shadow: 1px 2px 0 rgba(0,0,0,.35); position: relative; z-index: 1; }
#header h1 a, #header h1 a:visited { color: #fff; }
#header h1 a:hover { text-decoration: none; color: #ffffcc; }
#header .description { margin: 8px 0 0; font: italic 13px var(--serif); color: #dbe8f5; position: relative; z-index: 1; max-width: 46em; }
html[data-lang="ja"] #header .description { font-style: normal; font-family: var(--ja); }

.tools { position: absolute; top: 8px; right: 10px; z-index: 2; display: flex; gap: 4px; }
.tools button {
  font: 11px Tahoma, Verdana, "MS PGothic", sans-serif; color: #000; cursor: pointer;
  background: #ece9d8; border: 1px solid; border-color: #fff #716f64 #716f64 #fff;
  padding: 1px 7px; height: 20px; display: inline-flex; align-items: center; gap: 4px;
}
.tools button:active { border-color: #716f64 #fff #fff #716f64; }
.tools svg { width: 14px; height: 14px; }

/* tabs */
#tabs { margin: 0 8px; padding: 6px 10px 0; background: var(--tab-bg); border: 1px solid var(--tab-line); border-top: 0; display: flex; flex-wrap: wrap; gap: 3px; }
#tabs a {
  display: block; padding: 4px 14px 5px; margin-bottom: -1px;
  font: bold 11px var(--small); color: #1d4f86;
  background: linear-gradient(#ffffff, #dfe7ef); border: 1px solid var(--tab-line); border-radius: 6px 6px 0 0;
}
#tabs a:hover { background: #fff; text-decoration: none; color: var(--hover); }
#tabs a[aria-current="page"] { background: #fff; border-bottom-color: #fff; color: #000; }
#tabs .rss { margin-left: auto; align-self: center; font: 10px var(--small); color: var(--muted); padding-bottom: 4px; }

/* columns */
#content { display: flex; gap: 26px; padding: 22px 26px 10px; border-top: 1px solid var(--tab-line); margin: 0 8px; }
#main { flex: 1; min-width: 0; }
#sidebar { width: 220px; flex: none; font-size: 12px; }
@media (max-width: 760px) {
  body { padding: 0 0 40px; }
  #outer { border: 0; box-shadow: none; }
  #header { margin: 0; border-radius: 0; padding: 40px 16px 22px; }
  #header h1 { font-size: 28px; }
  #tabs { margin: 0; }
  #tabs .rss { display: none; }
  #content { flex-direction: column; padding: 16px; margin: 0; }
  #sidebar { width: auto; border-top: 3px double var(--rule); padding-top: 12px; }
}

/* ---------- posts (Minima) ---------- */
h2.date-header {
  margin: 1.6em 0 .5em; font: normal 78% var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
h2.date-header:first-child { margin-top: 0; }
.post { margin: .5em 0 1.5em; padding-bottom: 1.5em; border-bottom: 1px dotted var(--rule); }
.post h3 { margin: .25em 0 0; padding: 0 0 4px; font: normal 18px/1.4 var(--serif); color: var(--title); }
html[data-lang="ja"] .post h3 { font-family: var(--ja); font-weight: bold; font-size: 16px; }
.post h3 a, .post h3 a:visited { color: var(--title); }
.post-body { margin: .6em 0 .75em; line-height: 1.6em; }
.post-body p { margin: 0 0 .9em; }
.post-body ul { margin: .3em 0 .9em; padding-left: 1.6em; }
.post-body h4 { margin: 1.2em 0 .3em; font: bold 13px var(--sans); color: #555; }
.post-footer { margin: .75em 0; color: var(--muted); font: normal 78% var(--sans); letter-spacing: .1em; }
.post-footer .labels { display: block; margin-top: 2px; letter-spacing: 0; }
.new { display: inline-block; font: bold 9px Verdana, sans-serif; color: #fff; background: #e00; padding: 0 3px; margin-left: 6px; vertical-align: 3px; animation: newblink 1.2s steps(1) infinite; }
@keyframes newblink { 50% { background: #f80; } }
blockquote { margin: .8em 1.5em; padding: 0 0 0 .75em; border-left: 3px solid var(--rule); color: #666; font-style: italic; }
.blog-pager { text-align: center; font: 11px var(--small); color: var(--muted); margin: 1em 0; }

/* ---------- sidebar widgets ---------- */
.widget { margin: 0 0 1.6em; }
.widget h2 {
  margin: 0 0 .6em; padding: 0 0 4px; font: normal 78% var(--sans); letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px dotted var(--rule);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { margin: 0; padding: 2px 0 2px 15px; text-indent: -15px; line-height: 1.5em; }
.widget li::before { content: "»"; padding-right: 6px; color: var(--muted); }
.profile-img { float: left; margin: 0 8px 4px 0; padding: 3px; border: 1px solid #ddd; background: #fff; width: 66px; height: 66px; }
.profile-name { font-weight: bold; display: block; }
.profile-loc { color: var(--muted); display: block; font-size: 11px; }
.profile-text { clear: both; margin: 8px 0 4px; }
.counter { font: bold 15px "Courier New", monospace; background: #000; color: #3f3; padding: 2px 6px; letter-spacing: 3px; display: inline-block; border: 2px inset #888; }
.labels-cloud a { margin-right: 6px; white-space: nowrap; }
.buttons { display: flex; flex-wrap: wrap; gap: 4px; }
.b88 {
  width: 88px; height: 31px; display: flex; font: bold 8px/1 Verdana, Tahoma, sans-serif; text-transform: uppercase;
  border: 1px solid #000; overflow: hidden; letter-spacing: .5px;
}
.b88 span { display: grid; place-items: center; text-align: center; padding: 0 3px; }
.b88 span:first-child { width: 36px; }
.b88 span:last-child { flex: 1; }
.lang-links a { cursor: pointer; }

/* ---------- footer ---------- */
#footer { margin: 0 8px 8px; padding: 12px; border-top: 1px dotted var(--rule); text-align: center; font: 10px/1.6 var(--small); color: var(--muted); letter-spacing: .1em; }

/* ---------- about: blogger profile ---------- */
.profile-card { display: flex; gap: 16px; align-items: flex-start; margin: 0 0 1.5em; }
.profile-card img { width: 120px; height: 120px; padding: 4px; border: 1px solid #ddd; background: #fff; flex: none; }
.profile-card h3 { margin: 0 0 4px; font: bold 20px var(--serif); color: var(--title); }
table.profile { border-collapse: collapse; width: 100%; margin: 0 0 1.5em; font-size: 12px; }
table.profile th, table.profile td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px dotted var(--rule); }
table.profile th { width: 34%; color: #666; font: bold 11px var(--small); background: #f5f7f9; }
.soon { color: var(--muted); font-style: italic; }
@media (max-width: 480px) { .profile-card { flex-direction: column; } }

/* ---------- projects ---------- */
.project { display: flex; gap: 14px; padding: 0 0 1.4em; margin: 0 0 1.4em; border-bottom: 1px dotted var(--rule); }
.project .thumb { width: 96px; height: 96px; flex: none; border: 1px solid #ccc; padding: 3px; background: #fff; }
.project .thumb > div { width: 100%; height: 100%; position: relative; overflow: hidden; }
.project h3 { margin: 0 0 2px; font: normal 18px var(--serif); color: var(--title); }
html[data-lang="ja"] .project h3 { font-family: var(--ja); font-weight: bold; font-size: 16px; }
.project .meta { font: 11px var(--small); color: var(--muted); margin-bottom: 6px; }
.project .meta b { color: #666; font-weight: normal; }
.project p { margin: 0 0 .5em; }
.project ul { margin: 0; padding-left: 1.4em; }
@media (max-width: 480px) { .project { flex-direction: column; } }
/* thumbnails (small versions of the modern site's art) */
.art-tpu { background: #3b6cf6; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 10px; }
.art-tpu i { background: rgba(255,255,255,.25); border-radius: 3px; }
.art-tpu i:nth-child(2), .art-tpu i:nth-child(6), .art-tpu i:nth-child(7) { background: #fff; }
.art-zip { background: #0f1115; display: grid; place-items: center; }
.art-zip svg { width: 46%; }
.art-sea { background: radial-gradient(100% 80% at 50% 0%, #0d3b66, #04101f 75%); }
.art-sea svg, .art-comp svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-ber { background: #ffd23f; display: grid; place-items: center; font: bold 26px var(--sans); color: #1d1a12; }
.art-ig { background: linear-gradient(160deg, #a855f7, #ec4899 60%, #f59e0b); display: flex; align-items: flex-end; gap: 3px; padding: 10px; }
.art-ig i { flex: 1; background: rgba(255,255,255,.85); }
.art-comp { background: #d9dee5; }

/* ---------- 404 (Apache-style) ---------- */
body.apache { background: #fff; padding: 16px; font: 16px "Times New Roman", Times, serif; color: #000; }
body.apache h1 { font: bold 32px "Times New Roman", serif; margin: .67em 0; }
body.apache hr { border: 0; border-top: 1px solid #888; }
body.apache address { font-style: italic; }
body.apache a:link { color: #00e; text-decoration: underline; }
body.apache a:visited { color: #551a8b; }

/* ==========================================================================
   SAKARA — dark skin ("Minima Black") with the original Sakara title
   ========================================================================== */
body.dark {
  --page-bg: #000; --box: #111; --box-line: #333; --text: #cccccc; --muted: #777777;
  --link: #99aadd; --visited: #aa77aa; --hover: #aadd99; --title: #aadd99; --rule: #333333;
  --tab-bg: #1a1a1a; --tab-line: #333;
  background: #000 radial-gradient(1px 1px at 20% 30%, #555 50%, transparent 51%) 0 0 / 120px 120px;
}
body.dark #header {
  background:
    radial-gradient(1.2px 1.2px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 70%, #cfe8ff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 58% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 76% 62%, #9be7ff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 46% 44%, #fff 50%, transparent 51%),
    radial-gradient(120% 140% at 50% 120%, #0d2140, #02060f 70%);
  background-size: 140px 90px, 170px 110px, 200px 120px, 150px 100px, 230px 130px, 110px 80px, 100% 100%;
  border-color: #22324a; padding: 30px 30px 26px; text-align: center;
}
body.dark #header::after { display: none; }
.sk-tag { display: inline-block; font: 11px var(--small); color: #8ea3c2; border: 1px solid #2b3d58; border-radius: 10px; padding: 1px 10px; position: relative; z-index: 1; }
/* the title keeps the modern site's font and colour */
.sakara-title {
  margin: 6px 0 0; font: 700 84px/1 "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -.04em;
  background: linear-gradient(180deg, #fff 30%, #9be7ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  position: relative; z-index: 1; text-shadow: none;
}
body.dark #header .description { color: #b9c7dc; margin: 6px auto 0; }
body.dark #tabs a { background: linear-gradient(#2a2a2a, #1a1a1a); color: #99aadd; }
body.dark #tabs a[aria-current="page"] { background: #111; border-bottom-color: #111; color: #fff; }
body.dark table.profile th { background: #1a1a1a; }
body.dark .profile-img { background: #222; border-color: #333; }
.roadmap li b { color: #ddd; }
@media (max-width: 760px) { .sakara-title { font-size: 64px; } }

@media (prefers-reduced-motion: reduce) {
  .new, .w-bar .marq span { animation: none !important; }
}

/* ==========================================================================
   WEIRD MODE — the blog was abandoned. Something is still here.
   ========================================================================== */
html.weird { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='18' viewBox='0 0 28 18'%3E%3Cpath d='M1 9C7 1 21 1 27 9C21 17 7 17 1 9Z' fill='%23f3ead8' stroke='%23000' stroke-width='1.5'/%3E%3Ccircle cx='14' cy='9' r='5' fill='%23b30000'/%3E%3Ccircle cx='14' cy='9' r='2.2' fill='%23000'/%3E%3C/svg%3E") 14 9, auto; }
html.weird body {
  --box: rgba(12, 6, 6, .84); --box-line: #4a2a22; --text: #d8c8b0; --muted: #8a6a5a; --title: #e01313;
  --link: #6f8dff; --visited: #b05bd6; --hover: #ff4040; --rule: #4a2a22; --tab-bg: #140808; --tab-line: #4a2a22;
  background: #050303; padding-bottom: 50px;
}
html.weird body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: url("/assets/img/weird/example.jpg") center / cover no-repeat; opacity: .16; filter: saturate(.7) contrast(1.2);
}
html.weird body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px); mix-blend-mode: multiply;
}
html.weird #outer { position: relative; z-index: 1; box-shadow: none; }
html.weird #header { background: #160707; border-color: #4a2a22; }
html.weird #header::after { display: none; }
html.weird #header h1, html.weird .post h3, html.weird .project h3, html.weird .profile-card h3 {
  color: #e01313; font-family: "Times New Roman", serif; font-weight: normal;
  text-shadow: 3px 2px 0 rgba(120, 0, 0, .55); animation: unsettle 7s steps(1) infinite;
}
html.weird #header h1 a { color: #e01313; }
html[data-lang="ja"].weird #header h1, html[data-lang="ja"].weird .post h3 { font-family: "DotGothic16", monospace; }
html.weird .sakara-title { -webkit-text-fill-color: #e01313; color: #e01313; background: none; font-family: "Times New Roman", serif; font-weight: normal; text-shadow: 4px 3px 0 rgba(120,0,0,.55); }
@keyframes unsettle { 0%, 91%, 100% { transform: none; } 92% { transform: translate(2px, -1px) skewX(-4deg); } 95% { transform: translate(-2px, 1px); } }
html.weird #tabs a { background: #1a0a0a; color: #6f8dff; text-decoration: underline; border-color: #4a2a22; }
html.weird #tabs a[aria-current="page"] { background: rgba(12,6,6,.84); color: #e01313; }
html.weird .tools button { background: #c8bba8; }
html.weird .profile-img, html.weird .project .thumb, html.weird .profile-card img { filter: grayscale(1) contrast(1.4) brightness(.75) sepia(.5); background: #111; border-color: #4a2a22; }
html.weird table.profile th { background: #1a0a0a; color: #b49a82; }
html.weird .new { background: #600; animation: none; }
html.weird .counter { color: #f33; }

/* weird layer (built by weird.js), sits behind the page */
.wl { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
html:not(.weird) .wl, html:not(.weird) .w-bar { display: none; }
.wl__floor {
  position: absolute; left: -50%; right: -50%; bottom: -10vh; height: 60vh;
  background: repeating-conic-gradient(#e8e2d6 0 25%, #0b0b0b 0 50%) 0 0 / 80px 80px;
  transform: perspective(300px) rotateX(62deg); transform-origin: 50% 100%;
  opacity: .14; mask: linear-gradient(transparent, #000 60%); -webkit-mask: linear-gradient(transparent, #000 60%);
}
.wl__yokai { position: absolute; width: clamp(110px, 16vw, 240px); filter: grayscale(1) sepia(.85) hue-rotate(-25deg) contrast(1.5) brightness(.75); opacity: 0; transition: opacity 2.5s ease; mix-blend-mode: screen; }
.wl__yokai.show { opacity: .42; }
.wl__yokai img { width: 100%; border: 1px solid #3a1a12; }
.wl__whisper { position: absolute; font-family: "DotGothic16", "Times New Roman", serif; color: #d01010; font-size: clamp(16px, 2.2vw, 30px); text-shadow: 3px 3px 0 rgba(120, 0, 0, .5); opacity: 0; transition: opacity 1.8s ease; white-space: nowrap; }
.wl__whisper.show { opacity: .8; }
.wl__eye { position: absolute; width: 54px; height: 34px; }
.wl__eye svg { width: 100%; height: 100%; overflow: visible; }
.wl__eye .pupil { transition: transform .12s linear; }
.wl__eye .lidc { transform-origin: 27px 17px; transform: scaleY(0); }
.wl__eye.blink .lidc { animation: blink .26s ease-in-out; }
@keyframes blink { 50% { transform: scaleY(1); } }
.w-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; gap: 16px; align-items: center; padding: 4px 10px; background: #c8bba8; color: #000; font: 12px Tahoma, "MS Sans Serif", sans-serif; border-top: 2px outset #efe3cf; }
.w-bar .marq { flex: 1; overflow: hidden; white-space: nowrap; }
.w-bar .marq span { display: inline-block; padding-left: 100%; animation: marq 28s linear infinite; }
@keyframes marq { to { transform: translateX(-100%); } }
.w-bar .count { font-family: "Courier New", monospace; background: #000; color: #3f3; padding: 1px 6px; letter-spacing: 2px; }
.w-bar .credit a { color: #00007a; }
.w-flash { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; pointer-events: none; background: #000; color: #e01313; font-family: "DotGothic16", "Times New Roman", serif; font-size: clamp(20px, 3.4vw, 44px); text-align: center; padding: 24px; opacity: 0; transition: opacity .35s ease; }
.w-flash.show { opacity: 1; }
.w-flash.calm { color: #333; background: #dde2e8; font-family: Georgia, serif; }
@media (max-width: 600px) { .wl__eye { width: 40px; height: 25px; } .w-bar .credit { display: none; } }
html.weird body.apache { color: #d8c8b0; background: #050303; }
body.dark .post-body h4 { color: #bbbbbb; }
