/* ============================================================
   HACH Blog — Design System v2
   hach.work brand: cream / navy / gold, honeycomb motif
   ============================================================ */

:root {
  --bg: #faf7f0;
  --bg-soft: #f4efe3;
  --bg-card: #ffffff;
  --ink: #1e2a44;
  --ink-soft: #4a5670;
  --ink-faint: #98a0b3;
  --gold: #d9a13b;
  --gold-deep: #a8761f;
  --gold-pale: #f3e7c9;
  --cta: #f2b705;
  --line: #eae3d2;
  --radius-s: 10px;
  --radius: 16px;
  --radius-l: 24px;
  --shadow-s: 0 1px 4px rgba(30, 42, 68, 0.05);
  --shadow: 0 4px 16px rgba(30, 42, 68, 0.07);
  --shadow-l: 0 16px 40px rgba(30, 42, 68, 0.13);
  --font-sans: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  --font-serif: "Shippori Mincho B1", "Hiragino Mincho ProN", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 2.0;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--gold-deep); text-decoration: none; }
a:focus-visible { outline: 3px solid var(--cta); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
::selection { background: var(--gold-pale); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 744px; margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------
   Reading progress
   ------------------------------------------------------------ */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--cta));
  z-index: 100; transition: width 0.1s linear;
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */
.site-header {
  background: rgba(250, 247, 240, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand-hex { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; align-items: baseline; gap: 7px; }
.brand-mark { font-weight: 900; font-size: 21px; letter-spacing: 0.03em; color: var(--ink); }
.brand-sub {
  font-family: var(--font-serif); font-style: italic; font-weight: 700;
  font-size: 15px; color: var(--gold); letter-spacing: 0.1em;
}
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav .nav-link {
  color: var(--ink-soft); font-size: 13.5px; font-weight: 500; position: relative; padding: 4px 0;
}
.site-nav .nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--gold); transition: width 0.25s var(--ease);
}
.site-nav .nav-link:hover { color: var(--ink); text-decoration: none; }
.site-nav .nav-link:hover::after { width: 100%; }

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font-family: var(--font-sans); font-weight: 700; font-size: 14px; line-height: 1.4;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-l); }
.btn:active { transform: translateY(0); }
.btn-cta { background: var(--cta); color: var(--ink) !important; box-shadow: var(--shadow-s); }
.btn-cta:hover { background: #ffc61a; }
.btn-ghost { background: transparent; color: var(--ink) !important; border: 1.5px solid var(--ink); }
.btn-lg { padding: 16px 34px; font-size: 16px; }
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  position: relative; overflow: hidden;
  padding: 84px 0 72px; text-align: left;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(560px 380px at 88% 10%, rgba(242, 183, 5, 0.12), transparent 65%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='97' viewBox='0 0 112 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16L28 0zm56 33l28 16v32l-28 16-28-16V49l28-16z' fill='none' stroke='%23d9a13b' stroke-opacity='0.13' stroke-width='1.5'/%3E%3C/svg%3E") right -20px top -10px / 340px auto no-repeat;
  pointer-events: none;
}
.hero-inner { position: relative; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--gold-deep); font-weight: 700; letter-spacing: 0.32em; font-size: 12px;
  margin: 0 0 18px; text-transform: uppercase;
}
.hero-eyebrow::before { content: ""; width: 32px; height: 2px; background: var(--gold); }
.hero-title {
  font-size: clamp(30px, 5vw, 46px); font-weight: 900; line-height: 1.42;
  margin: 0 0 18px; letter-spacing: 0.01em;
}
.hero-title .accent {
  font-family: var(--font-serif); font-style: italic; color: var(--gold-deep);
  padding: 0 2px;
}
.hero-lead { color: var(--ink-soft); font-size: 15.5px; margin: 0; max-width: 42em; line-height: 2.1; }
.hero-lead p { margin: 0; }

/* ------------------------------------------------------------
   Post list
   ------------------------------------------------------------ */
.section-label {
  display: flex; align-items: center; gap: 14px;
  color: var(--ink-faint); font-size: 12.5px; font-weight: 700; letter-spacing: 0.28em;
  margin: 0 0 22px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.post-list { padding: 8px 0 84px; }
.post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

.post-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 30px 24px; box-shadow: var(--shadow-s);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
  text-decoration: none !important; overflow: hidden;
}
.post-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--cta));
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-l); border-color: var(--gold-pale); }
.post-card:hover::before { transform: scaleX(1); }

.post-card.featured { grid-column: 1 / -1; padding: 40px 44px 34px; }
.post-card.featured .post-card-title { font-size: clamp(21px, 3vw, 27px); }
.post-card.featured .post-card-desc { -webkit-line-clamp: 3; }

.post-card-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.chip {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: var(--gold-pale); color: var(--gold-deep);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em;
}
.post-card-date, .post-card-time { color: var(--ink-faint); font-size: 12.5px; font-weight: 500; letter-spacing: 0.05em; }

.post-card-title {
  color: var(--ink); font-size: 18.5px; font-weight: 700; line-height: 1.6;
  margin: 0 0 10px; transition: color 0.2s;
}
.post-card:hover .post-card-title { color: var(--gold-deep); }
.post-card-desc {
  color: var(--ink-soft); font-size: 13.5px; line-height: 1.9; margin: 0 0 18px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-more {
  margin-top: auto; color: var(--gold-deep); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
}
.post-card-more .arrow { transition: transform 0.2s var(--ease); }
.post-card:hover .post-card-more .arrow { transform: translateX(4px); }

/* ------------------------------------------------------------
   Post page
   ------------------------------------------------------------ */
.post { padding: 64px 0 72px; }
.post-header { margin-bottom: 40px; }
.post-meta-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.post-date { color: var(--ink-faint); font-size: 13px; letter-spacing: 0.06em; }
.post-title { font-size: clamp(26px, 4vw, 34px); font-weight: 900; line-height: 1.55; margin: 0 0 16px; }
.post-desc {
  color: var(--ink-soft); font-size: 14.5px; line-height: 2; margin: 0;
  padding: 18px 22px; background: var(--bg-soft); border-radius: var(--radius-s);
  border-left: 3px solid var(--gold);
}

/* TOC */
.toc {
  margin: 36px 0; padding: 24px 28px; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s);
}
.toc-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.24em; color: var(--gold-deep); margin: 0 0 14px;
}
.toc-title::before { content: "◆"; font-size: 10px; }
.toc ol { margin: 0; padding: 0 0 0 2px; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 0; }
.toc a {
  display: flex; gap: 12px; padding: 7px 6px; color: var(--ink-soft);
  font-size: 14px; line-height: 1.7; border-radius: 6px; transition: background 0.15s, color 0.15s;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero); color: var(--gold);
  font-weight: 700; font-size: 12.5px; padding-top: 2px; letter-spacing: 0.05em;
}
.toc a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }

/* Body typography */
.post-body { font-size: 16px; counter-reset: h2; }
.post-body > p:first-of-type { font-size: 16.5px; }
.post-body h2 {
  counter-increment: h2;
  position: relative;
  font-size: clamp(20px, 3vw, 23px); font-weight: 700; line-height: 1.6;
  margin: 3em 0 1em; padding: 14px 0 14px 66px;
  border-top: 1px solid var(--line);
}
.post-body h2::before {
  content: counter(h2, decimal-leading-zero);
  position: absolute; left: 0; top: 12px;
  font-family: var(--font-serif); font-style: italic;
  font-size: 30px; font-weight: 700; color: var(--gold); line-height: 1.4;
}
.post-body h2::after {
  content: ""; position: absolute; left: 46px; top: 18px; bottom: 18px; width: 2px;
  background: linear-gradient(var(--gold), var(--cta));
}
.post-body h3 {
  font-size: 17.5px; font-weight: 700; margin: 2.2em 0 0.7em;
  padding-left: 14px; border-left: 3px solid var(--gold-pale);
}
.post-body p { margin: 0 0 1.5em; }
.post-body ul, .post-body ol { padding-left: 1.5em; margin: 0 0 1.5em; }
.post-body li { margin-bottom: 0.5em; }
.post-body li::marker { color: var(--gold); font-weight: 700; }
.post-body strong { color: var(--ink); background: linear-gradient(transparent 66%, rgba(242, 183, 5, 0.32) 66%); padding: 0 1px; }

.post-body table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 1.8em;
  font-size: 14px; line-height: 1.8;
  display: block; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  box-shadow: var(--shadow-s);
}
.post-body th, .post-body td { padding: 12px 16px; text-align: left; min-width: 9em; vertical-align: top; }
.post-body thead th { background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: 0.04em; white-space: nowrap; }
.post-body tbody tr:nth-child(even) td { background: var(--bg-soft); }
.post-body tbody tr:nth-child(odd) td { background: var(--bg-card); }
.post-body td { border-top: 1px solid var(--line); }

.post-body blockquote {
  position: relative; margin: 2.6em 0; padding: 28px 30px 26px 34px;
  background: linear-gradient(135deg, #fdf6e0, #fdf0cd);
  border: 1px solid #f0dfae; border-radius: var(--radius);
  color: var(--ink); font-size: 15px; box-shadow: var(--shadow-s);
}
.post-body blockquote::before {
  content: "🐝"; position: absolute; top: -14px; left: 24px;
  background: var(--bg-card); border: 1px solid #f0dfae; border-radius: 999px;
  width: 32px; height: 32px; display: grid; place-items: center; font-size: 15px;
  box-shadow: var(--shadow-s);
}
.post-body blockquote p { margin: 0 0 0.7em; }
.post-body blockquote p:last-child { margin: 0; }
.post-body blockquote a { font-weight: 700; color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; }
.post-body code { background: #f0ead9; border-radius: 5px; padding: 2px 7px; font-size: 0.88em; }
.post-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold-pale); text-decoration-thickness: 2px; }
.post-body a:hover { text-decoration-color: var(--gold); }

/* Share + related */
.post-share { display: flex; align-items: center; gap: 12px; margin: 44px 0 0; padding-top: 26px; border-top: 1px solid var(--line); }
.post-share-label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.2em; color: var(--ink-faint); }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--bg-card); color: var(--ink) !important; font-size: 13px; font-weight: 700;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.share-btn:hover { border-color: var(--gold); text-decoration: none; transform: translateY(-1px); }

.related { padding: 8px 0 40px; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }

.post-back { padding: 8px 0 24px; }
.post-back a { font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
  position: relative; margin-top: 40px; background: var(--ink); color: #cfd6e4; overflow: hidden;
}
.site-footer::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(480px 320px at 12% 0%, rgba(242, 183, 5, 0.10), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='97' viewBox='0 0 112 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16L28 0zm56 33l28 16v32l-28 16-28-16V49l28-16z' fill='none' stroke='%23f2b705' stroke-opacity='0.08' stroke-width='1.5'/%3E%3C/svg%3E") right -30px bottom -20px / 380px auto no-repeat;
  pointer-events: none;
}
.footer-inner { position: relative; padding: 64px 24px 32px; text-align: center; }
.footer-eyebrow { color: var(--cta); font-weight: 700; font-size: 12px; letter-spacing: 0.3em; margin: 0 0 14px; }
.footer-cta-title { color: #fff; font-size: clamp(21px, 3.4vw, 28px); font-weight: 900; line-height: 1.7; margin: 0 0 12px; }
.footer-cta-text { font-size: 14px; line-height: 2.1; max-width: 36em; margin: 0 auto 28px; color: #aeb8cd; }
.footer-links { margin: 40px 0 0; display: flex; justify-content: center; gap: 26px; font-size: 13px; }
.footer-links a { color: #aeb8cd; }
.footer-links a:hover { color: #fff; }
.copyright { margin: 20px 0 0; font-size: 12px; color: #7683a0; }

/* ------------------------------------------------------------
   Responsive / motion
   ------------------------------------------------------------ */
.sp { display: none; }
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .hero { padding: 56px 0 46px; }
  .post-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .post-card.featured { padding: 30px 28px 26px; }
  .post-body h2 { padding-left: 54px; }
  .post-body h2::before { font-size: 24px; }
  .post-body h2::after { left: 38px; }
  .site-nav .nav-link { display: none; }
  .sp { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
