/* Design tokens for ryuyahora.jp. Every color, font and radius used by pages and islands comes from here. */
:root {
  --bg: #f6f2ea;
  --paper: #fffdf8;
  --ink: #1c211d;
  --muted: #626b62;
  --line: #d7d2c7;
  --soft: #e6ede8;
  --accent: #2c6f63;
  --accent-ink: #174e43;
  --accent-soft: #cdebd8;
  --accent-2: #8a4d34;
  --accent-2-soft: #f0ded2;
  --accent-3: #2f536f;
  --accent-3-soft: #e7edf2;
  --shadow: 0 18px 45px rgba(37, 43, 35, 0.08);
  --radius: 12px;
  --radius-sm: 7px;
  --tap: 44px;
  --font-serif: ui-serif, Georgia, "Times New Roman", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 68ch;
  --content-width: 1160px;
  /* research themes (content/themes.json ids) */
  --theme-other: #5f6b62;        --theme-other-bg: #eceee9;
  --theme-topos: #2c6f63;        --theme-topos-bg: #e7efe8;
  --theme-automata: #2f536f;     --theme-automata-bg: #e7edf2;
  --theme-games: #8a4d34;        --theme-games-bg: #f3eadc;
  --theme-coalgebras: #3f6f7a;   --theme-coalgebras-bg: #e4eef0;
  --theme-category: #574b68;     --theme-category-bg: #eee9f0;
  --theme-logic: #7a4d78;        --theme-logic-bg: #f1e8ef;
  --theme-algebra: #8a6a2f;      --theme-algebra-bg: #f3ecd9;
  --theme-geometry: #5d6f3c;     --theme-geometry-bg: #edf1e6;
  --theme-dynamical: #687b32;    --theme-dynamical-bg: #eaf0dc;
  --theme-combinatorics: #6f5d2f; --theme-combinatorics-bg: #f1ecd8;
  /* record kinds used by the timeline and the map */
  --kind-position: #574b68;
  --kind-grant: #8a6a2f;
  --kind-teaching: #2c6f63;
  --kind-education: #2f536f;
  --kind-talk: #2c6f63;
  --kind-paper: #2f536f;
  --kind-activity: #8a4d34;
  --kind-award: #b08a2e;
  color-scheme: light;
}
/* Theme utility classes: any element can say class="theme-topos" and read --theme-stroke / --theme-bg. */
.theme-other, [class*="theme-"] { --theme-stroke: var(--theme-other); --theme-bg: var(--theme-other-bg); }
.theme-topos { --theme-stroke: var(--theme-topos); --theme-bg: var(--theme-topos-bg); }
.theme-automata { --theme-stroke: var(--theme-automata); --theme-bg: var(--theme-automata-bg); }
.theme-games { --theme-stroke: var(--theme-games); --theme-bg: var(--theme-games-bg); }
.theme-coalgebras { --theme-stroke: var(--theme-coalgebras); --theme-bg: var(--theme-coalgebras-bg); }
.theme-category { --theme-stroke: var(--theme-category); --theme-bg: var(--theme-category-bg); }
.theme-logic { --theme-stroke: var(--theme-logic); --theme-bg: var(--theme-logic-bg); }
.theme-algebra { --theme-stroke: var(--theme-algebra); --theme-bg: var(--theme-algebra-bg); }
.theme-geometry { --theme-stroke: var(--theme-geometry); --theme-bg: var(--theme-geometry-bg); }
.theme-dynamical { --theme-stroke: var(--theme-dynamical); --theme-bg: var(--theme-dynamical-bg); }
.theme-combinatorics { --theme-stroke: var(--theme-combinatorics); --theme-bg: var(--theme-combinatorics-bg); }

/* ryuyahora.jp — global stylesheet. Sections: base, header, page heads, sections, hero (home), lists and entries, cards, footer, responsive, print. */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.14em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; line-height: 1.25; margin: 0; text-wrap: balance; letter-spacing: 0.005em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.8rem; }
ul, ol { margin: 0 0 0.8rem; padding-left: 1.3rem; }
code { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--font-sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2); margin: 0 0 0.5rem; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list > li { margin: 0 0 0.55rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.5rem 2.5rem; }
.two-col h3 { margin-bottom: 0.6rem; }
.more-link { font-family: var(--font-sans); font-size: 0.92rem; margin-top: 0.8rem; }
.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: var(--paper); padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); font-family: var(--font-sans); z-index: 100; }
.skip-link:focus { top: 1rem; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-brand { display: inline-flex; align-items: baseline; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.site-brand-name { font-weight: 700; font-size: 1.1rem; }
.site-brand-ja { font-size: 0.85rem; color: var(--muted); }
.site-nav { display: flex; gap: 0.2rem 0.4rem; flex-wrap: wrap; font-family: var(--font-sans); font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--ink); padding: 0.45rem 0.7rem; border-radius: 999px; min-height: 2.2rem; display: inline-flex; align-items: center; }
.site-nav a:hover { background: var(--soft); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* ---------- page heads and sections ---------- */
.site-main { max-width: var(--content-width); margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) 4rem; }
.page-head { margin: 0 0 2.5rem; }
.page-lede, .section-lede { color: var(--muted); max-width: var(--measure); margin: 0.6rem 0 0; }
.subnav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; font-family: var(--font-sans); font-size: 0.9rem; }
.subnav a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.8rem; background: var(--paper); color: var(--ink); min-height: 2rem; display: inline-flex; align-items: center; }
.subnav a:hover { border-color: var(--accent); }
.section { margin: 0 0 3.5rem; }
.section-head { margin-bottom: 1.2rem; }
.section-head h2 a.anchor, .entry-title a.anchor { color: inherit; text-decoration: none; }
.section-head h2 a.anchor:hover::after, .entry-title a.anchor:hover::after { content: " #"; color: var(--muted); font-weight: 400; }
.year-section .section-head h2 { font-size: 1.4rem; color: var(--accent-2); }

/* ---------- hero (home) ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(16rem, 0.75fr); gap: 2rem 3rem; align-items: center; margin-bottom: 2rem; }
.hero-name-ja { display: block; font-size: 0.45em; color: var(--muted); font-weight: 500; margin-top: 0.3rem; }
.contact-list { list-style: none; padding: 0; margin: 1.2rem 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.8rem; font-family: var(--font-sans); }
.contact-kind { display: block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hero-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill { display: inline-flex; align-items: center; min-height: 2.4rem; padding: 0.35rem 0.95rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); text-decoration: none; color: var(--ink); font-family: var(--font-sans); font-size: 0.95rem; }
.pill:hover { border-color: var(--accent); color: var(--accent-ink); }
.hero-photo { margin: 0; }
.hero-photo img { display: block; width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- upcoming ---------- */
.upcoming-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.upcoming-item { display: grid; grid-template-columns: 9.5rem 6.5rem 1fr; gap: 0.8rem; align-items: baseline; padding: 0.7rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.upcoming-date { font-family: var(--font-sans); font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.upcoming-kind { font-family: var(--font-sans); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2); }

/* ---------- entries (papers, talks, notes) ---------- */
.entries { display: grid; gap: 1.4rem; }
.entry { padding: 1.2rem 1.4rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 5rem; }
.entry:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.entry-title { font-size: 1.2rem; margin-bottom: 0.35rem; }
.entry-date { font-family: var(--font-sans); font-size: 0.85rem; font-weight: 700; color: var(--accent-2); margin: 0 0 0.25rem; letter-spacing: 0.03em; }
.entry-meta { font-family: var(--font-sans); font-size: 0.92rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.25rem 0; margin: 0 0 0.5rem; }
.entry-meta > span:not(:last-child)::after { content: "·"; margin: 0 0.5rem; color: var(--line); }
.entry-summary { max-width: var(--measure); }
.entry-note { font-family: var(--font-sans); font-size: 0.92rem; color: var(--muted); margin: 0.3rem 0; }
.badge { display: inline-block; font-family: var(--font-sans); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--soft); color: var(--accent-ink); vertical-align: middle; }
.badge-journal { background: var(--accent-soft); color: var(--accent-ink); }
.badge-arxiv { background: var(--accent-3-soft); color: var(--accent-3); }
.badge-draft, .badge-proceedings { background: var(--accent-2-soft); color: var(--accent-2); }
.tags { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag { font-family: var(--font-sans); font-size: 0.78rem; font-weight: 700; padding: 0.12rem 0.6rem; border-radius: 999px; border: 1px solid var(--theme-stroke); background: var(--theme-bg); color: var(--ink); }
.link-list { list-style: none; padding: 0; margin: 0.4rem 0 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-family: var(--font-sans); font-size: 0.92rem; }
.draft { display: flex; gap: 1rem; align-items: flex-start; margin: 0.5rem 0; font-family: var(--font-sans); font-size: 0.95rem; }
.draft p { margin: 0; }
.draft-thumb img { width: 7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); display: block; }
.materials { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.6rem 0; }
.material { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.4rem; padding: 0.3rem 0.8rem 0.3rem 0.3rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); text-decoration: none; font-family: var(--font-sans); font-size: 0.9rem; color: var(--ink); }
.material:not(.has-thumb) { padding-left: 0.8rem; }
.material img { width: 4.2rem; height: 2.6rem; object-fit: cover; border-radius: 4px; display: block; }
.material:hover { border-color: var(--accent); }
.paper-figure { margin: 1rem 0 0; min-height: 12rem; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.featured-figure { padding: 1.2rem 1.4rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.featured-figure-title { font-size: 1.2rem; margin-bottom: 0.4rem; }

/* ---------- cards (organizing, web apps) ---------- */
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.2rem; }
.card { padding: 1.1rem 1.3rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.card h3 { margin-bottom: 0.3rem; }
.card p:last-child { margin-bottom: 0; }
.app-cards { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.app-thumb { display: block; margin: -1.1rem -1.3rem 0.9rem; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.app-thumb img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.inline-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }

/* ---------- year records (activities) ---------- */
.record-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.record { display: grid; grid-template-columns: 11rem 6rem 1fr; gap: 0.8rem; align-items: baseline; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; }
.record-date { font-family: var(--font-sans); font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.record-kind { font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2); }
.record-talk .record-kind { color: var(--accent); }

/* ---------- footer ---------- */
.site-footer { max-width: var(--content-width); margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 3rem; border-top: 1px solid var(--line); font-family: var(--font-sans); font-size: 0.9rem; color: var(--muted); }
.site-footer p { margin: 0 0 0.3rem; }
.button { font: inherit; font-family: var(--font-sans); min-height: var(--tap); padding: 0.5rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.button:hover { border-color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { order: -1; max-width: 22rem; }
  .upcoming-item, .record { grid-template-columns: 1fr; gap: 0.15rem; }
  .upcoming-kind, .record-kind { order: -1; }
}
@media (max-width: 640px) {
  .site-header { position: static; padding: 0.6rem 1rem; gap: 0.4rem; }
  .site-nav { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 0.4rem 0.6rem; white-space: nowrap; }
}
@media (max-width: 520px) {
  body { font-size: 1rem; }
  .entry { padding: 1rem; }
  .draft { flex-direction: column; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .skip-link, .subnav, .island, .paper-figure { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
  .entry, .card { border: 0; padding: 0 0 0.6rem; break-inside: avoid; }
}
