/* ==========================================================================
   Koiya International Limited — stylesheet
   Monochrome theme with day / night modes.
   ========================================================================== */

:root{
  --bg:#ffffff;
  --bg-alt:#f5f5f5;
  --surface:#ffffff;
  --fg:#0a0a0a;
  --fg-muted:#585858;
  --line:#dcdcdc;
  --line-strong:#0a0a0a;
  --hero-bg:#0a0a0a;
  --hero-fg:#ffffff;
  --hover:#f0f0f0;
  --shadow:0 6px 24px rgba(0,0,0,.10);
  --radius:2px;
  --maxw:1180px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}

html[data-theme="dark"]{
  --bg:#0b0b0b;
  --bg-alt:#141414;
  --surface:#111111;
  --fg:#f2f2f2;
  --fg-muted:#a6a6a6;
  --line:#2a2a2a;
  --line-strong:#f2f2f2;
  --hero-bg:#141414;
  --hero-fg:#ffffff;
  --hover:#1c1c1c;
  --shadow:0 6px 24px rgba(0,0,0,.6);
}

*,*::before,*::after{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;}
body{
  margin:0;
  font-family:var(--font);
  font-size:16px;
  line-height:1.65;
  color:var(--fg);
  background:var(--bg);
  transition:background .25s ease,color .25s ease;
}
img{max-width:100%;height:auto;display:block;}
a{color:var(--fg);text-decoration:none;}
a:hover{text-decoration:underline;}
h1,h2,h3,h4{line-height:1.25;margin:0 0 .6em;font-weight:700;letter-spacing:-.01em;}
h1{font-size:clamp(1.8rem,4vw,2.6rem);}
h2{font-size:clamp(1.35rem,2.6vw,1.9rem);}
h3{font-size:1.1rem;}
p{margin:0 0 1.1em;}
.container{width:100%;max-width:var(--maxw);margin:0 auto;padding:0 20px;}
.muted{color:var(--fg-muted);}
.center{text-align:center;}

/* ---------- Skip link ---------- */
.skip-link{position:absolute;left:-9999px;top:0;background:var(--fg);color:var(--bg);padding:10px 16px;z-index:999;}
.skip-link:focus{left:0;}

/* ---------- Header ---------- */
.site-header{
  position:sticky;top:0;z-index:100;
  background:var(--surface);
  border-bottom:1px solid var(--line);
}
.header-inner{
  display:flex;align-items:center;justify-content:space-between;
  gap:16px;min-height:72px;
}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;}
.brand:hover{text-decoration:none;}
.brand-mark{
  width:42px;height:42px;flex:0 0 42px;
  border:2px solid var(--line-strong);
  display:flex;align-items:center;justify-content:center;
  font-weight:800;font-size:.95rem;letter-spacing:.02em;
}
.brand-text strong{display:block;font-size:1rem;line-height:1.15;letter-spacing:.02em;}
.brand-text span{display:block;font-size:.68rem;letter-spacing:.16em;text-transform:uppercase;color:var(--fg-muted);}

/* ---------- Navigation ---------- */
.nav{margin-left:auto;}
.nav-list{display:flex;align-items:center;gap:4px;list-style:none;margin:0;padding:0;}
.nav-list > li{position:relative;}
.nav-list > li > a,
.nav-list > li > button{
  display:flex;align-items:center;gap:6px;
  font:inherit;font-size:.88rem;font-weight:600;
  letter-spacing:.02em;text-transform:uppercase;
  color:var(--fg);background:none;border:0;cursor:pointer;
  padding:10px 12px;border-bottom:2px solid transparent;
}
.nav-list > li > a:hover,
.nav-list > li > button:hover{text-decoration:none;border-bottom-color:var(--line-strong);}
.nav-list > li > a.active{border-bottom-color:var(--line-strong);}
.caret{font-size:.6rem;transition:transform .2s ease;}
li.open > button .caret{transform:rotate(180deg);}

.dropdown{
  position:absolute;top:100%;right:0;min-width:310px;
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  list-style:none;margin:0;padding:6px 0;
  display:none;max-height:78vh;overflow-y:auto;
}
li.open > .dropdown{display:block;}
.dropdown li{position:relative;}
.dropdown a,
.dropdown .sub-toggle{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  width:100%;text-align:left;
  font:inherit;font-size:.85rem;font-weight:500;
  color:var(--fg);background:none;border:0;cursor:pointer;
  padding:9px 18px;
}
.dropdown a:hover,.dropdown .sub-toggle:hover{background:var(--hover);text-decoration:none;}
.dropdown a.active{font-weight:700;background:var(--hover);}
.submenu{list-style:none;margin:0;padding:0;display:none;background:var(--bg-alt);}
.dropdown li.open > .submenu{display:block;}
.submenu a{padding-left:34px;font-size:.82rem;}

/* ---------- Theme toggle & burger ---------- */
.icon-btn{
  display:flex;align-items:center;justify-content:center;
  width:38px;height:38px;flex:0 0 38px;
  border:1px solid var(--line);background:none;color:var(--fg);
  cursor:pointer;border-radius:var(--radius);
}
.icon-btn:hover{background:var(--hover);}
.icon-btn svg{width:18px;height:18px;fill:currentColor;}
.theme-toggle .icon-moon{display:none;}
html[data-theme="dark"] .theme-toggle .icon-sun{display:none;}
html[data-theme="dark"] .theme-toggle .icon-moon{display:block;}
.header-tools{display:flex;align-items:center;gap:8px;}
.burger{display:none;}
.burger span{display:block;width:18px;height:2px;background:currentColor;position:relative;}
.burger span::before,.burger span::after{content:"";position:absolute;left:0;width:18px;height:2px;background:currentColor;}
.burger span::before{top:-6px;} .burger span::after{top:6px;}

/* ---------- Hero ---------- */
.hero{
  background:var(--hero-bg);color:var(--hero-fg);
  padding:88px 0 76px;border-bottom:1px solid var(--line);
}
.hero h1{color:var(--hero-fg);max-width:18ch;}
.hero p{color:rgba(255,255,255,.78);max-width:62ch;font-size:1.05rem;}
.hero .eyebrow{
  font-size:.72rem;letter-spacing:.22em;text-transform:uppercase;
  color:rgba(255,255,255,.6);margin-bottom:16px;
}
.btn{
  display:inline-block;padding:12px 26px;
  border:1.5px solid currentColor;font-weight:600;font-size:.85rem;
  letter-spacing:.08em;text-transform:uppercase;border-radius:var(--radius);
}
.btn:hover{text-decoration:none;background:var(--hero-fg);color:var(--hero-bg);}
.btn-dark{color:var(--fg);}
.btn-dark:hover{background:var(--fg);color:var(--bg);}

/* ---------- Page banner (inner pages) ---------- */
.page-head{
  background:var(--bg-alt);
  border-bottom:1px solid var(--line);
  padding:46px 0 40px;
}
.page-head h1{margin-bottom:8px;}
.breadcrumb{font-size:.8rem;color:var(--fg-muted);}
.breadcrumb a{color:var(--fg-muted);}
.breadcrumb span{margin:0 7px;}

/* ---------- Sections ---------- */
.section{padding:62px 0;}
.section + .section{border-top:1px solid var(--line);}
.section-alt{background:var(--bg-alt);}
.lead{font-size:1.08rem;color:var(--fg-muted);max-width:72ch;}
.grid{display:grid;gap:24px;}
.grid-2{grid-template-columns:repeat(auto-fit,minmax(280px,1fr));}
.grid-3{grid-template-columns:repeat(auto-fit,minmax(240px,1fr));}
.card{
  border:1px solid var(--line);background:var(--surface);
  padding:26px 24px;border-radius:var(--radius);
}
.card h3{margin-bottom:.4em;}
.card p:last-child{margin-bottom:0;}
.card-num{
  font-size:.72rem;letter-spacing:.2em;text-transform:uppercase;
  color:var(--fg-muted);margin-bottom:10px;display:block;
}
.fact-list{list-style:none;margin:0;padding:0;}
.fact-list li{
  display:flex;flex-wrap:wrap;gap:6px 18px;
  padding:12px 0;border-bottom:1px solid var(--line);
}
.fact-list li:last-child{border-bottom:0;}
.fact-list dt,.fact-list .k{
  flex:0 0 220px;font-weight:600;font-size:.85rem;
  letter-spacing:.04em;text-transform:uppercase;
}
.fact-list .v{flex:1 1 260px;color:var(--fg-muted);}

/* ---------- Tables ---------- */
.table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:var(--radius);}
table{width:100%;border-collapse:collapse;background:var(--surface);min-width:460px;}
caption{text-align:left;padding:14px 16px;font-weight:700;border-bottom:1px solid var(--line);}
th,td{padding:13px 16px;text-align:left;border-bottom:1px solid var(--line);font-size:.92rem;vertical-align:middle;}
thead th{
  font-size:.74rem;letter-spacing:.1em;text-transform:uppercase;
  background:var(--bg-alt);white-space:nowrap;
}
tbody tr:last-child td{border-bottom:0;}
tbody tr:hover{background:var(--hover);}

/* ---------- Document listing ---------- */
.doc-toolbar{
  display:flex;flex-wrap:wrap;gap:12px;align-items:center;
  justify-content:space-between;margin-bottom:20px;
}
.doc-search{
  flex:1 1 260px;max-width:380px;
  padding:10px 14px;font:inherit;font-size:.9rem;
  color:var(--fg);background:var(--surface);
  border:1px solid var(--line);border-radius:var(--radius);
}
.doc-search:focus{outline:2px solid var(--line-strong);outline-offset:-2px;}
.doc-count{font-size:.82rem;color:var(--fg-muted);}
.doc-group-title{
  font-size:.78rem;letter-spacing:.16em;text-transform:uppercase;
  color:var(--fg-muted);margin:30px 0 10px;font-weight:700;
}
.doc-group:first-of-type .doc-group-title{margin-top:0;}
.doc-name{font-weight:600;}

/* File-type icon */
.col-icon{width:56px;text-align:center;}
.col-action{width:1%;white-space:nowrap;}
.file-icon{display:inline-flex;align-items:center;justify-content:center;color:var(--fg);}
.file-icon svg{width:28px;height:28px;fill:currentColor;display:block;}
.file-icon text{fill:var(--surface);stroke:none;}
tbody tr:hover .file-icon text{fill:var(--hover);}
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
}
.badge{
  display:inline-block;padding:2px 8px;border:1px solid var(--line);
  font-size:.68rem;letter-spacing:.09em;text-transform:uppercase;
  color:var(--fg-muted);border-radius:var(--radius);white-space:nowrap;
}
.doc-actions{display:flex;gap:8px;flex-wrap:wrap;}
.doc-actions a{
  display:inline-flex;align-items:center;gap:6px;
  padding:7px 14px;border:1px solid var(--line-strong);
  font-size:.76rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  border-radius:var(--radius);white-space:nowrap;
}
.doc-actions a:hover{background:var(--fg);color:var(--bg);text-decoration:none;}
.doc-actions svg{width:13px;height:13px;fill:currentColor;}
.empty-state{
  border:1px dashed var(--line);padding:40px 24px;text-align:center;
  color:var(--fg-muted);border-radius:var(--radius);
}
.empty-state strong{display:block;color:var(--fg);margin-bottom:6px;}

.notice{
  border-left:3px solid var(--line-strong);
  background:var(--bg-alt);padding:16px 20px;margin:0 0 26px;
  font-size:.92rem;
}
.notice p:last-child{margin-bottom:0;}

/* ---------- Footer ---------- */
.site-footer{
  border-top:1px solid var(--line);
  background:var(--bg-alt);padding:52px 0 26px;margin-top:0;
  font-size:.9rem;
}
.footer-grid{display:grid;gap:32px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));}
.site-footer h4{
  font-size:.76rem;letter-spacing:.16em;text-transform:uppercase;
  margin-bottom:14px;
}
.site-footer ul{list-style:none;margin:0;padding:0;}
.site-footer li{margin-bottom:8px;}
.site-footer a{color:var(--fg-muted);}
.site-footer a:hover{color:var(--fg);}
.footer-bottom{
  border-top:1px solid var(--line);margin-top:36px;padding-top:20px;
  display:flex;flex-wrap:wrap;gap:8px 20px;justify-content:space-between;
  font-size:.8rem;color:var(--fg-muted);
}

/* ---------- Responsive ---------- */
@media (max-width:960px){
  .burger{display:flex;}
  .nav{
    position:fixed;top:72px;left:0;right:0;bottom:0;
    background:var(--surface);border-top:1px solid var(--line);
    overflow-y:auto;padding:12px 0 60px;display:none;
  }
  .nav.open{display:block;}
  .nav-list{flex-direction:column;align-items:stretch;gap:0;}
  .nav-list > li > a,.nav-list > li > button{
    width:100%;justify-content:space-between;
    padding:14px 20px;border-bottom:1px solid var(--line);
  }
  .nav-list > li > a:hover,.nav-list > li > button:hover{border-bottom-color:var(--line);background:var(--hover);}
  .dropdown{
    position:static;min-width:0;border:0;box-shadow:none;
    background:var(--bg-alt);max-height:none;padding:0;
  }
  .dropdown a,.dropdown .sub-toggle{padding:12px 30px;border-bottom:1px solid var(--line);}
  .submenu a{padding-left:46px;}
  .fact-list dt,.fact-list .k{flex:1 1 100%;}
}
@media (max-width:520px){
  .brand-text strong{font-size:.85rem;}
  .hero{padding:60px 0 54px;}
  .section{padding:44px 0;}
}

@media print{
  .site-header,.site-footer,.doc-toolbar,.doc-actions{display:none!important;}
  body{color:#000;background:#fff;}
}
