/* AI STUDY v3.1.0 — SITEWIDE ART DIRECTION */
:root{--v31-ink:#111;--v31-paper:#f5edcf;--v31-red:#d9382f;--v31-blue:#176eb5;--v31-acid:#dfff32;--v31-rule:rgba(17,17,17,.14)}
body:not(.home){background:#f8f6ef;color:var(--v31-ink)}
body:not(.home) main{position:relative;isolation:isolate}
body:not(.home) main:before{content:"";position:fixed;inset:0;z-index:-2;pointer-events:none;opacity:.12;background-image:linear-gradient(90deg,transparent 49.8%,rgba(0,0,0,.035) 50%,transparent 50.2%),repeating-linear-gradient(0deg,transparent 0 31px,rgba(20,20,20,.06) 32px 33px)}
.aist-v31-scene{position:relative;overflow:hidden;border-bottom:1px solid #111;padding:clamp(7rem,12vw,11rem) 5vw clamp(4rem,8vw,8rem);background:var(--v31-paper)}
.aist-v31-scene__kicker{display:inline-block;font:900 .75rem/1 monospace;letter-spacing:.16em;border:2px solid;padding:.45rem .65rem;background:#fff;transform:rotate(-2deg)}
.aist-v31-scene h1{position:relative;z-index:2;max-width:1200px;margin:.25em 0 .12em;font-size:clamp(4rem,12vw,12rem);line-height:.78;letter-spacing:-.095em;font-weight:1000}
.aist-v31-scene p{position:relative;z-index:2;max-width:760px;font-weight:700;line-height:1.9}
.aist-v31-ghost{position:absolute;right:-.04em;bottom:-.24em;font:1000 clamp(10rem,30vw,34rem)/.7 Arial Black,sans-serif;letter-spacing:-.13em;opacity:.055;pointer-events:none}
.aist-v31-stamp{position:absolute;right:7vw;top:26%;z-index:3;border:5px double currentColor;border-radius:50%;padding:1.1rem .8rem;color:var(--v31-red);font-weight:1000;transform:rotate(12deg);background:rgba(245,237,207,.9)}
.aist-v31-stamp:before,.aist-v31-stamp:after{content:"★";margin:0 .25em}.aist-v31-pencil{position:absolute;left:-8vw;bottom:9%;width:52vw;height:7px;background:var(--v31-blue);transform:rotate(-4deg);box-shadow:0 13px 0 var(--v31-red);opacity:.8}

/* generic content pages: retro editorial, not theme-template blandness */
.aist-page-main .aist-pagehead{max-width:none!important;margin:0!important;padding:clamp(8rem,14vw,13rem) 6vw 5rem!important;background:var(--v31-paper);border-bottom:1px solid #111;position:relative;overflow:hidden}
.aist-page-main .aist-pagehead:before{content:"AI STUDY / NOTE 01";display:inline-block;border:2px solid;padding:.4rem .6rem;font:900 .72rem monospace;transform:rotate(-2deg);background:#fff}
.aist-page-main .aist-pagehead h1{max-width:1100px;font-size:clamp(3.8rem,10vw,10rem)!important;line-height:.82!important;letter-spacing:-.09em!important;margin:.25em 0!important}
.aist-page-main .aist-pagehead__mascot{position:absolute!important;right:4vw;bottom:-3rem;max-width:min(32vw,380px);transform:rotate(6deg)}
.aist-page-main .aist-pagebody{max-width:980px;margin:0 auto;padding:clamp(3rem,7vw,7rem) 5vw!important;background:#fff;box-shadow:0 0 0 1px #111}
.aist-page-main .aist-pagebody h2{font-size:clamp(2rem,5vw,4.5rem);line-height:.95;letter-spacing:-.06em;border-top:7px solid #111;padding-top:.35em;margin-top:1.6em}
.aist-page-main .aist-pagebody h3{font-size:clamp(1.35rem,2.5vw,2rem);border-left:7px solid var(--v31-red);padding-left:.65em}

/* MATH WORLD — graph paper / geometry / red pencil */
.aist-world-math{--world:#ffdf31;--world2:#146fb7;background:#fffdf3}
.aist-world-math .aist-pagehead,.aist-world-math .aist-v31-scene{background-color:#fffdf3;background-image:linear-gradient(rgba(23,110,181,.12) 1px,transparent 1px),linear-gradient(90deg,rgba(23,110,181,.12) 1px,transparent 1px);background-size:28px 28px}
.aist-world-math .aist-pagehead:after{content:"△  ○  □  7×8=?";position:absolute;right:3vw;top:25%;font-size:clamp(3rem,8vw,8rem);font-weight:1000;color:var(--v31-blue);opacity:.22;transform:rotate(-8deg)}
.aist-world-math .aist-pagebody h2{border-color:var(--v31-blue)}
.aist-world-math .aist-pagebody h2:after{content:" できた？";font-size:.28em;color:var(--v31-red);font-family:cursive;letter-spacing:0}

/* TAKKEN WORLD — prep school / exam ticket / law books */
.aist-world-takken{--world:#e23b31;--world2:#111;background:#eee9db}
.aist-world-takken:not(.page-template-page-takken) .aist-pagehead{background:#e8e1ce;color:#111;border-bottom:8px solid #111}
.aist-world-takken:not(.page-template-page-takken) .aist-pagehead:after{content:"受験番号  0001 / 合格圏内まであと少し";position:absolute;right:4vw;top:22%;padding:1rem;border:3px solid #111;background:#fff;font:900 clamp(.75rem,1.5vw,1rem) monospace;transform:rotate(2deg)}
.page-template-page-takken .tkcv-hero:before{content:"宅建 / 受験票";position:absolute;left:4vw;top:7rem;z-index:8;padding:.5rem .7rem;border:2px solid currentColor;background:#f4ead0;font:900 .72rem monospace;transform:rotate(-3deg)}
.page-template-page-takken .tkcv-sectionnum{font-family:Impact,"Arial Narrow",sans-serif!important;text-shadow:4px 4px 0 rgba(217,56,47,.18)}
.page-template-page-takken .tkcv-problemgrid article,.page-template-page-takken .tkcv-featurelist article{border-radius:0!important;box-shadow:7px 7px 0 #111!important}
.page-template-page-takken .tkcv-kicker{font-family:monospace!important;letter-spacing:.12em}
.page-template-page-takken .tkcv-try:after{content:"採点";position:absolute;right:7vw;top:8%;border:7px double #d9382f;border-radius:50%;padding:1.1rem;color:#d9382f;font-weight:1000;font-size:2rem;transform:rotate(13deg)}

/* KANJI WORLD — genkouyoushi / brush / drill book */
.aist-world-kanji{background:#f7f0dc}
.aist-world-kanji .aist-pagehead{background:#f7f0dc;background-image:linear-gradient(#d6bda4 1px,transparent 1px),linear-gradient(90deg,#d6bda4 1px,transparent 1px);background-size:56px 56px}
.aist-world-kanji .aist-pagehead:after{content:"鬱\A薔\A薇";white-space:pre;position:absolute;right:7vw;top:12%;font-family:serif;font-size:clamp(4rem,9vw,9rem);font-weight:900;line-height:.75;opacity:.14;transform:rotate(4deg)}
.aist-world-kanji .aist-pagebody{font-family:"Zen Kaku Gothic New",sans-serif}
.aist-world-kanji .aist-pagebody h2{font-family:serif;border-color:#111}
.aist-world-kanji .aist-pagebody h3{border-color:#111}

/* LAW WORLD — quiet old statute book; deliberately calmer */
.aist-world-law{background:#f3f0e8!important}
.aist-world-law main:before{opacity:.035!important;background-image:repeating-linear-gradient(0deg,transparent 0 39px,rgba(0,0,0,.08) 40px 41px)!important}
.aist-world-law .aist-law-parent-page{background:#f3f0e8}
.aist-world-law .aist-law-parent-page>.aist-wrap{max-width:1120px}
.aist-world-law .aist-law-hero{position:relative;border-top:9px double #222;border-bottom:1px solid #222;margin-top:2rem;padding-left:clamp(0px,3vw,32px)!important}
.aist-world-law .aist-law-hero:after{content:"DIGITAL LAW / VERIFIED TEXT";position:absolute;right:0;top:1rem;font:800 .65rem monospace;letter-spacing:.12em;color:#6b6256}
.aist-world-law .aist-law-hero h1{font-family:serif!important;letter-spacing:-.035em!important}
.aist-world-law .aist-law-block{background:#fffdf8;border-radius:0!important;border:1px solid #d8d1c4!important;box-shadow:none!important}
.aist-world-law .aist-law-block>span{font-family:monospace;letter-spacing:.14em}
.aist-world-law .aist-law-quicknav{border-radius:0!important;box-shadow:4px 4px 0 rgba(0,0,0,.08)!important}
.aist-world-law .aist-law-quicknav a,.aist-world-law .aist-law-toc a{border-radius:2px!important}

/* EDITORIAL / COLUMN — magazine */
.aist-world-editorial:not(.aist-world-law) .aist-hero{position:relative;max-width:none!important;padding:clamp(8rem,13vw,12rem) max(5vw,calc((100vw - 1180px)/2)) 5rem!important;background:#111;color:#fff;overflow:hidden}
.aist-world-editorial:not(.aist-world-law) .aist-hero:after{content:"READ / THINK / TRY";position:absolute;right:-.04em;bottom:-.18em;font:1000 clamp(5rem,16vw,16rem)/.8 Impact,sans-serif;opacity:.11;white-space:nowrap}
.aist-world-editorial:not(.aist-world-law) .aist-hero h1{max-width:1050px;font-size:clamp(3rem,7vw,7rem)!important;line-height:.92!important;letter-spacing:-.07em!important}
.aist-world-editorial:not(.aist-world-law) .aist-layout{padding-top:clamp(3rem,6vw,6rem)}
.aist-world-editorial:not(.aist-world-law) .aist-article{background:#fff;border-top:8px solid #111;padding:clamp(1.5rem,4vw,4rem)}
.aist-world-editorial:not(.aist-world-law) .aist-entry h2{font-size:clamp(2rem,4.5vw,4rem);letter-spacing:-.055em;line-height:1;border-top:1px solid #111;padding-top:.55em}

/* ARCHIVE / SEARCH — newspaper racks */
.aist-world-archive .aist-cathead,.aist-world-search .aist-cathead{max-width:none!important;padding:clamp(8rem,12vw,11rem) max(5vw,calc((100vw - 1180px)/2)) 4rem!important;background:var(--v31-paper);border-bottom:1px solid #111}
.aist-world-archive .aist-cathead h1,.aist-world-search .aist-cathead h1{font-size:clamp(3.5rem,9vw,9rem)!important;line-height:.82;letter-spacing:-.085em}
.aist-world-archive .aist-cardgrid,.aist-world-search .aist-cardgrid{grid-template-columns:repeat(12,1fr)!important;gap:1.2rem!important}
.aist-world-archive .aist-card,.aist-world-search .aist-card{grid-column:span 4;border-radius:0!important;border:1px solid #111!important;box-shadow:6px 6px 0 #111!important;background:#fff;transform:rotate(var(--r,0deg))}
.aist-world-archive .aist-card:nth-child(3n+1),.aist-world-search .aist-card:nth-child(3n+1){--r:-.6deg}.aist-world-archive .aist-card:nth-child(3n+2),.aist-world-search .aist-card:nth-child(3n+2){--r:.45deg}
.aist-world-archive .aist-card__body>span,.aist-world-search .aist-card__body>span{font-family:monospace;font-weight:900}
.aist-world-search .aist-empty{border:4px dashed #111;background:#fff;padding:clamp(2rem,7vw,6rem);transform:rotate(-.6deg)}

/* TRUST pages — office stationery, quieter */
.aist-trust-main{background:#f6f2e7}
.aist-trust-hero{border-bottom:1px solid #111!important;background:#f6f2e7!important}
.aist-trust-hero__copy h1{font-size:clamp(3.5rem,9vw,8rem)!important;letter-spacing:-.075em!important}
.aist-trust-content__rail{font-family:monospace}
.aist-trust-article{background:#fff;border:1px solid #111;box-shadow:8px 8px 0 rgba(0,0,0,.12)}

/* 404 — deliberately ridiculous */
.aist-world-404{background:var(--v31-acid)!important}
.aist-world-404 .aist-404{min-height:100vh;max-width:none!important;padding:clamp(9rem,14vw,13rem) 6vw 5rem!important;display:grid!important;grid-template-columns:1fr .55fr;align-items:center;overflow:hidden}
.aist-world-404 .aist-404:before{content:"0点";position:absolute;right:3vw;top:12%;font-size:clamp(8rem,25vw,27rem);font-weight:1000;color:#d9382f;opacity:.18;transform:rotate(12deg)}
.aist-world-404 .aist-404 h1{font-size:clamp(5rem,13vw,13rem)!important;line-height:.72!important;letter-spacing:-.11em!important}
.aist-world-404 .aist-404 h1:after{content:"このページ、勉強サボってどっか行きました。";display:block;margin-top:1.5rem;font-size:clamp(1rem,2vw,1.6rem);line-height:1.5;letter-spacing:0;font-family:monospace;background:#fff;padding:.7rem 1rem;width:max-content;max-width:80vw;transform:rotate(-2deg)}
.aist-world-404 .aist-404 svg{filter:drop-shadow(10px 10px 0 #fff);transform:rotate(8deg)}

/* footer/header cohesion */
body:not(.home) .aist3-header{mix-blend-mode:normal}
body:not(.home) .site-logo small{font-family:monospace}
.site-footer{position:relative;overflow:hidden}
.site-footer:after{content:"AI STUDY";position:absolute;right:-.04em;bottom:-.24em;font:1000 clamp(7rem,18vw,20rem)/.8 Arial Black,sans-serif;opacity:.045;pointer-events:none}

@media(max-width:900px){.aist-world-archive .aist-card,.aist-world-search .aist-card{grid-column:span 6}.aist-v31-stamp{right:3vw}.aist-world-404 .aist-404{grid-template-columns:1fr}.aist-world-404 .aist-404 svg{max-width:55vw;justify-self:end}.aist-page-main .aist-pagehead__mascot{opacity:.35}}
@media(max-width:640px){body:not(.home) main:before{background-image:repeating-linear-gradient(0deg,transparent 0 27px,rgba(20,20,20,.045) 28px 29px)}.aist-page-main .aist-pagehead{padding:7.5rem 5vw 3rem!important}.aist-page-main .aist-pagehead h1{font-size:clamp(3.1rem,17vw,6rem)!important}.aist-page-main .aist-pagehead__mascot{right:-10vw;max-width:60vw}.aist-world-math .aist-pagehead:after,.aist-world-kanji .aist-pagehead:after,.aist-world-takken:not(.page-template-page-takken) .aist-pagehead:after{opacity:.12;right:-6vw}.aist-world-editorial:not(.aist-world-law) .aist-hero{padding-top:7.5rem!important}.aist-world-editorial:not(.aist-world-law) .aist-hero h1{font-size:clamp(2.8rem,13vw,5rem)!important}.aist-world-archive .aist-cathead,.aist-world-search .aist-cathead{padding-top:7.5rem!important}.aist-world-archive .aist-cardgrid,.aist-world-search .aist-cardgrid{display:block!important}.aist-world-archive .aist-card,.aist-world-search .aist-card{margin-bottom:1.4rem;transform:none}.aist-world-404 .aist-404{padding-top:8rem!important}.aist-world-404 .aist-404 h1{font-size:clamp(4.5rem,23vw,8rem)!important}.aist-world-404 .aist-404 h1:after{max-width:88vw;font-size:.9rem}.aist-world-law .aist-law-hero:after{position:static;display:block;margin-top:1rem}.page-template-page-takken .tkcv-hero:before{top:5.5rem;left:5vw}.page-template-page-takken .tkcv-try:after{font-size:1rem;border-width:4px}}
@media(prefers-reduced-motion:reduce){.aist-v31-stamp,.aist-page-main .aist-pagehead__mascot,.aist-world-archive .aist-card,.aist-world-search .aist-card,.aist-world-404 .aist-404 svg{transform:none!important}.aist-v31-pencil{display:none}}
