/* DailyBenkyo — shared styles
   Palette + motifs drawn from traditional Japanese design:
   - 藍色 ai-iro (indigo), 朱色 shu-iro (vermillion), 生成り kinari (unbleached cream)
   - 青海波 seigaiha (overlapping wave arcs) and 麻の葉 asanoha (hemp-leaf lattice) —
     both are centuries-old geometric motifs (nobody's property), redrawn here from
     scratch as plain SVG/CSS, not traced or copied from any existing artwork or font.
*/

@import url('https://fonts.googleapis.com/css2?family=Zen+Old+Mincho:wght@500;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --paper: #f6f0e2;
  --paper-raised: #fffdf8;
  --ink: #262019;
  --ink-soft: #5a5142;
  --line: #e2d6ba;
  --accent: #c1442c;       /* shu-iro — vermillion */
  --accent-soft: #f1ddce;
  --indigo: #1f3b57;       /* ai-iro — indigo */
  --indigo-soft: #2c4e6e;
  --indigo-mist: rgba(31, 59, 87, 0.07);
  --serif: 'Zen Old Mincho', 'Hiragino Mincho ProN', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 10px;
  --max-w: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1712;
    --paper-raised: #221e17;
    --ink: #efe6d4;
    --ink-soft: #b7a98d;
    --line: #3a3223;
    --accent: #e0715a;
    --accent-soft: #33221b;
    --indigo: #7fa8cc;
    --indigo-soft: #3a5876;
    --indigo-mist: rgba(127, 168, 204, 0.09);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(var(--indigo-mist) 1px, transparent 1px),
    var(--paper);
  background-size: 18px 18px, auto;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Seigaiha wave band — hand-drawn overlapping arcs, used as a thin
   decorative strip. Pure geometry, no external asset. */
.wave-band {
  height: 14px;
  background-color: var(--indigo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='28' viewBox='0 0 56 28'%3E%3Cg fill='none' stroke='%23f6f0e2' stroke-width='1.6' opacity='0.55'%3E%3Cpath d='M-4 28 A18 18 0 0 1 14 10 A18 18 0 0 1 32 28'/%3E%3Cpath d='M10 28 A18 18 0 0 1 28 10 A18 18 0 0 1 46 28'/%3E%3Cpath d='M24 28 A18 18 0 0 1 42 10 A18 18 0 0 1 60 28'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 56px 28px;
  background-position: bottom;
}

/* Header / nav — dawn sky over Mt. Fuji, framed by sakura branches.
   Fuji silhouette and sakura blossoms are hand-drawn SVG shapes (simple
   paths/circles), not traced or copied from any photo, artwork, or icon
   set — original geometry only, same approach as the wave/lattice motifs. */
header.site-header {
  position: relative;
  overflow: hidden;
  background-color: #24466a;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 140'%3E%3Cpath d='M-20,140 C70,70 115,22 178,10 C186,8 200,8 208,10 C271,22 320,70 410,140 Z' fill='%233d5a78' opacity='0.85'/%3E%3Cpath d='M178,10 C186,8 200,8 208,10 L222,34 L210,26 L200,40 L190,24 L180,38 L168,26 L163,32 Z' fill='%23f2ead9' opacity='0.9'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #1f3b57 0%, #24466a 52%, #6d5468 76%, #dba488 100%);
  background-repeat: no-repeat, no-repeat;
  background-position: bottom right, top left;
  background-size: 300px 92px, 100% 100%;
  color: #f6f0e2;
}

header.site-header::before,
header.site-header::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 88px;
  height: 76px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 78'%3E%3Cpath d='M2,2 C18,10 26,22 30,34 C34,46 30,56 38,66' fill='none' stroke='%23704838' stroke-width='2.2' stroke-linecap='round'/%3E%3Cpath d='M18,10 C22,6 26,4 30,3' fill='none' stroke='%23704838' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M28,30 C33,26 38,24 43,24' fill='none' stroke='%23704838' stroke-width='1.6' stroke-linecap='round'/%3E%3Cg fill='%23f2b8c6'%3E%3Ccircle cx='8' cy='4' r='4'/%3E%3Ccircle cx='14' cy='2' r='3.4'/%3E%3Ccircle cx='16' cy='8' r='3.6'/%3E%3Ccircle cx='10' cy='9' r='3'/%3E%3Ccircle cx='30' cy='4' r='3.6'/%3E%3Ccircle cx='35' cy='2' r='3'/%3E%3Ccircle cx='36' cy='7' r='3.2'/%3E%3Ccircle cx='32' cy='32' r='4'/%3E%3Ccircle cx='38' cy='29' r='3.4'/%3E%3Ccircle cx='40' cy='35' r='3.6'/%3E%3Ccircle cx='34' cy='37' r='3'/%3E%3Ccircle cx='44' cy='22' r='3.4'/%3E%3Ccircle cx='49' cy='20' r='3'/%3E%3Ccircle cx='50' cy='25' r='3.2'/%3E%3Ccircle cx='40' cy='64' r='4'/%3E%3Ccircle cx='46' cy='61' r='3.4'/%3E%3Ccircle cx='47' cy='67' r='3.6'/%3E%3Ccircle cx='42' cy='70' r='3'/%3E%3C/g%3E%3Cg fill='%23d97a8f'%3E%3Ccircle cx='11' cy='5' r='1.3'/%3E%3Ccircle cx='33' cy='4' r='1.1'/%3E%3Ccircle cx='36' cy='33' r='1.3'/%3E%3Ccircle cx='47' cy='23' r='1.1'/%3E%3Ccircle cx='44' cy='65' r='1.3'/%3E%3C/g%3E%3Cg fill='%23f6d7de' opacity='0.85'%3E%3Cellipse cx='54' cy='12' rx='2.6' ry='1.4' transform='rotate(30 54 12)'/%3E%3Cellipse cx='58' cy='45' rx='2.4' ry='1.3' transform='rotate(-20 58 45)'/%3E%3Cellipse cx='20' cy='50' rx='2.2' ry='1.2' transform='rotate(15 20 50)'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: 1;
  opacity: 0.95;
}

header.site-header::before { left: 2px; }
header.site-header::after { right: 2px; transform: scaleX(-1); }

header.site-header .wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  font-family: var(--serif);
  color: #f6f0e2;
  display: flex;
  align-items: center;
  gap: 12px;
  text-shadow: 0 1px 3px rgba(20, 26, 36, 0.4);
}

.brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff9f2;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(246, 240, 226, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}

.brand-sub {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(246, 240, 226, 0.75);
}

.study-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand:hover { text-decoration: none; }

@media (max-width: 480px) {
  .brand-title { font-size: 1.5rem; }
  .brand .mark { width: 34px; height: 34px; font-size: 1.1rem; }
  header.site-header::before,
  header.site-header::after { display: none; }
  header.site-header { background-size: 200px 64px, 100% 100%; }
}

nav.site-nav { display: flex; gap: 22px; flex-wrap: wrap; }

nav.site-nav a {
  color: rgba(246, 240, 226, 0.85);
  font-weight: 500;
  font-size: 0.95rem;
  text-shadow: 0 1px 3px rgba(20, 26, 36, 0.4);
}

nav.site-nav a.active,
nav.site-nav a:hover { color: #f6f0e2; text-decoration: underline; text-underline-offset: 4px; }

/* Main content */
main { padding: 56px 0 72px; }

/* Hero illustration (Home page) */
.hero-figure {
  margin: 32px 0 40px;
}

.hero-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--paper-raised), 0 8px 24px -12px rgba(31, 59, 87, 0.35);
}

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.3;
  margin-top: 0;
}

h1 { font-size: 2.1rem; margin-bottom: 14px; }
h2 { font-size: 1.5rem; margin-bottom: 12px; }
h3 { font-size: 1.15rem; }

p { color: var(--ink); }

.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 56ch;
}

.tag {
  display: inline-block;
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 18px;
}

/* Entry cards */
.entry-list { margin-top: 32px; display: flex; flex-direction: column; gap: 0; }

.entry {
  padding: 22px 0;
  border-top: 1px dashed var(--line);
  position: relative;
}

.entry:first-child { border-top: none; }

.entry .meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.entry h3 { margin-bottom: 8px; }
.entry h3 a { color: var(--ink); }
.entry h3 a:hover { color: var(--accent); }

.entry p { color: var(--ink-soft); margin: 0; }

.entry .read-more { display: inline-block; margin-top: 8px; font-size: 0.9rem; font-weight: 500; }

/* Tag chips — plain crawlable text links, used on entry cards and post
   pages; also double as filters on the Blog page via ?tag=. */
.tag-chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
  text-decoration: none;
  line-height: 1.5;
}

.chip:hover { background: var(--accent); color: #fff9f2; text-decoration: none; }

.chip.active { background: var(--indigo); color: #f6f0e2; }

#tag-filter-status {
  margin: 10px 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

#tag-filter-status strong { color: var(--accent); }

/* Post page */
.post-header { margin-bottom: 32px; }
.post-body p { margin: 0 0 18px; }
.post-body h2 { margin-top: 34px; }

.post-nav {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

/* Vocabulary-style post components — a quoted context sentence plus a
   small definition card (word / reading+romaji / meaning). Used for
   entries sourced from a single word or phrase in context, rather than
   a full yojijukugo illustration. */
.vocab-context {
  margin: 20px 0 28px;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.vocab-context p {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
}

.vocab-context p:last-child { margin-bottom: 0; }

.vocab-context .vocab-context-en {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--ink-soft);
}

.vocab-card {
  margin: 28px 0;
  padding: 22px 24px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 var(--paper-raised), 0 8px 24px -16px rgba(31, 59, 87, 0.25);
}

.vocab-word {
  font-family: var(--serif);
  font-size: 2.1rem;
  line-height: 1.25;
  color: var(--indigo);
  margin-bottom: 8px;
}

.vocab-reading {
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.vocab-romaji {
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.vocab-meaning {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
}

.vocab-subintro {
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 18px 0 6px;
}

.vocab-related {
  margin: -10px 0 18px;
  padding-left: 2px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.vocab-related strong { color: var(--ink); }

/* About page bits */
.about-grid {
  margin-top: 28px;
  display: grid;
  gap: 18px;
}

.stat-row {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin: 28px 0;
  padding: 20px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.stat-row div { flex: 1; min-width: 120px; }

.stat-row .num {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--accent);
  display: block;
}

.stat-row .label { font-size: 0.85rem; color: var(--ink-soft); }

/* Asanoha lattice — hand-drawn hexagonal hemp-leaf motif, used as a very
   faint full-bleed texture behind the footer only (kept subtle so text
   stays easy to read). Original geometry, no external asset. */
footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cg fill='none' stroke='%235a5142' stroke-width='0.6' opacity='0.12'%3E%3Cpath d='M28 0 L56 16 L56 48 L28 64 L0 48 L0 16 Z'/%3E%3Cpath d='M28 0 L28 32 M0 16 L28 32 L56 16 M0 48 L28 32 L56 48'/%3E%3Cpath d='M28 64 L56 80 L56 97 M28 64 L0 80 L0 97 M28 64 L28 97'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 97px;
}

footer.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
  main { padding: 40px 0 56px; }
}

/* Utility spacing/visibility classes — kept here instead of inline style="" attributes so the site can run under a strict Content-Security-Policy with no 'unsafe-inline' for styles. */
.u-mt-24 { margin-top: 24px; }
.u-mt-40 { margin-top: 40px; }
.u-mt-48 { margin-top: 48px; }
.u-hidden { display: none; }
