/* Meshro — static template: products, blog, memo, articles, product details. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root {
  --background: 42 28% 96%; --bg-2: 42 24% 93%; --foreground: 40 8% 9%; --card: 0 0% 100%;
  --primary: 40 8% 9%; --primary-foreground: 42 28% 97%; --muted: 40 22% 92%; --muted-foreground: 36 6% 38%;
  --accent: 78 85% 62%; --accent-foreground: 40 8% 9%; --border: 38 18% 86%;
  --gradient-hero: linear-gradient(135deg, hsl(40 8% 9%), hsl(40 8% 18%));
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  /* EB Garamond is self-hosted with its OFL license. */
  --font-text: "EB Garamond", "Hoefler Text", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --radius: 0.875rem; --radius-lg: 1.25rem;
  --shadow-sm: 0 1px 2px hsl(40 8% 9% / .05); --shadow-md: 0 8px 30px hsl(40 8% 9% / .08);
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font-body); color: hsl(var(--foreground)); line-height: 1.5; letter-spacing: -0.005em; min-height: 100vh;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: radial-gradient(60rem 40rem at 80% -10%, hsl(var(--accent) / .10), transparent 60%), radial-gradient(50rem 40rem at -10% 10%, hsl(var(--accent) / .06), transparent 55%), hsl(var(--background));
}
body.pg-memo { background: hsl(var(--background)); }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.03em; font-weight: 700; line-height: 1.05; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
ul, ol { list-style: none; }
::selection { background: hsl(var(--accent) / .4); }
:focus-visible { outline: 2px solid hsl(78 70% 42%); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 74rem; margin: 0 auto; padding: 0 1.5rem; }

/* nav + footer */
header.nav { position: sticky; top: 1rem; z-index: 50; margin-top: 1rem; padding: 0 1rem; }
.nav-inner { max-width: 72rem; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: hsl(var(--card) / .85); -webkit-backdrop-filter: saturate(140%) blur(12px); backdrop-filter: saturate(140%) blur(12px); border: 1px solid hsl(var(--border)); border-radius: 9999px; padding: .55rem 1rem .55rem 1.15rem; box-shadow: var(--shadow-sm); }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.02em; min-width: 0; }
.brand img { width: 2.25rem; height: 2.25rem; border-radius: .75rem; flex: none; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a.link { font-size: 1rem; font-weight: 500; color: hsl(var(--muted-foreground)); transition: color .15s; }
.nav-links a.link:hover, .nav-links a.link[aria-current] { color: hsl(var(--foreground)); }
.nav-cta { display: flex; align-items: center; gap: .5rem; }
.lang-switch { font-size: .82rem; font-weight: 700; letter-spacing: .04em; color: hsl(var(--muted-foreground)); border: 1px solid hsl(var(--border)); border-radius: 9999px; padding: .4rem .7rem; transition: border-color .15s, color .15s; }
.lang-switch:hover { color: hsl(var(--foreground)); border-color: hsl(var(--foreground) / .35); }
.btn { font-family: var(--font-body); font-weight: 600; cursor: pointer; white-space: nowrap; border: 0; border-radius: 9999px; transition: transform .1s, opacity .15s; display: inline-flex; align-items: center; gap: .5rem; }
.btn:active { transform: translateY(1px); }
.btn-ink { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); padding: .58rem 1.25rem; font-size: .9rem; box-shadow: var(--shadow-sm); }
.btn-ink:hover { opacity: .9; }
@media (max-width: 820px) {
  .nav-inner { flex-wrap: wrap; justify-content: center; row-gap: .35rem; border-radius: 1.35rem; padding: .55rem .75rem; }
  .brand { font-size: 1.1rem; gap: .45rem; }
  .brand img { width: 1.9rem; height: 1.9rem; }
  .nav-links { order: 3; width: 100%; justify-content: center; gap: .35rem 1.15rem; flex-wrap: wrap; }
  .nav-links a.link { font-size: .88rem; }
  .nav-cta { gap: .4rem; }
  .nav-cta .btn-ink { padding: .5rem .85rem; font-size: .85rem; }
  .lang-switch { padding: .3rem .55rem; font-size: .75rem; }
}
footer { border-top: 1px solid hsl(var(--border)); padding: 2.5rem 0; margin-top: 2rem; }
.pg-products footer, .pg-memo footer { margin-top: 0; }
.foot-inner { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; font-size: .875rem; }
.foot-links a, .foot-links .sep, .foot-copy { color: hsl(var(--muted-foreground)); }
.foot-links a:hover { color: hsl(var(--foreground)); }
.foot-copy { font-size: .875rem; }
@media (max-width: 640px) { .foot-inner { flex-direction: column; text-align: center; } }

/* shared hero pieces */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding-block: 1.75rem 0; font-size: .82rem; color: hsl(var(--muted-foreground)); }
.pg-products .crumbs { padding: 1.75rem 0 0; }
.crumbs a:hover { color: hsl(var(--foreground)); }
.crumbs .sep { opacity: .5; }
.crumbs [aria-current] { color: hsl(var(--foreground)); font-weight: 600; }
.hero { padding-block: 4.5rem 1rem; text-align: center; position: relative; }
.pg-products .hero { padding: 2.5rem 1.5rem 0; }
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; font-size: .74rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: hsl(var(--muted-foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); padding: .45rem .9rem; border-radius: 9999px; box-shadow: var(--shadow-sm); }
.pulse { width: .5rem; height: .5rem; border-radius: 9999px; background: hsl(var(--accent)); box-shadow: 0 0 0 4px hsl(var(--accent) / .22); }
h1.hero-title { margin: 1.5rem auto 0; max-width: 20ch; font-size: clamp(2.3rem, 5.8vw, 3.8rem); }
.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
.hl { position: relative; white-space: nowrap; }
.hl::after { content: ""; position: absolute; left: -.04em; right: -.04em; bottom: .08em; height: .34em; background: hsl(var(--accent)); z-index: -1; border-radius: 2px; }
p.hero-sub { margin: 1.35rem auto 0; max-width: 42rem; font-size: 1.12rem; line-height: 1.6; color: hsl(var(--muted-foreground)); }

/* products */
.pg-products h1 { margin: 1.5rem auto 0; max-width: 22ch; font-size: clamp(2.1rem, 5vw, 3.2rem); }
.pg-products .hero p { margin: 1.25rem auto 0; max-width: 40rem; font-size: 1.08rem; color: hsl(var(--muted-foreground)); }
.cat-search { max-width: 32rem; margin: 2.25rem auto 0; position: relative; }
.cat-search input { width: 100%; font-size: 1rem; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 9999px; padding: .8rem 1.1rem .8rem 2.8rem; outline: none; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.cat-search input:focus { border-color: hsl(var(--accent)); box-shadow: 0 0 0 4px hsl(var(--accent) / .18); }
.cat-search svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); }
.cat-empty { text-align: center; color: hsl(var(--muted-foreground)); margin: 0 0 4rem; font-size: .96rem; }
.sec-head { border-top: 1px solid hsl(var(--border)); padding-top: 3.25rem; text-align: center; }
.sec-head h2 { margin: 1.5rem auto 0; max-width: 24ch; font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
.sec-head p { margin: 1.1rem auto 0; max-width: 42rem; font-size: 1.02rem; color: hsl(var(--muted-foreground)); }
.sec-head + .cats { margin-top: 2rem; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; margin: 2.5rem 0 0; padding-bottom: 4rem; }
.cat-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
@media (max-width: 860px) { .cats { grid-template-columns: 1fr; } }
.cat { display: block; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.cat[open] { border-color: hsl(var(--accent) / .5); box-shadow: var(--shadow-md); }
.cat summary { list-style: none; cursor: pointer; padding: 1.05rem 1.15rem; display: flex; align-items: center; gap: .85rem; font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; }
.cat summary::-webkit-details-marker { display: none; }
.cat-icon { flex: none; width: 2.1rem; height: 2.1rem; border-radius: .6rem; background: hsl(var(--accent) / .2); color: hsl(78 85% 26%); display: grid; place-items: center; }
.cat-name { flex: 1; min-width: 0; }
.cat-count { flex: none; font-size: .75rem; font-weight: 600; color: hsl(var(--muted-foreground)); }
.chev { flex: none; width: 1.1rem; height: 1.1rem; color: hsl(var(--muted-foreground)); transition: transform .2s; }
.cat[open] .chev { transform: rotate(90deg); }
.cat ul { padding: 0 1.15rem 1.05rem; display: grid; gap: .1rem; }
.cat li a, .soon-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem .6rem; border-radius: .55rem; font-size: .92rem; color: hsl(var(--foreground) / .85); transition: background .12s, color .12s; }
.soon-row { color: hsl(var(--muted-foreground)); }
.cat li a:hover { background: hsl(var(--accent) / .16); color: hsl(var(--foreground)); }
.cat li a .arr { flex: none; opacity: 0; transition: opacity .12s, transform .12s; }
.cat li a:hover .arr { opacity: .55; transform: translateX(2px); }
.soon { flex: none; font-size: .62rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); border-radius: 9999px; padding: .12rem .45rem; }

/* product detail composer */
.composer-shell { max-width: 44rem; margin: 2.5rem auto 0; text-align: left; }
.composer { display: flex; align-items: flex-start; gap: .85rem; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); padding: 1rem 1.1rem; box-shadow: var(--shadow-md); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: hsl(var(--accent)); box-shadow: 0 0 0 4px hsl(var(--accent) / .20), var(--shadow-md); }
.composer .avatar { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 9999px; margin-top: .1rem; background: var(--gradient-hero); color: hsl(var(--accent)); display: grid; place-items: center; }
.composer textarea { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; outline: none; font-size: 1.05rem; line-height: 1.55; padding: .5rem 0; min-height: 5.1rem; }
.composer textarea::placeholder { color: hsl(var(--muted-foreground) / .8); }
.send { flex: none; align-self: flex-end; height: 2.7rem; padding: 0 1.3rem; border: 0; border-radius: .8rem; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .95rem; box-shadow: var(--shadow-sm); transition: opacity .15s; }
.send:hover { opacity: .9; }
.chips { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; padding: 0 .2rem; }
.chip { font-size: .84rem; font-weight: 500; color: hsl(var(--muted-foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 9999px; padding: .45rem .85rem; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: hsl(var(--foreground) / .4); color: hsl(var(--foreground)); }
.composer-foot { text-align: center; margin-top: 1.15rem; font-size: .82rem; color: hsl(var(--muted-foreground)); }
.field-error, .field-note { margin: .7rem 0 0; padding: 0 .2rem; font-size: .85rem; font-weight: 600; }
.field-error { color: hsl(8 70% 42%); }
.field-note { color: hsl(var(--foreground)); }
.related { padding: 4rem 1.5rem 5rem; }
.section-title { text-align: center; font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: 2rem; }
.related-grid a { display: flex; align-items: center; justify-content: space-between; gap: .75rem; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: .95rem 1.1rem; font-weight: 600; font-size: .95rem; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .12s; }
.related-grid a:hover { border-color: hsl(var(--foreground) / .3); transform: translateY(-1px); }
.related-grid .arr { flex: none; color: hsl(var(--muted-foreground)); }
@media (max-width: 780px) { .related-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .related-grid { grid-template-columns: 1fr; } }

/* blog list + articles */
.cards { max-width: 52rem; margin: 2.5rem auto 0; display: grid; gap: 1rem; }
.card-post { display: block; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); padding: 1.5rem 1.6rem; transition: box-shadow .18s, transform .18s; }
.card-post:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-post h2 { font-size: 1.35rem; line-height: 1.2; margin: .5rem 0 .6rem; }
.card-post p { color: hsl(var(--muted-foreground)); font-size: .98rem; line-height: 1.6; }
.card-more { display: inline-block; margin-top: .9rem; font-weight: 600; font-size: .92rem; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; font-size: .82rem; color: hsl(var(--muted-foreground)); margin-bottom: 1.1rem; }
.post-meta .cat { display: inline-flex; align-items: center; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: hsl(var(--foreground)); background: hsl(var(--accent) / .35); padding: .3rem .6rem; border-radius: 9999px; border: 0; box-shadow: none; }
.post { padding: 2.5rem 1.5rem 1rem; }
.post-head { max-width: 48rem; margin: 0 auto; }
h1.post-title { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.05; margin-bottom: 1rem; }
.post-excerpt { font-size: 1.15rem; line-height: 1.6; color: hsl(var(--muted-foreground)); }
.post-body { max-width: 44rem; margin: 2.5rem auto 0; padding-bottom: 3rem; }
.post-body h2 { font-size: 1.6rem; margin: 2.6rem 0 .9rem; line-height: 1.2; }
.post-body p { font-size: 1.03rem; line-height: 1.72; margin-bottom: 1.1rem; color: hsl(40 8% 20%); }
.post-body p.lead { font-size: 1.15rem; line-height: 1.65; color: hsl(var(--foreground)); }
.post-body ul { margin: 0 0 1.3rem 1.15rem; }
.post-body li { list-style: disc; font-size: 1.02rem; line-height: 1.65; margin-bottom: .55rem; color: hsl(40 8% 20%); }
.post-body a:not(.btn) { text-decoration: underline; text-decoration-color: hsl(var(--accent)); text-underline-offset: 3px; }
.post-cta { margin-top: 2.25rem; }
@media (max-width: 640px) { .post-body h2 { font-size: 1.35rem; } }

/* memo */
.memo-shell { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 1.5rem; display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 4.5rem; align-items: start; }
@media (max-width: 1080px) { .memo-shell { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.toc { position: sticky; top: 6.75rem; padding: 3.25rem 0 4rem; max-height: calc(100vh - 8.5rem); overflow-y: auto; }
@media (max-width: 1080px) { .toc { display: none; } }
.toc-label { font-size: .66rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: hsl(var(--muted-foreground)); padding-left: 1.15rem; margin-bottom: 1.05rem; }
.toc ol, .toc-m ol { counter-reset: toc; }
.toc li, .toc-m li { counter-increment: toc; }
.toc a { display: flex; gap: .75rem; align-items: baseline; padding: .48rem 0 .48rem 1.15rem; border-left: 2px solid hsl(var(--border)); font-size: .93rem; line-height: 1.35; color: hsl(var(--muted-foreground)); transition: color .18s, border-color .18s; }
.toc a::before, .toc-m a::before { content: counter(toc, decimal-leading-zero); flex: none; font-size: .68rem; font-weight: 600; letter-spacing: .06em; opacity: .55; }
.toc a:hover { color: hsl(var(--foreground)); }
.toc a.is-current { color: hsl(var(--foreground)); border-left-color: hsl(var(--foreground)); font-weight: 500; }
.toc a.is-current::before { opacity: 1; }
.toc-m { display: none; margin: 2rem 0 0; border: 1px solid hsl(var(--border)); border-radius: .75rem; background: hsl(var(--card)); font-family: var(--font-body); }
@media (max-width: 1080px) { .toc-m { display: block; } }
.toc-m > summary { list-style: none; cursor: pointer; padding: .85rem 1.1rem; font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.toc-m > summary::-webkit-details-marker { display: none; }
.toc-m ol { padding: 0 1.1rem 1rem; }
.toc-m a { display: flex; gap: .7rem; padding: .45rem 0; font-size: .95rem; color: hsl(var(--muted-foreground)); }
.memo { max-width: 40rem; padding-bottom: 6rem; font-family: var(--font-text); font-size: 1.19rem; line-height: 1.72; }
.memo-head { padding: 3.5rem 0 0; }
.kicker { font-family: var(--font-body); font-size: .68rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: hsl(var(--muted-foreground)); display: flex; align-items: center; gap: .7rem; }
.kicker::before { content: ""; width: .42rem; height: .42rem; border-radius: 9999px; background: hsl(var(--accent)); box-shadow: 0 0 0 3px hsl(var(--accent) / .22); }
.memo-title { font-family: var(--font-text); font-weight: 500; font-size: clamp(2.7rem, 6.6vw, 4.5rem); line-height: 1.02; letter-spacing: -0.018em; margin: 1.5rem 0 0; }
.memo-rule { width: 3.5rem; height: 2px; background: hsl(var(--accent)); margin: 1.6rem 0 0; }
.memo-sub { font-family: var(--font-text); font-style: italic; font-size: clamp(1.2rem, 2.7vw, 1.62rem); line-height: 1.35; color: hsl(var(--muted-foreground)); margin: 1.5rem 0 0; }
.memo-by { display: flex; flex-wrap: wrap; gap: .55rem 1.5rem; margin: 2.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid hsl(var(--border)); font-family: var(--font-body); font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.memo-by .who { color: hsl(var(--foreground)); }
.chapter { padding-top: 4rem; scroll-margin-top: 6.5rem; }
.chapter-num { font-family: var(--font-body); font-size: .67rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: hsl(var(--muted-foreground)); display: flex; align-items: center; gap: .9rem; }
.chapter-num::after { content: ""; flex: 1; height: 1px; background: hsl(var(--border)); }
.chapter h2 { font-family: var(--font-text); font-weight: 500; font-size: clamp(1.95rem, 3.7vw, 2.6rem); line-height: 1.1; letter-spacing: -0.014em; margin: 1rem 0 1.7rem; }
.memo p { margin: 0 0 1.35rem; }
.memo strong { font-weight: 600; }
.memo blockquote { margin: 2.6rem 0; padding: .2rem 0 .2rem 1.7rem; border-left: 2px solid hsl(var(--accent)); font-size: 1.46rem; line-height: 1.42; font-style: italic; }
.memo blockquote p { margin: 0; }
.memo-open::first-letter { float: left; font-size: 3.9em; line-height: .82; font-weight: 500; padding: .04em .085em 0 0; }
.memo-end { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid hsl(var(--border)); font-family: var(--font-body); font-size: .9rem; color: hsl(var(--muted-foreground)); }
.memo-end a { color: hsl(var(--foreground)); border-bottom: 1px solid hsl(var(--accent)); }
@media (max-width: 640px) { .memo { font-size: 1.12rem; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, ::before, ::after { transition-duration: .01ms !important; } }
