/* dukiLab. — デザインシステム「dukiLab.」準拠のスタイル
   モノクロ・直角＋左上45°の三角・方眼。トークンはデザインシステムの tokens.json と同じ値。 */

@import url("https://fonts.googleapis.com/css2?family=M+PLUS+1+Code:wght@400;500;700&family=M+PLUS+2:wght@400;500;700;800&display=swap");

/* === トークン === */
:root {
    color-scheme: light dark;

    --surface: #f6f8f9;
    --surface-raised: #ffffff;
    --surface-sunken: #e9edf0;
    --grid: #e1e6ea;
    --line: #c5ced6;
    --line-strong: #6b7680;
    --ink: #0b0e11;
    --ink-muted: #525d67;
    --inverse-surface: var(--ink);
    --inverse-ink: var(--surface);
    --corner-mark: var(--ink);
    --focus-ring: var(--ink);
    --logo-ink: #000000;
    --header-bar: #0b0e11;
    --header-bar-ink: #eef2f5;
    --header-logo-bg: #ffffff;

    --font-sans: "M PLUS 2", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
    --font-mono: "M PLUS 1 Code", ui-monospace, "SFMono-Regular", monospace;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    --radius-none: 0px;
    --cut-sm: 8px;
    --cut-md: 12px;
    --cut-lg: 32px;
    --grid-cell: 16px;
    --border-hair: 1px;
    --border-strong: 2px;

    --page-max: 1120px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #0d1013;
        --surface-raised: #161a1e;
        --surface-sunken: #1c2126;
        --grid: #1b2026;
        --line: #333b43;
        --line-strong: #7d8892;
        --ink: #eef2f5;
        --ink-muted: #9ca7b1;
        --logo-ink: #ffffff;
    }
}

/* === 土台 === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 28px;
    font-weight: 400;
}

main { flex: 1; }

/* 日本語の組版: 見出しは行の長さをそろえ、本文は文節の途中で折り返さない */
h1, h2, h3, .hero__title, .page-head__title, .section__title, .card__title, .band__title, .article-section__title { text-wrap: balance; }
p, li, dd, dt, td, th, figcaption { word-break: auto-phrase; }

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

a { color: inherit; }

:focus-visible { outline: var(--border-strong) solid var(--focus-ring); outline-offset: 2px; }

.wrap {
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* 外部リンクの印 */
a[target="_blank"]::after {
    content: "↗";
    display: inline-block;
    margin-left: 0.2em;
    font-family: var(--font-mono);
    font-size: 0.8em;
    line-height: 1;
}

/* === パーツ（デザインシステムの bundle.css より） === */

/* 左上の45°三角マーク */
.dl-cut { position: relative; }
.dl-cut::before {
    content: ""; position: absolute; top: 0; left: 0; z-index: 1;
    width: var(--dl-cut, var(--cut-md)); height: var(--dl-cut, var(--cut-md));
    background: var(--dl-cut-color, var(--corner-mark));
    clip-path: polygon(0 0, 100% 0, 0 100%);
    pointer-events: none;
}

/* 方眼の地 */
.dl-grid {
    background-color: var(--surface);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: var(--dl-grid-cell, var(--grid-cell)) var(--dl-grid-cell, var(--grid-cell));
    background-position: -1px -1px;
}

/* タグ：分類と通し番号 */
.dl-tag {
    display: inline-block; font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 500;
    letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted);
}

/* カード */
.dl-card {
    --dl-cut: var(--cut-md);
    display: block;
    background: var(--surface-raised); color: var(--ink);
    border: var(--border-hair) solid var(--line); border-radius: var(--radius-none);
    padding: var(--space-4) var(--space-5) var(--space-5);
    text-decoration: none;
}
.dl-card--inverse { background: var(--inverse-surface); color: var(--inverse-ink); border-color: var(--inverse-surface); --dl-cut-color: var(--surface); }
.dl-card--inverse .dl-tag { color: var(--inverse-ink); }

/* ボタン */
.dl-btn {
    --dl-cut: var(--cut-sm);
    position: relative; display: inline-flex; align-items: center; gap: var(--space-2);
    font-family: var(--font-sans); font-size: 15px; line-height: 20px; font-weight: 700; text-decoration: none;
    padding: var(--space-3) var(--space-5); border-radius: var(--radius-none); cursor: pointer;
    background: var(--inverse-surface); color: var(--inverse-ink); border: var(--border-strong) solid var(--inverse-surface);
    --dl-cut-color: var(--surface);
}
.dl-btn--outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); --dl-cut-color: var(--corner-mark); }
/* 押したときの動き：左上の三角が45°のまま広がり、ボタン全体を白黒反転で覆う */
@property --dl-wipe { syntax: "<length>"; inherits: false; initial-value: 8px; }
.dl-btn.dl-cut { isolation: isolate; overflow: hidden; }
.dl-btn.dl-cut::before {
    inset: 0; width: auto; height: auto;
    background: #fff; mix-blend-mode: difference;
    --dl-wipe: var(--dl-cut);
    clip-path: polygon(0 0, var(--dl-wipe) 0, 0 var(--dl-wipe));
    transition: --dl-wipe 320ms cubic-bezier(.2, .8, .2, 1);
}
.dl-btn { transition: border-color 120ms ease-out; }
.dl-btn:hover:not(:disabled) { --dl-cut: 14px; }
.dl-btn:active:not(:disabled) { --dl-cut: 400px; }          /* 幅＋高さより大きければ全面を覆う */
.dl-btn:active:not(:disabled)::before { transition-duration: 240ms; transition-timing-function: cubic-bezier(.4, 0, .2, 1); }
.dl-btn--outline:hover:not(:disabled) { border-color: var(--ink); }
/* 押せないボタン：動かさず、三角は線の色で塗る (デザインCI) */
.dl-btn:disabled { color: var(--ink-muted); background: var(--surface-sunken); border-color: var(--line); cursor: not-allowed; --dl-cut-color: var(--line); }
.dl-btn:disabled::before { mix-blend-mode: normal; background: var(--line); }

@media (prefers-reduced-motion: reduce) {
    .dl-btn.dl-cut::before { transition: none; }
}

/* === ヘッダー：黒 ▶ 右上がりの斜め境界 ▶ 白いロゴ面 ▶ 垂直境界 ▶ 黒いメニュー帯 === */
.dl-header {
    --dl-header-h: 64px;
    position: sticky; top: 0; z-index: 1000;
    display: flex; align-items: stretch; height: var(--dl-header-h);
    padding-left: var(--space-6);
    background: var(--header-bar); color: var(--header-bar-ink);
}
.dl-header__logo {
    flex: none; display: flex; align-items: center;
    padding: 0 var(--space-6) 0 calc(var(--dl-header-h) / 2 + 12px);
    background: var(--header-logo-bg);
    clip-path: polygon(var(--dl-header-h) 0, 100% 0, 100% 100%, 0 100%);
}
.dl-header__logo svg { height: 28px; width: auto; display: block; }
.dl-header__logo:focus-visible { outline: none; box-shadow: inset 0 0 0 var(--border-strong) var(--ink); }
.dl-header__nav {
    flex: 1; display: flex; align-items: center; justify-content: flex-end;
    gap: var(--space-6); padding: 0 var(--space-6);
    list-style: none;
}
.dl-header__nav a {
    color: var(--header-bar-ink); text-decoration: none;
    font-size: 15px; line-height: 20px; font-weight: 500; letter-spacing: .04em;
    padding: var(--space-1) 0; border-bottom: var(--border-strong) solid transparent;
}
.dl-header__nav a:hover, .dl-header__nav a[aria-current="page"] { border-bottom-color: var(--header-bar-ink); }
.dl-header__nav a:focus-visible { outline: var(--border-strong) solid var(--header-bar-ink); outline-offset: 4px; }
.dl-header__menu {
    display: none; background: none;
    border: var(--border-hair) solid var(--header-bar-ink); color: var(--header-bar-ink);
    font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em;
    padding: var(--space-1) var(--space-3); margin: auto var(--space-4) auto auto; cursor: pointer;
}
.dl-header__menu:focus-visible { outline: var(--border-strong) solid var(--header-bar-ink); outline-offset: 2px; }

@media (max-width: 760px) {
    .dl-header { --dl-header-h: 56px; padding-left: var(--space-4); }
    .dl-header__logo { padding-right: var(--space-4); }
    .dl-header__logo svg { height: 22px; }
    .dl-header__menu { display: block; }
    .dl-header__nav {
        display: flex; visibility: hidden; opacity: 0; transform: translateY(-8px);
        transition: opacity 200ms ease-out, transform 200ms ease-out, visibility 0s linear 200ms;
        position: absolute; top: var(--dl-header-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        padding: var(--space-2) var(--space-4) var(--space-4);
        background: var(--header-bar);
        border-top: var(--border-hair) solid #333b43;
    }
    .dl-header.is-open .dl-header__nav { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
    .dl-header__nav a { display: block; padding: var(--space-3) 0; font-size: 16px; }
    .dl-header__nav a:hover, .dl-header__nav a[aria-current="page"] { border-bottom-color: transparent; text-decoration: underline; text-underline-offset: 6px; }
}

/* === ページ見出し（方眼の帯） === */
.page-head {
    border-bottom: var(--border-hair) solid var(--line);
}
.page-head__inner {
    padding-top: var(--space-8);
    padding-bottom: var(--space-7);
}
.page-head__title {
    margin-top: var(--space-2);
    font-size: 36px; line-height: 44px; font-weight: 700;
}
.page-head__sub {
    margin-top: var(--space-2);
    font-family: var(--font-mono); font-size: 14px; line-height: 20px; font-weight: 500;
    color: var(--ink-muted);
}
/* 方眼の上の文字は地色で塗る */
.on-grid > * > span,
.on-grid .paint { background: var(--surface); box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 0 var(--space-1); margin-left: calc(-1 * var(--space-1)); }

/* === トップ：ヒーロー === */
.hero { border-bottom: var(--border-hair) solid var(--line); overflow: hidden; }
.hero__inner {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: var(--space-7); align-items: center;
    padding-top: var(--space-8); padding-bottom: var(--space-8);
}
.hero__title {
    margin-top: var(--space-3);
    font-size: 56px; line-height: 64px; font-weight: 800; letter-spacing: -.01em;
}
.hero__lead {
    margin-top: var(--space-4);
    font-size: 18px; line-height: 30px;
}
.hero__en {
    margin-top: var(--space-2);
    font-family: var(--font-mono); font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink-muted);
}
.hero__actions { margin-top: var(--space-6); display: flex; gap: var(--space-4); flex-wrap: wrap; }

/* 右側：ロゴ由来のブロック構成 */
.hero__art { position: relative; aspect-ratio: 5 / 4; width: 100%; }
.hero__art svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hero__art .ink { fill: var(--ink); }
.hero__art .mid { fill: var(--line-strong); }
.hero__art .muted { fill: var(--ink-muted); }
.hero__art .cutout { fill: var(--surface); }
.hero__art .raised { fill: var(--surface-raised); stroke: var(--line); stroke-width: 1; }
.hero__art .plus { fill: var(--line-strong); }
.hero__art .logo { fill: var(--surface); }

/* === セクション === */
.section { padding: var(--space-8) 0; }
.section + .section { padding-top: 0; }
.section__head {
    display: flex; align-items: end; justify-content: space-between; gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: var(--border-strong) solid var(--ink);
}
.section__title { font-size: 28px; line-height: 36px; font-weight: 700; margin-top: var(--space-1); }
.section__more { font-size: 14px; line-height: 22px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.section__more:hover { text-decoration: underline; text-underline-offset: 4px; }

/* カードの並び */
.cards {
    display: grid; gap: var(--space-5);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card__title { margin-top: var(--space-1); font-size: 20px; line-height: 28px; font-weight: 700; }
.card__text { margin-top: var(--space-1); font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.dl-card--inverse .card__text { color: var(--inverse-ink); }
a.dl-card { transition: border-color 120ms ease-out, transform 150ms ease-out; }
a.dl-card:active { transform: translate(1px, 1px); }
a.dl-card:hover { border-color: var(--ink); }
a.dl-card--inverse:hover { border-color: var(--line-strong); }
.card__go {
    display: inline-block; margin-top: var(--space-4);
    font-family: var(--font-mono); font-size: 12px; line-height: 18px; font-weight: 500; letter-spacing: .06em;
}

/* 製品カード（画像つき） */
.product-card { padding: 0; overflow: hidden; }
.product-card__image {
    aspect-ratio: 16 / 9; width: 100%;
    background: var(--surface-sunken);
    border-bottom: var(--border-hair) solid var(--line);
    overflow: hidden;
}
.product-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 320ms cubic-bezier(.2, .8, .2, 1); }
a.product-card:hover .product-card__image img { transform: scale(1.03); }
.product-card__body { padding: var(--space-4) var(--space-5) var(--space-5); }
.product-card__sub {
    margin-top: var(--space-1);
    font-family: var(--font-mono); font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-muted);
}
@media (prefers-reduced-motion: reduce) {
    .product-card__image img, a.dl-card, .dl-header__nav { transition: none !important; }
    a.dl-card:active { transform: none; }
}

/* 反転帯 */
.band {
    background: var(--inverse-surface); color: var(--inverse-ink);
    --dl-cut: var(--cut-lg); --dl-cut-color: var(--surface);
}
.band__inner {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap;
    padding-top: var(--space-7); padding-bottom: var(--space-7);
}
.band .dl-tag { color: var(--inverse-ink); }
.band__title { margin-top: var(--space-1); font-size: 28px; line-height: 36px; font-weight: 700; }
.band__text { margin-top: var(--space-2); }
.band .dl-btn { background: var(--surface); color: var(--ink); border-color: var(--surface); --dl-cut-color: var(--ink); }

/* === 記事ページ === */
.article { padding: var(--space-7) 0 var(--space-8); }
.article__inner { max-width: 736px; }  /* 本文1行が全角42字ほど */
.article__hero {
    --dl-cut: var(--cut-lg);
    margin-bottom: var(--space-7);
    border: var(--border-hair) solid var(--line);
    background: var(--surface-sunken);
    aspect-ratio: 16 / 9; overflow: hidden;
}
.article__hero img { width: 100%; height: 100%; object-fit: cover; }

.article-section + .article-section { margin-top: var(--space-7); }
.article-section__head {
    display: flex; align-items: baseline; gap: var(--space-3);
    padding-bottom: var(--space-2); margin-bottom: var(--space-4);
    border-bottom: var(--border-hair) solid var(--line);
}
.article-section__no { font-family: var(--font-mono); font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink-muted); }
.article-section__title { font-size: 28px; line-height: 36px; font-weight: 700; }

.prose p + p, .prose p + ul, .prose ul + p, .prose p + ol, .prose ol + p { margin-top: var(--space-3); }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; overflow-wrap: anywhere; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul { list-style: none; margin-top: var(--space-2); }
.prose li { position: relative; padding-left: var(--space-5); }
.prose li::before {
    content: ""; position: absolute; left: 4px; top: 10px;
    width: 8px; height: 8px; background: var(--ink);
    clip-path: polygon(0 0, 100% 0, 0 100%);
}
.prose code { font-family: var(--font-mono); font-size: 14px; background: var(--surface-sunken); padding: 2px 6px; }

.back-link { display: inline-block; margin-top: var(--space-8); }

/* === フッター === */
.site-footer {
    background: var(--header-bar); color: var(--header-bar-ink);
    border-top: var(--border-hair) solid #333b43;
}
.site-footer__inner {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap;
    padding-top: var(--space-6); padding-bottom: var(--space-6);
}
.site-footer__logo svg { height: 24px; width: auto; display: block; }
.site-footer__logo path { fill: #ffffff; }
.site-footer__nav { display: flex; gap: var(--space-5); flex-wrap: wrap; list-style: none; font-size: 14px; line-height: 22px; }
.site-footer__nav a { color: var(--header-bar-ink); text-decoration: none; }
.site-footer__nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-footer__copy { width: 100%; font-family: var(--font-mono); font-size: 12px; line-height: 18px; color: #9ca7b1; letter-spacing: .04em; }
.site-footer a:focus-visible { outline-color: var(--header-bar-ink); }

/* === スマホ === */
@media (max-width: 760px) {
    .wrap { padding-left: var(--space-4); padding-right: var(--space-4); }
    .hero__inner { grid-template-columns: 1fr; gap: var(--space-6); padding-top: var(--space-7); padding-bottom: var(--space-7); }
    .hero__title { font-size: 36px; line-height: 44px; }
    .hero__lead { font-size: 16px; line-height: 28px; }
    .hero__art { max-width: 420px; }
    .page-head__inner { padding-top: var(--space-7); padding-bottom: var(--space-6); }
    .page-head__title { font-size: 28px; line-height: 36px; }
    .section { padding: var(--space-7) 0; }
    .section__title, .band__title, .article-section__title { font-size: 24px; line-height: 32px; }
    .cards { grid-template-columns: 1fr; }
    .article__hero { margin-bottom: var(--space-6); }
}
