/* Experimenting with Emerging Media Platforms
   Modern docs direction — prototype stylesheet */

:root {
  --bg:          #ffffff;
  --bg-subtle:   #f7f8fa;
  --bg-raised:   #ffffff;
  --text:        #14161a;
  --text-muted:  #59616f;
  --text-faint:  #838b98;
  --border:      #e3e6eb;
  --border-hov:  #c9cfd8;
  --accent:      #1f5fd4;
  --accent-soft: #eef3fd;
  --radius:      10px;
  --maxw:        1080px;
  --font-sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:   "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif:  "Newsreader", Georgia, serif;
}

html[data-theme="dark"] {
  --bg:          #0d1117;
  --bg-subtle:   #12171f;
  --bg-raised:   #161c26;
  --text:        #e7edf5;
  --text-muted:  #9aa4b3;
  --text-faint:  #737d8c;
  --border:      #242c38;
  --border-hov:  #37414f;
  --accent:      #6ea8fe;
  --accent-soft: #16233a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.05rem; font-weight: 600; }
p  { margin: 0 0 1.1rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 28px;
}
.brand {
  font-weight: 600; font-size: 15px; color: var(--text);
  letter-spacing: -0.01em; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--text-faint); font-weight: 400; }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a {
  font-size: 14.5px; color: var(--text-muted); font-weight: 500;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.current { color: var(--text); }

.themebtn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; font-size: 14px; line-height: 1;
}
.themebtn:hover { border-color: var(--border-hov); color: var(--text); }

.navtoggle { display: none; background: none; border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; width: 34px; height: 32px; cursor: pointer; }

/* ---------- hero ---------- */

.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 56px; align-items: start; }
.hero h1 { margin-bottom: 14px; }
.lede { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 22px; }
.byline { font-size: 15px; color: var(--text-muted); margin-bottom: 28px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius); font-size: 14.5px;
  font-weight: 500; border: 1px solid transparent; cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-hov); background: var(--bg-subtle); }

.cover-card {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg-raised); padding: 18px; text-align: center;
}
.cover-card img { width: 100%; height: auto; border-radius: 6px; display: block; }
.sellers { margin-top: 16px; font-size: 13.5px; color: var(--text-muted); text-align: left; }
.sellers strong { display: block; color: var(--text); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.sellers a { display: inline-block; margin-right: 12px; }

/* ---------- sections ---------- */

.section { padding: 56px 0; border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 28px; }
.section-head p { color: var(--text-muted); margin: 8px 0 0; max-width: 62ch; }

.prose { max-width: 68ch; }
.prose p { color: var(--text-muted); }
.prose em { font-style: italic; color: var(--text); }

/* ---------- chapter grid ---------- */

.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.chapter {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; background: var(--bg-raised); display: block;
}
.chapter:hover { border-color: var(--accent); text-decoration: none; }
.chapter .num {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--accent);
  letter-spacing: .04em; display: block; margin-bottom: 3px;
}
.chapter .title { font-size: 14.5px; color: var(--text); font-weight: 500; }

/* ---------- callout ---------- */

.callout {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg-subtle); padding: 28px 30px;
  display: flex; gap: 24px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
}
.callout h3 { margin-bottom: 6px; }
.callout p { color: var(--text-muted); margin: 0; max-width: 58ch; font-size: 15px; }

/* ---------- footer ---------- */

.foot { padding: 48px 0 60px; font-size: 14.5px; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; }
.foot h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint); margin: 0 0 12px; font-weight: 600; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 7px; }
.foot a { color: var(--text-muted); }
.foot a:hover { color: var(--text); text-decoration: none; }
.foot-nums { display: flex; flex-wrap: wrap; gap: 6px; }
.foot-nums a {
  font-family: var(--font-mono); font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 9px; color: var(--text-muted);
}
.foot-nums a:hover { border-color: var(--accent); color: var(--accent); }
.colophon { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 13.5px; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .cover-card { max-width: 300px; }
  .hero { padding: 48px 0 40px; }
}

@media (max-width: 900px) {
  body { font-size: 16px; }
  .navtoggle { display: block; margin-left: auto; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 24px 16px;
  }
  .nav-links.open { display: flex; }
  .brand span { display: none; }
  .nav-links a { padding: 9px 0; width: 100%; }
  .section { padding: 40px 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- interior pages ---------- */

.page { padding-top: 44px; padding-bottom: 72px; }
.pagehead { margin-bottom: 32px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.pagehead h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin-bottom: 10px; }
.backlink { font-size: 14px; color: var(--text-muted); }
.backlink:hover { color: var(--accent); text-decoration: none; }

.page h2 { font-size: 1.3rem; margin: 2rem 0 .8rem; }
.page h3 { font-size: 1.1rem; margin: 1.8rem 0 .7rem; }
.page h4, .page h5 { font-size: 1rem; margin: 1.5rem 0 .6rem; font-weight: 600; }
.page h6 { font-size: .95rem; margin: 1.2rem 0 .5rem; font-weight: 500; }
.page ul, .page ol { padding-left: 1.25rem; margin: 0 0 1.1rem; }
.page li { margin-bottom: .5rem; }
.page img { max-width: 100%; height: auto; border-radius: 8px; }
.page iframe { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.page hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.page p { color: var(--text-muted); }
.page a { color: var(--accent); }

/* ---------- shims for legacy Bootstrap markup ---------- */

.page .container { max-width: none; padding: 0; margin: 0; width: 100%; }
.page .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px 32px; margin: 0; align-items: start; }
.page .row > .col > p:first-child:empty { display: none; }
.page .col, .page .col-sm, .page .col-md-6, .page .col-lg-4, .page .col-md-4 { padding: 0; min-width: 0; }
.page .starter-template, .page .py-5, .page .px-3, .page .text-left { padding: 0; }
.page .lead { font-size: inherit; font-weight: inherit; }
.page .sitebrand { font-family: var(--font-sans); }
.page center { text-align: left; display: block; }

.page .card {
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-raised);
  overflow: hidden; margin-bottom: 20px; max-width: 100%;
}
.page .card-body { padding: 16px 18px; }
.page .card-title { font-size: 1rem; font-weight: 600; margin: 0 0 6px; color: var(--text); }
.page .card-text { font-size: 14.5px; color: var(--text-muted); margin-bottom: 14px; }
.page .card-img-top { border-radius: 0; display: block; width: 100%; }
.page .card-link { margin-right: 12px; }

.page .btn-primary { background: var(--accent); color: #fff; }
.page .btn-secondary, .page .disabled {
  background: var(--bg-subtle); color: var(--text-faint);
  border: 1px solid var(--border); cursor: default;
}
.page .list-group { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.page .list-group-item {
  padding: 11px 0; border-bottom: 1px solid var(--border); margin: 0;
}
.page .list-group-item:last-child { border-bottom: 0; }
.page .img-thumbnail, .page .img-fluid, .page .rounded { max-width: 100%; height: auto; }

.embedframe {
  width: 100%; height: calc(100vh - 220px); min-height: 480px;
  border: 1px solid var(--border); border-radius: 10px;
}
