/* User Provided Stylesheet */

/* HaikuSDL site theme: sumi ink + vermilion seal, on top of the MyST book theme. */
@import url("https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@400;500;600&family=Zen+Kaku+Gothic+New:wght@400;500&display=swap");

:root {
  --hk-paper: #f6f2e9;
  --hk-surface: #fffdf8;
  --hk-ink: #1c1b18;
  --hk-muted: #6d675c;
  --hk-line: #e2dccf;
  --hk-seal: #c8401b;          /* vermilion, from the red sun in the banner */
  --hk-seal-soft: rgba(200, 64, 27, 0.10);
  --hk-serif: "Instrument Serif", Georgia, serif;
  --hk-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hk-jp: "Shippori Mincho", "Hiragino Mincho ProN", serif;
}
html.dark {
  --hk-paper: #11100e;
  --hk-surface: #1a1916;
  --hk-ink: #ece6da;
  --hk-muted: #a39c8e;
  --hk-line: #2d2a25;
  --hk-seal: #ff6b3d;
  --hk-seal-soft: rgba(255, 107, 61, 0.12);
}

body { background: var(--hk-paper) !important; color: var(--hk-ink); font-family: var(--hk-sans); }
.myst-top-nav, header.myst-top-nav, nav.fixed { background: color-mix(in srgb, var(--hk-paper) 88%, transparent) !important; backdrop-filter: blur(8px); }

/* Type */
article h1, article h2, .myst-fm-block-title, h1.title {
  font-family: var(--hk-serif) !important; font-weight: 400 !important; letter-spacing: -0.01em;
}
html body article h1 { font-size: 2.8rem !important; line-height: 1.1 !important; }
html body article h2 { font-size: 2.1rem !important; line-height: 1.15 !important; margin-top: 2.8rem !important; }
article h3 { font-family: var(--hk-sans); font-weight: 600; }
article a { text-decoration-color: var(--hk-seal); text-underline-offset: 3px; }
article a:hover { color: var(--hk-seal); }
::selection { background: var(--hk-seal); color: #fff; }

/* Sidebar */
nav a[aria-current="page"], .myst-toc-item.active, .myst-toc a.active { color: var(--hk-seal) !important; }

/* ---------- Landing hero ---------- */
.hk-hero { position: relative; padding: 3.5rem 0 2.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--hk-line); overflow: hidden; }
.hk-hero::before { /* the seal: a soft vermilion sun */
  content: ""; position: absolute; right: 4%; top: 28px; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, var(--hk-seal) 0%, color-mix(in srgb, var(--hk-seal) 70%, transparent) 45%, transparent 70%);
  opacity: .22; filter: blur(2px); pointer-events: none;
  animation: hk-breathe 9s ease-in-out infinite;
}
@keyframes hk-breathe { 0%, 100% { transform: scale(1); opacity: .18; } 50% { transform: scale(1.06); opacity: .28; } }
@media (prefers-reduced-motion: reduce) { .hk-hero::before { animation: none; } }

.hk-kicker { font-family: var(--hk-jp); color: var(--hk-seal); letter-spacing: .25em; font-size: .9rem; margin: 0 0 .6rem; }
.hk-kicker p { margin: 0; }
.hk-title p { font-family: var(--hk-serif); font-size: clamp(3rem, 8vw, 5rem); line-height: 1; margin: 0 0 1.2rem; }
.hk-haiku { border-left: 2px solid var(--hk-seal); padding-left: 1.1rem; margin: 1.4rem 0; }
.hk-haiku p { font-family: var(--hk-serif); font-style: italic; font-size: 1.45rem; line-height: 1.35; margin: 0; color: var(--hk-ink); }
.hk-haiku p:last-child { font-family: var(--hk-sans); font-style: normal; font-size: .8rem; color: var(--hk-muted); margin-top: .5rem; letter-spacing: .04em; }
.hk-lead p { font-size: 1.12rem; color: var(--hk-muted); max-width: 62ch; }
.hk-actions p { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.4rem; }
.hk-actions a {
  display: inline-block; padding: .55rem 1.1rem; border-radius: 999px; border: 1px solid var(--hk-line);
  text-decoration: none !important; font-size: .92rem; color: var(--hk-ink) !important; transition: all .2s;
}
.hk-actions a:first-child { background: var(--hk-ink); color: var(--hk-paper) !important; border-color: var(--hk-ink); }
.hk-actions a:hover { border-color: var(--hk-seal); color: var(--hk-seal) !important; }
.hk-actions a:first-child:hover { background: var(--hk-seal); border-color: var(--hk-seal); color: #fff !important; }

/* ---------- Cards (MyST grid/card) ---------- */
article .myst-grid, article .grid { gap: 1rem !important; }
article .myst-card, article .card, article [class*="card"] > a, article div.rounded.border {
  background: var(--hk-surface) !important; border: 1px solid var(--hk-line) !important; border-radius: 14px !important;
  box-shadow: none !important; transition: border-color .25s, transform .25s;
}
article a:hover .myst-card, article a.myst-card:hover, article div.rounded.border:hover { border-color: var(--hk-seal) !important; transform: translateY(-2px); }
.hk-chip p { display: inline-block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--hk-seal); margin: 0 0 .3rem; }
.hk-stat p:first-child { font-family: var(--hk-serif); font-size: 2.6rem; line-height: 1; margin: 0; color: var(--hk-ink); }
.hk-stat p:last-child { color: var(--hk-muted); font-size: .88rem; margin: .3rem 0 0; }
.hk-soon { opacity: .55; }
article div:has(> .hk-soon) { border-style: dashed !important; }

/* Chapter headers on Articles */
.hk-chapter p { font-family: var(--hk-jp); color: var(--hk-seal); font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; margin: 3rem 0 0 !important; }
.hk-chapter + h2, html body article .hk-chapter + h2 { margin-top: .3rem !important; }

/* Figures */
article figure img { border-radius: 14px; }

/* ---------- Hanko seal in the bottom-right corner of every card ---------- */
article .myst-card { position: relative; }
article .myst-card .myst-card-body { padding-bottom: 2.4rem; }
article .myst-card::after {
  content: "句"; position: absolute; right: 12px; bottom: 11px;
  width: 22px; height: 22px; display: grid; place-items: center;
  font-family: var(--hk-jp); font-size: 13px; line-height: 1; color: #fff;
  background: var(--hk-seal); border-radius: 5px;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35);
  opacity: .8; transform: rotate(-6deg); transition: transform .3s, opacity .3s;
}
article .myst-card:hover::after { opacity: 1; transform: rotate(0deg) scale(1.12); }
article .myst-card:has(.hk-mark-ron)::after  { content: "論"; }  /* article: thesis */
article .myst-card:has(.hk-mark-sho)::after  { content: "章"; }  /* chapter */
article .myst-card:has(.hk-mark-so)::after   { content: "創"; }  /* project: creation */
article .myst-card:has(.hk-mark-hito)::after { content: "人"; }  /* person */
article .myst-card:has(.hk-mark-su)::after   { content: "数"; }  /* number */
article .myst-card:has(.hk-soon)::after      { content: "待"; background: transparent; color: var(--hk-seal); box-shadow: inset 0 0 0 1.5px var(--hk-seal); }  /* waiting */

/* Links in ink with a vermilion underline, instead of the theme blue */
html body article a:not(.myst-card), html body article a:not(.myst-card) * { color: var(--hk-ink) !important; }
html body article a:not(.myst-card) { text-decoration: underline !important; text-decoration-color: var(--hk-seal) !important; text-underline-offset: 3px; }
html body article a:not(.myst-card):hover, html body article a:not(.myst-card):hover * { color: var(--hk-seal) !important; }

/* ---------- Landing: two-column hero with the banner art ---------- */
.hk-hero::before { display: none; }
.hk-hero { padding: 2.5rem 0 2.5rem; }
.hk-hero .myst-grid, .hk-hero .grid { align-items: center; gap: 2.5rem !important; }
.hk-hero-art { position: relative; }
.hk-hero-art::before { /* the vermilion sun behind the art */
  content: ""; position: absolute; right: -6%; top: -8%; width: 46%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--hk-seal) 0%, color-mix(in srgb, var(--hk-seal) 60%, transparent) 40%, transparent 70%);
  opacity: .35; filter: blur(6px); z-index: 0; animation: hk-breathe 9s ease-in-out infinite;
}
.hk-hero-art img {
  position: relative; z-index: 1; width: 100%; border-radius: 18px !important;
  transform: rotate(1.6deg); box-shadow: 0 30px 60px -30px rgba(0,0,0,.45);
  transition: transform .6s ease;
}
.hk-hero-art:hover img { transform: rotate(0deg) scale(1.01); }
@media (prefers-reduced-motion: reduce) { .hk-hero-art::before { animation: none; } .hk-hero-art img { transition: none; } }
.hk-prose p { max-width: 68ch; }
.hk-chapter + h2 { margin-bottom: 1rem !important; }

/* =====================================================================
   TRADITIONAL LAYER: washi, sumi, Mincho; quiet and still
   ===================================================================== */
:root {
  --hk-paper: #f3eee2;
  --hk-surface: #f8f4ea;
  --hk-ink: #23211c;
  --hk-muted: #6f685a;
  --hk-line: #d9d1bf;
  --hk-seal: #b8341b;
  --hk-serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --hk-sans: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
}
html.dark {
  --hk-paper: #15130f;
  --hk-surface: #1b1914;
  --hk-ink: #e9e2d2;
  --hk-muted: #a29a88;
  --hk-line: #33302a;
  --hk-seal: #d9573a;
}
/* washi fibre: a faint noise over the paper */
body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") !important;
  font-family: var(--hk-sans) !important;
}
html body article h1, html body article h2, .hk-title p, .hk-stat p:first-child { font-family: var(--hk-serif) !important; font-weight: 500 !important; letter-spacing: .01em !important; }
html body article h3 { font-family: var(--hk-serif) !important; font-weight: 600 !important; }
.hk-title p { font-size: clamp(2.8rem, 7vw, 4.4rem); letter-spacing: .02em; }
.hk-kicker p { font-family: var(--hk-serif); letter-spacing: .3em; }
.hk-haiku { border-left: 1px solid var(--hk-seal); }
.hk-haiku p { font-family: var(--hk-serif) !important; font-style: normal !important; font-size: 1.3rem; line-height: 1.7; }

/* stillness: no breathing sun, no tilt, no lift */
.hk-hero-art::before { animation: none !important; opacity: .9; filter: none; width: 64px; right: -10px; top: -14px; background: var(--hk-seal); border-radius: 50%; }
.hk-hero-art img { transform: none !important; box-shadow: none !important; border-radius: 0 !important; padding: 10px; background: var(--hk-surface); border: 1px solid var(--hk-line); }
article .myst-card, article div.rounded.border { border-radius: 0 !important; background: var(--hk-surface) !important; }
article a:hover .myst-card, article a.myst-card:hover, article div.rounded.border:hover { transform: none !important; }
article .myst-card::after { border-radius: 2px; transform: rotate(-3deg); transition: opacity .3s; }
article .myst-card:hover::after { transform: rotate(-3deg); }

/* hero links as quiet text, not pills */
.hk-actions p { gap: 1.6rem; }
.hk-actions a, .hk-actions a:first-child {
  background: none !important; border: none !important; border-radius: 0 !important; padding: 0 0 2px !important;
  color: var(--hk-ink) !important; border-bottom: 1px solid var(--hk-seal) !important; font-family: var(--hk-serif);
}
.hk-actions a::after { content: " →"; color: var(--hk-seal); }
.hk-actions a:hover, .hk-actions a:first-child:hover { background: none !important; color: var(--hk-seal) !important; }

.hk-chip p { font-family: var(--hk-serif); letter-spacing: .18em; }
.hk-chapter p { font-family: var(--hk-serif) !important; }
article figure img { border-radius: 0; }
/* the art is stamped like a print: a square hanko on its lower corner */
.hk-hero-art::before {
  content: "俳句" !important; writing-mode: vertical-rl; top: auto !important; bottom: -14px; right: 14px !important;
  width: 34px !important; height: 58px; aspect-ratio: auto !important; border-radius: 3px !important;
  display: grid; place-items: center; z-index: 2 !important; opacity: .92 !important;
  font-family: var(--hk-serif); font-size: 15px; letter-spacing: .1em; color: #fff;
  background: var(--hk-seal) !important; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); transform: rotate(-2deg);
}

/* ---------- Frameworks: ink plates, symbol stories, tags ---------- */
article .myst-card:has(.hk-mark-so)::after { content: "心"; }   /* heart */
.hk-plate img, article .myst-card img[src*="fw-"] {
  width: 100%; border: 1px solid var(--hk-line); padding: 6px; background: var(--hk-surface);
}
.hk-plate { max-width: 460px; margin: .5rem 0 1.6rem; }
.hk-symbol p {
  font-family: var(--hk-serif); font-size: 1.02rem; line-height: 1.7; color: var(--hk-muted);
  border-left: 1px solid var(--hk-seal); padding-left: .9rem; margin: .2rem 0 1rem;
}
.hk-symbol strong { color: var(--hk-seal); font-weight: 600; }
.hk-fw p { font-family: var(--hk-serif); font-size: .82rem; color: var(--hk-muted); margin: .4rem 0 0; letter-spacing: .06em; }

/* ---------- "Try live" link to the interactive Curvenote version ---------- */
.hk-live { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .2rem 0 1.6rem; }
.hk-live p { margin: 0 !important; color: var(--hk-muted); font-size: .9rem; }
.hk-live p:first-child a {
  display: inline-block; padding: .45rem 1rem; border: 1px solid var(--hk-seal) !important;
  color: var(--hk-seal) !important; text-decoration: none !important; font-family: var(--hk-serif);
  letter-spacing: .06em; transition: background .2s, color .2s;
}
.hk-live p:first-child a:hover { background: var(--hk-seal); color: #fff !important; }
.hk-live-soon p { font-family: var(--hk-serif); font-style: normal; border-left: 1px solid var(--hk-line); padding-left: .8rem; }
/* coming-soon state: same button shape, dashed and inactive */
.hk-live-soon p {
  display: inline-block; padding: .45rem 1rem !important; border: 1px dashed var(--hk-seal) !important;
  border-left-width: 1px !important; color: var(--hk-seal) !important; opacity: .6;
  font-family: var(--hk-serif); font-size: .92rem; letter-spacing: .06em; cursor: not-allowed; user-select: none;
}
