/* Display lettering: Lobster script for the neon sign */
@import url("https://fonts.googleapis.com/css2?family=Lobster&display=swap");

/* kyousuke.me — neon sunset, palm-lined after-hours */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #100d22;
  --bg-deep: #090817;
  --card: rgba(25, 20, 47, 0.88);
  --card-hover: rgba(35, 24, 58, 0.96);
  --text: #fff3e9;
  --muted: #c7b5c8;
  --faint: #9987aa;
  --line: rgba(237, 165, 255, 0.2);
  --link: #ff91bd;
  --link-hover: #ffc0d6;
  --accent: #ff69a8;
  --cyan: #70eaff;
  --gold: #ffc46b;
  --footer: #9b89a8;
  --toc-bg: rgba(13, 14, 38, 0.82);
  --hero-wash: #472653;
  --font-display: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "PingFang SC", sans-serif;
  --font-label: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 20px 55px rgba(5, 3, 20, 0.38), 0 0 30px rgba(255, 80, 162, 0.08);
  --glow: 0 0 24px rgba(255, 97, 169, 0.2);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #fff1e8;
  --bg-deep: #f5d5d4;
  --card: rgba(255, 250, 246, 0.9);
  --card-hover: #fff;
  --text: #281931;
  --muted: #665168;
  --faint: #866c83;
  --line: rgba(134, 73, 124, 0.22);
  --link: #bd3f78;
  --link-hover: #8d285d;
  --accent: #c83b82;
  --cyan: #167e9a;
  --gold: #a85c25;
  --footer: #866c83;
  --toc-bg: rgba(255, 235, 232, 0.9);
  --hero-wash: #e9a4a4;
  --shadow: 0 16px 45px rgba(105, 44, 87, 0.12), 0 0 26px rgba(208, 68, 132, 0.08);
  --glow: 0 0 22px rgba(200, 59, 130, 0.13);
}
* { box-sizing: border-box; }
html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 84% 4%, rgba(255, 87, 155, 0.2), transparent 27rem),
    radial-gradient(ellipse at 15% 20%, rgba(83, 75, 193, 0.2), transparent 34rem),
    linear-gradient(155deg, var(--bg-deep) 0%, var(--bg) 42%, #17102c 100%);
  font: 17px/1.72 var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
html[data-theme="light"] body {
  background:
    radial-gradient(ellipse at 88% 0%, rgba(255, 137, 128, 0.35), transparent 30rem),
    radial-gradient(ellipse at 8% 20%, rgba(184, 142, 224, 0.2), transparent 32rem),
    linear-gradient(150deg, #fff5eb, var(--bg) 55%, #f1d9e8);
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, transform 160ms ease; }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.skip {
  position: absolute;
  z-index: 20;
  top: 10px;
  left: -999px;
  padding: 9px 14px;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}
.skip:focus { left: 10px; }
.progress {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--accent), var(--gold));
  box-shadow: 0 0 14px var(--accent);
  pointer-events: none;
}
.topbar {
  display: none;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  background: rgba(13, 10, 29, 0.86);
  backdrop-filter: blur(16px);
}
html[data-theme="light"] .topbar { background: rgba(255, 246, 241, 0.88); }
.brand {
  display: inline-block;
  color: #fff0ff;
  font-family: "Lobster", "Brush Script MT", cursive;
  font-size: 2rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.015em;
  line-height: 1.05;
  text-transform: none;
  text-decoration: none;
  transform: skewX(-5deg);
  -webkit-text-stroke: 0.7px #d8a2ff;
  text-shadow:
    2px 2px 0 #51207f,
    4px 4px 0 #351052,
    0 0 3px #fff,
    0 0 8px #d88cff,
    0 0 18px #a83cff,
    0 0 32px rgba(168, 60, 255, 0.75);
  animation: vice-sign-flicker 4.8s steps(1, end) infinite;
  transition: color 180ms ease, text-shadow 180ms ease, transform 180ms ease;
}
.brand:hover {
  color: #fff;
  transform: skewX(-5deg) translateY(-1px);
  text-shadow:
    2px 2px 0 #51207f,
    4px 4px 0 #351052,
    0 0 4px #fff,
    0 0 12px #e8c0ff,
    0 0 25px #bd66ff,
    0 0 42px rgba(189, 102, 255, 0.95);
  animation: none;
}
@keyframes vice-sign-flicker {
  0%, 18%, 20%, 62%, 64%, 100% { opacity: 1; }
  19%, 63% { opacity: 0.72; }
  72% { opacity: 0.94; }
  74% { opacity: 0.64; }
  76%, 98% { opacity: 1; }
}
.menu-btn, .theme-btn {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: 600 0.76rem/1 var(--font-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.menu-btn:hover, .theme-btn:hover { border-color: var(--accent); color: var(--text); box-shadow: var(--glow); }
.wrap {
  position: relative;
  width: min(1140px, 100%);
  margin: 0 auto;
  padding: 58px 32px 54px;
  display: grid;
  grid-template-columns: 190px minmax(0, 760px);
  gap: clamp(42px, 7vw, 92px);
  align-items: start;
  justify-content: center;
}
#sidebar { position: sticky; top: 34px; }
.desk-brand { display: inline-block; margin: 0 0 8px; }
#sidebar nav {
  margin-top: 28px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}
.nav-label, .toc-label {
  margin: 0 0 13px;
  color: var(--cyan);
  font: 600 0.66rem/1.4 var(--font-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
#sidebar nav a {
  position: relative;
  display: block;
  margin: 3px 0 3px -13px;
  padding: 7px 10px 7px 13px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
}
#sidebar nav a:hover { color: var(--text); border-left-color: var(--cyan); }
#sidebar nav a[aria-current="page"] {
  border-left-color: var(--accent);
  color: var(--text);
  background: linear-gradient(90deg, rgba(255, 105, 168, 0.12), transparent);
  text-shadow: 0 0 16px rgba(255, 105, 168, 0.28);
}
.theme-row { margin: 28px 0 0; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: pretty;
}
h1 {
  margin: 0.1em 0 0.45em;
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  text-shadow: 0 0 30px rgba(255, 105, 168, 0.18);
}
h2 { margin: 1.75em 0 0.5em; font-size: clamp(1.65rem, 3vw, 2.2rem); }
h2[id] { scroll-margin-top: 24px; }
.list-heading { margin: 0 0 18px; font-size: 1.9rem; }
.hero {
  position: relative;
  isolation: isolate;
  margin: 0 0 1.75rem;
  overflow: hidden;
  border: 1px solid rgba(255, 184, 205, 0.36);
  border-radius: 5px;
  background: var(--hero-wash);
  box-shadow: var(--shadow), 0 0 34px rgba(255, 92, 160, 0.13);
}
.hero::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  content: "";
  pointer-events: none;
}
.hero::after {
  position: absolute;
  z-index: 1;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(13, 9, 30, 0.35));
  content: "";
  pointer-events: none;
}
.hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  vertical-align: middle;
  filter: saturate(1.18) contrast(1.04);
}
html[data-theme="light"] .hero img { filter: saturate(1.08); }
.intro {
  max-width: 39em;
  margin: 0 0 2.3rem;
  color: var(--muted);
  font-size: 1.12em;
  line-height: 1.8;
}
.meta { display: flex; flex-wrap: wrap; gap: 11px; align-items: baseline; margin: 0 0 8px; color: var(--faint); font-size: 0.8rem; }
.date { color: var(--faint); font: 600 0.74rem/1.5 var(--font-label); letter-spacing: 0.08em; }
.cat { color: var(--cyan); font: 600 0.68rem/1.5 var(--font-label); letter-spacing: 0.17em; text-transform: uppercase; }
ul.posts { display: grid; gap: 13px; list-style: none; padding: 0; margin: 0; }
ul.posts li {
  position: relative;
  padding: 20px 23px 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--card);
  box-shadow: 0 8px 26px rgba(4, 3, 18, 0.12);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}
ul.posts li::before { position: absolute; inset: 0 auto 0 0; width: 2px; background: linear-gradient(var(--cyan), var(--accent), var(--gold)); content: ""; opacity: 0.65; }
ul.posts li:hover { transform: translateY(-2px); border-color: rgba(255, 145, 189, 0.48); background: var(--card-hover); box-shadow: var(--shadow), var(--glow); }
ul.posts li .date { display: inline; font-size: 0.72rem; }
ul.posts a { color: var(--text); font-family: var(--font-display); font-size: clamp(1.45rem, 3vw, 1.8rem); font-weight: 600; line-height: 1.2; text-decoration: none; }
ul.posts a:hover { color: var(--link); }
.dek { margin: 7px 0 0; color: var(--muted); font-size: 0.94em; line-height: 1.6; }
.empty { color: var(--muted); }
.page-head, .post-head { margin: 0 0 1.35rem; }
.post-head .date { margin: 0; }
article.post { max-width: 44em; }
article.post > p { margin: 1.05em 0; }
article.post strong { color: var(--gold); font-weight: 600; }
article.post h2 { padding-top: 0.28em; border-top: 1px solid var(--line); }

figure.post-photo {
  margin: 1.75em 0 2em;
  overflow: hidden;
  border: 1px solid rgba(255, 184, 205, 0.36);
  border-radius: 5px;
  background: var(--hero-wash);
  box-shadow: var(--shadow), 0 0 34px rgba(255, 92, 160, 0.13);
}
figure.post-photo img {
  display: block;
  width: 100%;
  height: auto;
}
figure.post-photo figcaption {
  margin: 0;
  padding: 0.7em 1.05em 0.9em;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.86em;
  font-style: italic;
  line-height: 1.5;
}
.toc {
  margin: 1.5em 0 2em;
  padding: 17px 21px 19px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan);
  border-radius: 4px;
  background: var(--toc-bg);
  box-shadow: inset 0 0 26px rgba(105, 86, 205, 0.08);
}
.toc-label { margin-bottom: 9px; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { margin: 0.23em 0; color: var(--faint); }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc a[aria-current="true"] { color: var(--text); font-weight: 600; }
footer { margin-top: 54px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--footer); font-size: 0.78rem; letter-spacing: 0.035em; }
@media (max-width: 800px) {
  .topbar { display: flex; }
  .desk-brand { display: none; }
  #sidebar nav { margin-top: 0; padding-top: 0; border-top: 0; }
  .wrap { display: block; padding: 24px 20px 38px; }
  #sidebar { display: none; position: static; margin: 0 0 25px; padding: 0 0 18px; border-bottom: 1px solid var(--line); }
  body.menu-open #sidebar { display: block; }
  .theme-row { margin-top: 14px; }
  h1 { font-size: clamp(2.35rem, 11vw, 3.5rem); }
  ul.posts li { padding: 17px 17px 16px; }
  .hero { margin-bottom: 1.4rem; }
}
@media (max-width: 440px) {
  body { font-size: 16px; }
  .topbar { padding-inline: 16px; }
  .wrap { padding-inline: 16px; }
  ul.posts a { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .brand { animation: none; }
  .progress { display: none; }
}

.post-head .date .views {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}
