:root{
  --ink:#2b241b;
  --muted:#6a5a44;
  --paper:#f6efe3;
  --paper-soft:#fbf7ef;
  --accent:#b08b52;
  --accent2:#7a5a2c;
  --hover-blue: #3a5f8a;        /* muted steel blue */
  --hover-blue-bg: #e7eff7;     /* very light blue wash */
  --active-blue: #2f4f73;       /* darker for selected state */
  --shadow: rgba(0,0,0,.14);
  --link:#6a4b22;
  --font-body: "Athelas", Georgia, "Times New Roman", serif;
  --font-title: "Cochin", Georgia, "Times New Roman", serif;
}

*{box-sizing:border-box}
html,body{height:100%}

/* ===== Custom Fonts ===== */
@font-face {
  font-family: "Athelas";
  src: url("assets/fonts/Athelas-Regular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cochin";
  src: url("assets/fonts/Cochin-Italic.woff") format("woff");
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

body{
  margin:0;
  color:var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(900px 500px at 50% 20%, rgba(0,0,0,.12), transparent 60%),
    linear-gradient(#1b1b1d,#171719);
}

a{
  color: var(--link);
}
a:hover{
  color: var(--hover-blue);
  text-decoration: underline;
}

.navbtn,
.pillbtn,
.bigbtn,
.toc a{
  text-decoration: none;
}

.navbtn:hover,
.pillbtn:hover,
.bigbtn:hover,
.toc a:hover{
  text-decoration: none;
}

.wrap{
  min-height:100%;
  padding:24px 14px 40px;
  display:flex;
  justify-content:center;
}

.shell{
  width:min(980px, 100%);
}

/* ===== Top bar ===== */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.brand{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding-left:6px;
}
.brand .title{
  font-size:18px;
  letter-spacing:.3px;
  color:#f4f1e8;
}
.brand .subtitle{
  font-size:12px;
  color:#d9d0c0;
}

/* ===== Main container (single surface) ===== */
.panel{
  background: var(--paper);
  border-radius:14px;
  border:1px solid rgba(0,0,0,.12);
  box-shadow:0 10px 26px var(--shadow);
  overflow:hidden;
}

.panel .frame{
  margin:0;
  border:none;
  background:transparent;
}

/* ===== Header ===== */
.header{
  background: linear-gradient(
    to bottom,
    #faf6ee,
    #f2e6d4
  ); /* extremely subtle */
  padding:20px 18px 14px;
  text-align:center;
  border-bottom:1px solid rgba(0,0,0,.08);
  position:relative;
}

.header .version{
  position:absolute;
  right:14px;
  top:10px;
  font-size:12px;
  color:var(--muted);
}

.h1{
  margin:0;
  font-size:40px;
  font-weight:600;
  letter-spacing:.6px;
}

.h1,
.sectionTitle,
.brand .title{
  font-family: var(--font-title);
}

/* Ornament */
.orn{
  margin:10px auto 0;
  width:min(560px,100%);
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--accent2);
  opacity:.65;
}
.orn .line{
  flex:1;
  height:1px;
  background:linear-gradient(90deg, transparent, var(--accent), transparent);
}
.orn svg{width:28px; height:16px}

/* ===== Navigation ===== */
.navrow{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  padding:10px 12px;
  background:transparent;
  border-bottom:1px solid rgba(0,0,0,.08);
}

.navbtn,
.pillbtn,
.bigbtn{
  font-family: var(--font-body);
  font-size: 15px;
}

.navbtn{
  padding:9px 12px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.18);
  background:#fffdf8;
  color:var(--ink);
  font-size:14px;
  letter-spacing:.3px;
}
.navbtn:hover{
  background: var(--hover-blue-bg);
  border-color: var(--hover-blue);
  color: var(--hover-blue);
  text-decoration:none;
}
.navbtn.active{
  background: #f0f6fb;
  border-color: var(--active-blue);
  color: var(--active-blue);
  font-weight: 600;
  box-shadow: inset 0 0 0 2px rgba(58,95,138,.15);
}

/* ===== Buttons ===== */
.pillbtn,
.bigbtn{
  background:#fffdf8;
  color:var(--ink);
  border:1px solid rgba(0,0,0,.20);
  box-shadow:0 8px 16px rgba(0,0,0,.14);
  border-radius:12px;
}
.pillbtn{
  padding:10px 14px;
}
.bigbtn{
  padding:14px 18px;
  font-size:18px;
}
.pillbtn:hover,
.bigbtn:hover{
  background: var(--hover-blue-bg);
  border-color: var(--hover-blue);
  color: var(--hover-blue);
}
.pillbtn:active,
.bigbtn:active{
  transform:translateY(1px);
}

/* ===== Content ===== */
.content{
  padding:18px 20px 24px;
  background:transparent;
}

/* Sections (no panels) */
.sectionTitle{
  margin:18px 0 6px;
  font-size:24px;
  font-style:italic;
  text-align:center;
  margin-bottom: 20px;
  color:#2e241a;
}

.suborn{
  margin:6px auto 14px;
  width:min(640px,100%);
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--accent2);
  opacity:.55;
}
.suborn .line{
  flex:1;
  height:1px;
  background:linear-gradient(90deg, transparent, var(--accent), transparent);
}
.suborn .diamond{
  width:8px;
  height:8px;
  border:1px solid var(--accent2);
  transform:rotate(45deg);
  background:rgba(176,139,82,.06);
}

/* Text */
.p{
  margin:10px 0;
  line-height:1.6;
  color:#3a3126;
}

.ul{
  margin:10px 0 0 0;
  padding-left:18px;
}
.ul li{
  margin:6px 0;
  line-height:1.55;
}

/* Optional soft section background (use sparingly) */
.soft{
  background:rgba(255,255,255,.35);
  border-radius:12px;
  padding:14px 16px;
}

/* Layout helpers */
.grid{
  display:grid;
  gap:14px;
  grid-template-columns:1fr;
}
@media(min-width:860px){
  .grid.two{grid-template-columns:1fr 1fr;}
}

.kv{
  display:grid;
  grid-template-columns:170px 1fr;
  gap:10px 14px;
}
@media(max-width:520px){
  .kv{grid-template-columns:1fr}
}
.kv .k{font-weight:700}
.kv .v{line-height:1.4}

/* TOC */
.toc{
  display:grid;
  gap:10px;
  grid-template-columns:1fr;
}
@media(min-width:860px){
  .toc{grid-template-columns:1fr 1fr;}
}
.toc a{
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.14);
  background:#fffdf8;
}
.toc a:hover{
  background: var(--hover-blue-bg);
  border-color: var(--hover-blue);
  color: var(--hover-blue);
  text-decoration:none;
}
.toc a.active{
  background: #f0f6fb;
  border-color: var(--active-blue);
  color: var(--active-blue);
  font-weight:600;
}

/* Separator */
hr.sep{
  border:none;
  height:1px;
  background:linear-gradient(90deg, transparent, rgba(176,139,82,.5), transparent);
  margin:18px 0;
}

/* Footer */
.footerBar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding:14px;
  background:#ecdcc3;
  border-top:1px solid rgba(0,0,0,.10);
}

.note{
  font-size:12px;
  color:#574a38;
}

/* ===== Images (drop anywhere) ===== */
.figure{
  display: none;
  margin:16px auto;
  width:min(860px,100%);
}
.figure img{
  width:100%;
  height:auto;
  display:block;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.16);
  box-shadow:0 8px 16px rgba(0,0,0,.14);
}
.figure .cap{
  margin-top:8px;
  font-size:12px;
  color:var(--muted);
  text-align:center;
}

/* Inputs */
input[type="text"]{
  border:1px solid rgba(0,0,0,.22);
  border-radius:12px;
  padding:10px 12px;
  font-family:inherit;
}
input[type="text"]:focus{
  outline:none;
  box-shadow:0 0 0 3px rgba(176,139,82,.18);
}

/* Code */
code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background:rgba(0,0,0,.06);
  padding:2px 6px;
  border-radius:6px;
}