/*
  Prism — tegalog skin
  Based on template 007 by instan <https://instan.fc2.page>
*/

/* ===== カラー・フォントの設定（ここを変えると全体の見た目が変わります） ===== */
:root {
  color-scheme: light dark;

  --c1: #ff5fa2;
  --c2: #7b5cff;
  --c3: #37d4e8;

  --color-bg: #faf8ff;
  --color-card: #ffffff;
  --color-text: #1a1530;
  --color-muted: #6b6488;
  --color-faint: #a9a3c2;
  --color-line: #e7e3f3;

  --font-en: "Outfit", sans-serif;
  --font-ja: "Zen Maru Gothic", sans-serif;
  --font-body: var(--font-en), var(--font-ja);

  --content-width: 760px;
  --header-height: 56px;
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c1: #ff7ab3;
    --c2: #9a82ff;
    --c3: #5ce0f0;

    --color-bg: #0c0a18;
    --color-card: #15122a;
    --color-text: #ece8fb;
    --color-muted: #9b94bd;
    --color-faint: #5b5480;
    --color-line: #26203f;
  }
}

@property --header-bg-alpha {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

/* ===== 文字まわりの基本設定 ===== */
html {
  font-feature-settings:
    "palt" 1,
    "pkna" 1;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: color-mix(in oklab, var(--c2) 30%, transparent);
}

a {
  color: inherit;
  text-decoration: none;
}

main a:not(.nav-toggle, .site-name, .drawer-close, .timeline-permalink) {
  background-image: linear-gradient(var(--c2), var(--c2));
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 1px;
  transition: background-size 0.2s;
}

main a:not(.nav-toggle, .site-name, .drawer-close, .timeline-permalink):hover {
  background-image: linear-gradient(100deg, var(--c1), var(--c3));
  background-size: 100% 2px;
}

:focus-visible {
  outline: 2px solid var(--c2);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.4;
  text-wrap: balance;
}

h1 {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  margin: 2.5rem 0 1.5rem;
  padding-bottom: 0.6rem;
  letter-spacing: 0.01em;
  border-bottom: 3px solid;
  border-image: linear-gradient(100deg, var(--c1), var(--c2) 50%, var(--c3)) 1;
}

h2 {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 1.55rem;
  margin: 2.5rem 0 1rem;
  letter-spacing: 0.01em;
}

h3 {
  font-family: var(--font-ja);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 2rem 0 0.85rem;
  padding-left: 0.7rem;
  border-left: 4px solid var(--c1);
}

h4 {
  font-size: 1.05rem;
  font-weight: 500;
  margin: 1.75rem 0 0.6rem;
  color: var(--color-text);
}

h5 {
  font-family: var(--font-en);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c2);
}

h6 {
  font-family: var(--font-en);
  font-size: 0.78rem;
  font-weight: 600;
  margin: 1.25rem 0 0.4rem;
  color: var(--color-faint);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

p + p {
  margin-top: 1em;
}

/* ===== 強調 / 引用 / 区切り / コード ===== */
em {
  font-style: normal;
  font-weight: 500;
  color: var(--c2);
}

strong {
  font-weight: 700;
  color: var(--color-text);
  background-image: linear-gradient(
    transparent 60%,
    color-mix(in oklab, var(--c1) 35%, transparent) 60%
  );
}

mark {
  background: transparent;
  color: var(--color-text);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  background-image: linear-gradient(
    100deg,
    color-mix(in oklab, var(--c3) 38%, transparent),
    color-mix(in oklab, var(--c2) 30%, transparent)
  );
}

blockquote {
  margin: 1.5em 0;
  padding: 0.75em 1.25em;
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: 4px solid var(--c3);
  background: color-mix(in oklab, var(--c3) 8%, transparent);
  color: var(--color-muted);
}

ul {
  margin: 1em 0;
  padding-left: 1.6em;
  list-style: none;
}

ul > li {
  position: relative;
}

ul > li::before {
  content: "";
  position: absolute;
  left: -1.2em;
  top: 0.75em;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--c1), var(--c2));
}

ol {
  margin: 1em 0;
  padding-left: 1.75em;
  list-style: decimal;
}

ol::marker {
  color: var(--c2);
}

dl {
  margin: 1em 0;
}

dt {
  font-weight: 700;
  margin-top: 0.75em;
  color: var(--c2);
}

dd {
  margin-left: 1.5em;
}

table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.55em 0.85em;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
}

th {
  font-weight: 700;
  color: var(--c2);
  border-bottom: 2px solid color-mix(in oklab, var(--c2) 40%, var(--color-line));
}

hr {
  border: 0;
  height: 2px;
  border-radius: 2px;
  margin: 2em 0;
  background: linear-gradient(100deg, var(--c1), var(--c2) 50%, var(--c3));
  opacity: 0.6;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: color-mix(in oklab, var(--c2) 12%, transparent);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

pre {
  margin: 1.5em 0;
  padding: 1em;
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

pre code {
  background: transparent;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== 画面上部の固定ヘッダー ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-height);
  border-bottom: 1px solid transparent;
  background: color-mix(in oklab, var(--color-bg) calc(var(--header-bg-alpha) * 88%), transparent);
  backdrop-filter: blur(8px);
}

@supports (animation-timeline: scroll()) {
  .site-header {
    animation: header-solidify linear both;
    animation-timeline: scroll(root);
    animation-range: 0 80px;
  }

  @keyframes header-solidify {
    from {
      --header-bg-alpha: 0;
      border-bottom-color: transparent;
    }
    to {
      --header-bg-alpha: 1;
      border-bottom-color: var(--color-line);
    }
  }
}

.site-header.scrolled {
  --header-bg-alpha: 1;
  border-bottom-color: var(--color-line);
}

.site-header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-name {
  font-family: var(--font-en);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
  background: linear-gradient(100deg, var(--c1), var(--c2) 55%, var(--c3));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--c2);
}

/* ===== ナビゲーション ===== */
.drawer {
  --drawer-width: min(20rem, 80dvw);
  position: fixed;
  inset: 0 0 0 auto;
  width: var(--drawer-width);
  height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--color-card);
  border-left: 1px solid var(--color-line);
  box-shadow: -8px 0 32px -12px color-mix(in oklab, var(--c2) 40%, transparent);
  color: var(--color-text);
  overflow: hidden;
  transform: translateX(105%);
  transition:
    transform 0.28s cubic-bezier(0.3, 0.7, 0.3, 1),
    display 0.28s allow-discrete,
    overlay 0.28s allow-discrete;
}

.drawer:popover-open {
  transform: translateX(0);
}

@starting-style {
  .drawer:popover-open {
    transform: translateX(105%);
  }
}

.drawer::backdrop {
  background: color-mix(in oklab, var(--c2) 35%, rgba(8, 6, 20, 0.6));
  opacity: 0;
  transition:
    opacity 0.28s ease,
    display 0.28s allow-discrete,
    overlay 0.28s allow-discrete;
}

.drawer:popover-open::backdrop {
  opacity: 1;
}

@starting-style {
  .drawer:popover-open::backdrop {
    opacity: 0;
  }
}

.site-nav {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav ul {
  padding: 4rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
}

.site-nav li::before {
  content: none;
}

.site-nav a {
  display: block;
  padding: 0.9rem 0.5rem;
  font-family: var(--font-en);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-line);
  letter-spacing: 0.005em;
}

.site-nav a[aria-current] {
  color: var(--c2);
}

.site-nav a:hover {
  color: var(--c1);
}

.drawer-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: var(--color-card);
  color: var(--color-text);
  font-size: 16px;
  cursor: pointer;
  touch-action: manipulation;
  z-index: 1;
}

.drawer-close:hover {
  border-color: var(--c1);
  color: var(--c1);
}

.nav-toggle {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--color-text);
  touch-action: manipulation;
}

.nav-toggle:hover {
  background: color-mix(in oklab, var(--c2) 12%, transparent);
}

@media (min-width: 768px) {
  .drawer {
    display: contents;
  }

  .site-nav {
    display: block;
    height: auto;
    overflow: visible;
  }

  .site-nav ul {
    flex-direction: row;
    gap: 1.5rem;
    padding: 0;
  }

  .site-nav a {
    display: inline;
    padding: 0;
    border-bottom: 0;
    font-size: 0.95rem;
    color: var(--color-muted);
  }

  .site-nav a[aria-current] {
    color: var(--c2);
  }

  .drawer-close,
  .nav-toggle {
    display: none;
  }
}

/* ===== 本文エリア ===== */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}

.page-title {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 2.6rem);
  text-align: center;
  margin: 0 0 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 0;
  letter-spacing: 0.01em;
  position: relative;
}

.page-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  border-radius: 4px;
  margin: 1rem auto 0;
  background: linear-gradient(100deg, var(--c1), var(--c2) 50%, var(--c3));
}

.situation {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* ===== つぶやきタイムライン ===== */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-item {
  padding: 1.5rem 1.5rem 1.6rem;
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.timeline-item::before {
  content: none;
}

.timeline-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-en);
  font-size: 0.8rem;
}

.timeline-time {
  font-weight: 500;
  color: var(--c2);
}

.timeline-permalink {
  color: var(--color-faint);
  font-weight: 500;
  font-size: 0.75rem;
}

.timeline-permalink:hover {
  color: var(--c1);
}

.timeline-body {
  line-height: 1.9;
}

.timeline-body p {
  margin: 0 0 0.75em;
  text-wrap: pretty;
}

.timeline-body p:last-child {
  margin-bottom: 0;
}

.timeline-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.75rem 0;
  border: 1px solid var(--color-line);
  border-radius: 12px;
}

.timeline-categories {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.timeline-categories a {
  color: var(--c2);
}

.timeline-categories a:hover {
  color: var(--c1);
}

/* ===== ページング ===== */
.navi {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-family: var(--font-en);
  font-size: 0.9rem;
}

.navi a {
  color: var(--c2);
  font-weight: 600;
}

.navi a:hover {
  color: var(--c1);
}

/* ===== 「まだありません」表示 ===== */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  font-family: var(--font-en);
  font-weight: 500;
  color: var(--color-muted);
  border: 1px dashed var(--color-line);
  border-radius: var(--radius);
}

footer {
  text-align: center;
  font-size: .75rem;
}