/* aisan-ocr explainer site — self-contained, no build step */
:root {
  --teal: #0f9b8e;
  --teal-d: #0b7a70;
  --coral: #ff6b5b;
  --navy: #1b2a4a;
  --navy-2: #2c3e64;
  --cream: #fff7ee;
  --paper: #ffffff;
  --ink: #25303f;
  --muted: #6b7889;
  --line: #e7e3da;
  --ok: #2b9d6e;
  --warn: #e8a13a;
  --bad: #e0564a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(27, 42, 74, .08);
  --shadow-lg: 0 24px 60px rgba(27, 42, 74, .16);
  --maxw: 1080px;
  --font: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background: var(--cream); line-height: 1.75; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-d); }
h1, h2, h3 { line-height: 1.35; color: var(--navy); font-weight: 800; letter-spacing: .01em; }
section { padding: 84px 0; }
.wrap { width: 92%; max-width: var(--maxw); margin: 0 auto; }
.en { color: var(--muted); font-weight: 600; font-size: .8em; letter-spacing: .08em; text-transform: uppercase; }

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px);
  background: rgba(255, 247, 238, .85); border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { font-weight: 900; color: var(--navy); font-size: 1.05rem; margin-right: auto; display: flex; align-items: center; gap: 9px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(255, 107, 91, .18); }
.nav a.link { color: var(--navy-2); text-decoration: none; font-weight: 700; font-size: .92rem; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav a.link:hover, .nav a.link.active { color: var(--teal-d); border-color: var(--teal); }
.nav .menu { display: flex; gap: 18px; }
@media (max-width: 800px) { .nav .menu { display: none; } }

/* ---- hero ---- */
.hero {
  background: radial-gradient(1200px 500px at 80% -10%, rgba(15, 155, 142, .18), transparent 60%),
              radial-gradient(900px 500px at 0% 110%, rgba(255, 107, 91, .14), transparent 55%),
              linear-gradient(180deg, #fffdf9, var(--cream));
  padding: 96px 0 72px;
}
.hero .grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 2.7rem; margin: 10px 0 18px; }
.hero h1 .hl { color: var(--teal-d); }
.hero p.lead { font-size: 1.15rem; color: var(--navy-2); margin: 0 0 26px; }
.hero .pill { display: inline-block; background: #fff; border: 1px solid var(--line); color: var(--teal-d); font-weight: 800; font-size: .82rem; padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow); }
.hero .art img { border-radius: 22px; box-shadow: var(--shadow-lg); background: #fff; }
.hero .stats { display: flex; gap: 26px; margin-top: 30px; flex-wrap: wrap; }
.hero .stats .s b { display: block; font-size: 1.7rem; color: var(--navy); font-weight: 900; }
.hero .stats .s span { font-size: .82rem; color: var(--muted); font-weight: 700; }
@media (max-width: 820px) { .hero .grid { grid-template-columns: 1fr; } .hero h1 { font-size: 2.1rem; } }

/* ---- generic ---- */
.kicker { color: var(--coral); font-weight: 900; letter-spacing: .12em; font-size: .8rem; text-transform: uppercase; margin: 0 0 8px; }
.h2 { font-size: 2rem; margin: 0 0 14px; }
.sub { color: var(--muted); font-size: 1.05rem; max-width: 720px; margin: 0 0 40px; }
.alt { background: linear-gradient(180deg, #fff, #fffdf9); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---- problem cards ---- */
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: center; }
@media (max-width: 800px) { .cols3 { grid-template-columns: 1fr; } .cols2 { grid-template-columns: 1fr; } }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card h3 { margin: 6px 0 8px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--navy-2); font-size: .96rem; }
.ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: rgba(15, 155, 142, .12); }

/* ---- pipeline strip ---- */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 10px; }
.flow .node { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 16px; text-align: center; box-shadow: var(--shadow); position: relative; }
.flow .node .big { font-size: 1.8rem; }
.flow .node b { display: block; margin-top: 6px; color: var(--navy); }
.flow .node span { font-size: .85rem; color: var(--muted); }
.flow .node:not(:last-child)::after { content: "→"; position: absolute; right: -12px; top: 50%; transform: translateY(-50%); color: var(--teal); font-weight: 900; z-index: 2; }
@media (max-width: 800px) { .flow { grid-template-columns: 1fr 1fr; } .flow .node:not(:last-child)::after { display: none; } }

/* ---- step blocks ---- */
.step { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; margin-bottom: 72px; }
.step:nth-child(even) .txt { order: 2; }
.step .num { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; color: var(--coral); letter-spacing: .1em; font-size: .82rem; text-transform: uppercase; margin-bottom: 8px; }
.step .num .b { width: 30px; height: 30px; border-radius: 9px; background: var(--coral); color: #fff; display: grid; place-items: center; font-size: 1rem; }
.step h3 { font-size: 1.5rem; margin: 0 0 6px; }
.step h3 small { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .1em; font-weight: 700; margin-top: 4px; }
.step p { color: var(--navy-2); margin: 0 0 14px; }
.step .vis { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.step .vis img { border-radius: 9px; cursor: zoom-in; }
.step .vis .cap { font-size: .82rem; color: var(--muted); text-align: center; margin-top: 10px; font-weight: 600; }
.vis.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
.vis.split .cap { grid-column: 1 / -1; }
@media (max-width: 800px) { .step { grid-template-columns: 1fr; gap: 22px; } .step:nth-child(even) .txt { order: 0; } }

/* ---- callout / chips ---- */
.note { border-left: 4px solid var(--teal); background: rgba(15, 155, 142, .07); padding: 12px 16px; border-radius: 0 10px 10px 0; font-size: .92rem; color: var(--navy-2); margin: 14px 0; }
.note.warn { border-color: var(--warn); background: rgba(232, 161, 58, .1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; font-size: .82rem; font-weight: 700; color: var(--navy-2); }
.chip.ok { color: var(--ok); border-color: rgba(43, 157, 110, .4); background: rgba(43, 157, 110, .07); }
.chip.warn { color: #b97713; border-color: rgba(232, 161, 58, .45); background: rgba(232, 161, 58, .1); }

/* ---- dev appendix (details) ---- */
details.dev { margin-top: 16px; border: 1px dashed var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
details.dev > summary { cursor: pointer; padding: 12px 16px; font-weight: 800; color: var(--navy-2); font-size: .9rem; list-style: none; display: flex; align-items: center; gap: 8px; user-select: none; }
details.dev > summary::-webkit-details-marker { display: none; }
details.dev > summary::before { content: "‹/›"; font-family: ui-monospace, monospace; color: var(--teal); font-weight: 900; }
details.dev > summary::after { content: "技術メモを開く"; margin-left: auto; font-size: .76rem; color: var(--muted); font-weight: 700; }
details.dev[open] > summary::after { content: "閉じる"; }
details.dev .body { padding: 4px 18px 18px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--navy-2); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: rgba(27, 42, 74, .06); padding: 1px 6px; border-radius: 5px; color: var(--navy); }

/* ---- example end-to-end ---- */
.ex { background: var(--navy); color: #e8edf6; }
.ex h2, .ex h3 { color: #fff; }
.ex .sub { color: #aab6cf; }
.ex .board { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 18px; align-items: stretch; }
.ex .panel { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 14px; }
.ex .panel h4 { margin: 0 0 10px; color: #cdd7ea; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.ex .panel img { border-radius: 8px; cursor: zoom-in; }
.ex .arrow { align-self: center; text-align: center; color: var(--teal); font-weight: 900; font-size: 1.4rem; }
@media (max-width: 800px) { .ex .board { grid-template-columns: 1fr; } }
table.data { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.data th, table.data td { text-align: left; padding: 7px 9px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
table.data th { color: #9fb0d0; font-weight: 700; }
table.data .y { color: #ffd9a8; font-weight: 700; }
.kv { list-style: none; padding: 0; margin: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed rgba(255, 255, 255, .12); font-size: .9rem; }
.kv li span { color: #9fb0d0; }
.kv li b { color: #fff; font-weight: 700; }

/* ---- timeline ---- */
.tl { position: relative; margin-top: 30px; padding-left: 30px; }
.tl::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 3px; background: linear-gradient(var(--teal), var(--coral)); border-radius: 3px; }
.tl .item { position: relative; margin-bottom: 26px; }
.tl .item::before { content: ""; position: absolute; left: -29px; top: 4px; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 3px solid var(--teal); }
.tl .item.done::before { background: var(--teal); }
.tl .item h4 { margin: 0 0 4px; color: var(--navy); font-size: 1.08rem; }
.tl .item .tag { font-size: .72rem; font-weight: 800; color: var(--ok); letter-spacing: .08em; }
.tl .item p { margin: 4px 0 0; color: var(--navy-2); font-size: .94rem; }

/* ---- appendix tables ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.tbl th, .tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { background: #f6f2ea; color: var(--navy); font-weight: 800; font-size: .82rem; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td.mono { background: transparent; }
.codeblock { background: #14203a; color: #d7e2f5; border-radius: 12px; padding: 18px 20px; overflow-x: auto; font-family: ui-monospace, monospace; font-size: .84rem; line-height: 1.7; box-shadow: var(--shadow); }
.codeblock .c { color: #7d93b8; }
.codeblock .k { color: #ffb38a; }

/* ---- footer ---- */
.foot { background: #14203a; color: #aeb9d0; padding: 44px 0; text-align: center; font-size: .9rem; }
.foot a { color: #8fd6cd; }
.foot .links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }

/* ---- lightbox ---- */
.lb { position: fixed; inset: 0; background: rgba(12, 18, 33, .9); display: none; place-items: center; z-index: 100; padding: 30px; cursor: zoom-out; }
.lb.on { display: grid; }
.lb img { max-width: 95%; max-height: 92vh; border-radius: 10px; box-shadow: var(--shadow-lg); }
.placeholder { display: grid; place-items: center; aspect-ratio: 4/3; background: repeating-linear-gradient(45deg, #f3eee4, #f3eee4 12px, #ece6da 12px, #ece6da 24px); color: var(--muted); border-radius: 9px; font-size: .85rem; font-weight: 700; }
