/* のりブログ - static site styles
   ------------------------------------------------------------------------
   Direction: Japanese editorial. 藍(indigo) ink on warm paper, Mincho for the
   site's own voice (hero, headings, section labels), Gothic for anything the
   reader scans (navigation, cards, body). The recurring 2px indigo "index
   mark" ties the hero rule, section titles and article h2s together.
   System fonts only - no webfont requests. No JavaScript. */

:root {
  /* palette */
  --ink: #16202e;          /* 墨 - body text */
  --ink-soft: #3c4859;
  --muted: #6d7683;
  --indigo: #23446f;       /* 藍 - links, marks, primary */
  --indigo-deep: #16304f;  /* footer ground */
  --asagi: #4e8a95;        /* 浅葱 - secondary accent */
  --paper: #faf9f6;
  --surface: #fff;
  --surface-alt: #f6f5f1;
  --line: #e3e0d8;
  --line-soft: #efece5;

  /* type */
  --font-display: "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Yu Mincho",
                  YuMincho, "Noto Serif JP", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "Noto Sans JP",
               Meiryo, Arial, sans-serif;
  --font-util: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --max: 48rem;   /* article measure: ~72 latin / ~42 japanese chars per line */
  --wide: 68rem;
  --gutter: clamp(1rem, 4vw, 1.5rem);
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.9;
  font-feature-settings: "palt" 1;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { color: var(--indigo-deep); }

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--indigo-deep);
  color: #fff;
  padding: .6rem 1rem;
  font-size: .85rem;
}
.skip-link:focus { left: 0; color: #fff; }

/* The signature mark: a 2px indigo tick that opens every label on the site. */
.mark {
  display: inline-block;
  width: 14px;
  height: 2px;
  margin-right: .6rem;
  vertical-align: middle;
  background: var(--indigo);
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}

.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 60px;
}

.brand { display: flex; align-items: baseline; gap: .7rem; color: var(--ink); }
.brand:hover { color: var(--indigo); }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 600;
  letter-spacing: .06em;
}
.brand-sub {
  font-family: var(--font-util);
  font-size: .62rem;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: .2rem;
}
.site-nav a {
  display: block;
  padding: .45rem .7rem;
  font-size: .82rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--indigo); }
.site-nav a[aria-current="page"] { color: var(--indigo); border-bottom-color: var(--indigo); }

/* ------------------------------------------------------------------ layout */

main { display: block; flex: 1 0 auto; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container.wide { max-width: var(--wide); }

/* -------------------------------------------------------------------- hero */

.hero {
  background: linear-gradient(168deg, #eef1f5 0%, var(--paper) 72%);
  border-bottom: 1px solid var(--line);
  padding: clamp(2.6rem, 7vw, 4.6rem) 0 clamp(2.4rem, 6vw, 4rem);
  margin-bottom: clamp(2.2rem, 5vw, 3.4rem);
}
.hero-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.4rem, 4vw, 2.8rem);
  align-items: start;
}

/* 縦書き: the tagline runs vertically alongside the title, print-style. */
.hero-vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  position: relative;
  margin: .35rem 0 0;
  padding: 1.9rem .9rem 0 0;
  border-right: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: .82rem;
  letter-spacing: .34em;
  color: var(--muted);
  min-height: 11rem;
}
.hero-vertical::before {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 2px;
  height: 1.5rem;
  background: var(--indigo);
}

.hero-eyebrow { display: none; }

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6.5vw, 3.3rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .08em;
  color: var(--ink);
}
.hero-lead {
  margin: 1.1rem 0 0;
  max-width: 34em;
  font-size: .95rem;
  line-height: 2;
  color: var(--ink-soft);
}
.hero-by {
  margin: 1.4rem 0 0;
  font-family: var(--font-util);
  font-size: .66rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------- section titles */

.section-title,
.archive-header h1 {
  display: flex;
  align-items: center;
  margin: 0 0 1.4rem;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: .1em;
}
.section-count {
  margin-left: .7rem;
  font-family: var(--font-util);
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--muted);
}

.archive-header { margin: 2.2rem 0 1.6rem; }
.archive-header h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); }
.archive-eyebrow {
  margin: 0 0 .5rem;
  font-family: var(--font-util);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------- category */

.cat {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .1rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .68rem;
  letter-spacing: .06em;
  line-height: 1.9;
  color: var(--ink-soft);
  white-space: nowrap;
}
a.cat:hover { border-color: var(--indigo); color: var(--indigo); }
.cat-dot { width: 6px; height: 6px; background: var(--muted); flex: none; }
.cat--writing .cat-dot { background: var(--indigo); }
.cat--life .cat-dot { background: var(--asagi); }
.cat--crypto .cat-dot { background: #a8802c; }
.cat--profile .cat-dot { background: #7a6b9b; }

/* ------------------------------------------------------------- card grid */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: clamp(1.1rem, 2.4vw, 1.6rem);
  margin-bottom: clamp(3rem, 7vw, 4.5rem);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #d3cec2;
  box-shadow: 0 12px 28px -18px rgba(22, 48, 79, .45);
}

.card-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line-soft);
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s ease;
}
.card:hover .card-thumb img { transform: scale(1.035); }
.thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: var(--font-display);
  letter-spacing: .2em;
  color: #b9b4a8;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.1rem 1.15rem 1.3rem;
}
.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 .55rem;
  font-family: var(--font-util);
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--muted);
}
.card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.65;
  letter-spacing: .01em;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--indigo); }
.card-excerpt {
  margin: .6rem 0 0;
  font-size: .82rem;
  line-height: 1.85;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* ------------------------------------------------------------- breadcrumb */

.breadcrumb { margin: 1.6rem 0 .4rem; }
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .1rem .45rem;
  margin: 0;
  padding: 0;
  font-size: .72rem;
  color: var(--muted);
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: .45rem;
  color: #c2bdb1;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--indigo); }
.breadcrumb [aria-current="page"] {
  display: inline-block;
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------- article head */

.post-header { margin: 1.4rem 0 1.8rem; }
.post-header .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 0 0 .8rem;
  font-family: var(--font-util);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--muted);
}
.post-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.4vw, 2.3rem);
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: .03em;
  color: var(--ink);
}

.featured { margin: 1.8rem 0 0; }
/* Tall artwork is capped by height rather than cropped, so charts stay whole. */
.featured img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 26rem;
  width: auto;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* --------------------------------------------------------------------- toc */

.toc {
  margin: 2.2rem 0 2.6rem;
  padding: 0 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toc summary {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 0;
  cursor: pointer;
  list-style: none;
}
.toc summary::-webkit-details-marker { display: none; }
.toc-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .14em;
}
.toc-title::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  margin-right: .6rem;
  vertical-align: middle;
  background: var(--indigo);
}
.toc-hint {
  margin-left: auto;
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--muted);
}
.toc-hint::after { content: "開く"; }
.toc[open] .toc-hint::after { content: "閉じる"; }
.toc summary:hover .toc-hint { color: var(--indigo); }

.toc ol {
  counter-reset: toc;
  list-style: none;
  margin: 0;
  padding: .3rem 0 1.1rem;
  border-top: 1px solid var(--line-soft);
}
.toc li { counter-increment: toc; margin: .1rem 0; }
.toc li a {
  display: flex;
  gap: .7rem;
  padding: .35rem 0;
  font-size: .88rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.toc li a::before {
  content: counter(toc, decimal-leading-zero);
  flex: none;
  font-family: var(--font-util);
  font-size: .72rem;
  color: var(--asagi);
}
.toc li a:hover { color: var(--indigo); }

/* ----------------------------------------------------------- article body */

.post-body {
  padding-bottom: 1.5rem;
  font-size: 1.0625rem;
  line-height: 1.98;
  overflow-wrap: break-word;
}

.post-body h2 {
  position: relative;
  margin: 3.2rem 0 1.2rem;
  padding: .1rem 0 .1rem 1.05rem;
  border-left: 2px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.4vw, 1.6rem);
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .03em;
  scroll-margin-top: 5rem;
}
.post-body h2::before {
  content: "";
  position: absolute;
  left: -2px;
  top: .35em;
  width: 2px;
  height: 1.2em;
  background: var(--indigo);
}
.post-body h3 {
  margin: 2.6rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.7;
  scroll-margin-top: 5rem;
}
.post-body h4 {
  margin: 2.1rem 0 .8rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.7;
  color: var(--indigo-deep);
}
.post-body p { margin: 0 0 1.6em; }
.post-body ul, .post-body ol { margin: 0 0 1.7em; padding-left: 1.4em; }
.post-body li { margin-bottom: .45em; }
.post-body li::marker { color: var(--asagi); }

.post-body a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(35, 68, 111, .32);
  text-underline-offset: .18em;
}
.post-body a:hover { text-decoration-color: currentColor; }

.post-body blockquote {
  margin: 0 0 1.7em;
  padding: .9rem 1.2rem;
  border-left: 3px solid var(--asagi);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-alt);
  color: var(--ink-soft);
  font-size: .96em;
}
.post-body blockquote p:last-child { margin-bottom: 0; }

.post-body table {
  width: 100%;
  margin-bottom: 1.7em;
  border-collapse: collapse;
  font-size: .9rem;
  background: var(--surface);
}
.post-body th, .post-body td {
  border: 1px solid var(--line);
  padding: .6rem .75rem;
  line-height: 1.8;
}
.post-body th { background: var(--surface-alt); font-weight: 600; text-align: left; }
.post-body iframe { max-width: 100%; }
.post-body .table-responsive { overflow-x: auto; margin-bottom: 1.7em; }
.post-body .table-responsive table { margin-bottom: 0; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.6rem 0; }
.post-body code {
  padding: .1em .35em;
  background: var(--surface-alt);
  border-radius: 2px;
  font-family: var(--font-util);
  font-size: .88em;
}

/* Marker pen carried over from the old theme. */
.keiko_yellow { background: linear-gradient(transparent 62%, #ffe9a3 62%); }

/* Portfolio cards (imported markup - keep the class names). */
.article_box {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  padding: 1.1rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.article_box .col-xs-12.col-sm-4 { flex: 0 0 10rem; }
.article_box .col-xs-12.col-sm-8 { flex: 1; }
.article_box h3 {
  margin: 0 0 .4rem;
  padding: 0;
  border: none;
  font-size: .98rem;
  line-height: 1.7;
}
.article_box p { margin: 0; font-size: .85rem; line-height: 1.8; color: var(--muted); }
.article_box img { width: 100%; display: block; border-radius: 2px; }

/* -------------------------------------------------------- prev/next links */

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2.4rem 0 clamp(3rem, 7vw, 4.5rem);
}
.post-nav-item {
  display: block;
  padding: .95rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s ease, transform .2s ease;
}
.post-nav-item:hover { border-color: var(--indigo); transform: translateY(-2px); }
.post-nav-item.next { text-align: right; }
.post-nav-label {
  display: block;
  margin-bottom: .3rem;
  font-family: var(--font-util);
  font-size: .66rem;
  letter-spacing: .1em;
  color: var(--muted);
}
.post-nav-item.prev .post-nav-label::before { content: "\2190\00a0"; }
.post-nav-item.next .post-nav-label::after { content: "\00a0\2192"; }
.post-nav-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: .86rem;
  line-height: 1.7;
  color: var(--ink);
}

/* ------------------------------------------------------------------- 404 */

.notfound { padding: clamp(3rem, 9vw, 5rem) var(--gutter); text-align: center; }
.notfound h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: .04em;
}
.notfound .hero-eyebrow {
  display: block;
  font-family: var(--font-util);
  font-size: .7rem;
  letter-spacing: .2em;
  color: var(--muted);
}
.button {
  display: inline-block;
  margin-top: .6rem;
  padding: .65rem 1.6rem;
  background: var(--indigo);
  color: #fff;
  border-radius: var(--radius);
  font-size: .88rem;
  letter-spacing: .06em;
}
.button:hover { background: var(--indigo-deep); color: #fff; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  margin-top: auto;
  background: var(--indigo-deep);
  color: #c7d2e0;
}
.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(2.2rem, 5vw, 3rem) var(--gutter) 1.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
}
.footer-brand { margin: 0; }
.footer-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: #fff;
}
.footer-tagline {
  display: block;
  margin-top: .3rem;
  font-size: .74rem;
  letter-spacing: .14em;
  color: #9fb0c4;
}
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.6rem;
  font-size: .82rem;
}
.footer-links a { color: #d8e2ee; }
.footer-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: .2em; }
.copyright {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter) 1.8rem;
  font-family: var(--font-util);
  font-size: .68rem;
  letter-spacing: .06em;
  color: #8195ad;
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 780px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: .55rem;
  }
  .brand { justify-content: center; }
  .site-nav {
    margin: 0 calc(var(--gutter) * -1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { padding: 0 var(--gutter) .35rem; gap: .1rem; }
  .site-nav a { white-space: nowrap; padding: .35rem .6rem; }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-vertical { display: none; }
  .hero-eyebrow {
    display: block;
    margin: 0 0 .8rem;
    font-size: .76rem;
    letter-spacing: .18em;
    color: var(--muted);
  }

  .post-body h2 { scroll-margin-top: 7rem; }
  .post-body h3 { scroll-margin-top: 7rem; }

  .post-nav { grid-template-columns: 1fr; }
  .post-nav-item.next { text-align: left; }

  .article_box { display: block; }
  .article_box .col-xs-12.col-sm-4 { margin-bottom: .8rem; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .card-grid { grid-template-columns: 1fr; }
  .breadcrumb [aria-current="page"] { max-width: 12rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .card:hover, .post-nav-item:hover { transform: none; }
}
