/*
 VÆRINGJAR II — STRICT TEMPLATE CONTRACT v1
 ------------------------------------------------------------
 This file is the LAST stylesheet on every HTML page.
 It owns geometry, page rhythm, typography containment and the
 canonical course / reading components. Do not bypass this file with
 page-specific geometry. New components must conform to this contract.
*/

:root{
  --strict-frame:1120px;
  --strict-gutter:clamp(18px,2.2vw,28px);
  --strict-section:64px;
  --strict-section-tight:44px;
  --strict-gap:16px;
  --strict-card-pad:20px;
  --strict-radius:0px;
  --strict-reading:74ch;
  --strict-h1:clamp(36px,4.1vw,54px);
  --strict-h2:clamp(25px,2.5vw,34px);
  --strict-h3:17px;
}

/* ========== 1. HARD FRAME / CONTAINMENT ========== */
html,body{width:100%;max-width:100%;margin:0;overflow-x:hidden}
*,*::before,*::after{box-sizing:border-box}
body.strict-template-v1{min-width:0}
body.strict-template-v1 :where(main,section,article,aside,header,footer,nav,div,figure,details,summary){min-width:0}
body.strict-template-v1 :where(img,svg,video,canvas,iframe){display:block;max-width:100%;height:auto}
body.strict-template-v1 .container,
body.strict-template-v1 .nav,
body.strict-template-v1 .site-footer::before{
  width:min(calc(100% - 2 * var(--strict-gutter)),var(--strict-frame))!important;
  max-width:none!important;
  margin-inline:auto!important;
  padding-inline:0!important;
}
body.strict-template-v1 main>section{width:100%;max-width:100%;overflow-x:clip}
body.strict-template-v1 main :where(p,li,dd,dt,figcaption,td,th){overflow-wrap:break-word;word-break:normal}
body.strict-template-v1 main :where(a,code){overflow-wrap:anywhere}

/* ========== 2. HEADER ========== */
body.strict-template-v1 .site-header{position:sticky;top:0;z-index:100;background:rgba(4,6,5,.97)}
body.strict-template-v1 .nav{min-height:72px!important;display:flex!important;align-items:center!important;gap:18px!important}
body.strict-template-v1 .brand{flex:0 0 auto;min-width:0}
body.strict-template-v1 .brand-mark{flex:0 0 38px}
body.strict-template-v1 .brand-copy{width:164px;min-width:164px;max-width:164px;overflow-wrap:normal!important;word-break:normal!important}
body.strict-template-v1 .nav-links{margin-left:auto;gap:14px!important;min-width:0}
body.strict-template-v1 .nav-links a{white-space:nowrap}
body.strict-template-v1 .lang-switch{flex:0 0 auto;margin-left:0!important}

@media(max-width:1360px){
  body.strict-template-v1 .nav-links{display:none!important;position:absolute;top:72px;left:0;right:0;margin:0;padding:20px var(--strict-gutter);background:#030604;border-bottom:1px solid var(--line-strong);flex-direction:column;align-items:flex-start;gap:14px!important}
  body.strict-template-v1 .nav-links.open{display:flex!important}
  body.strict-template-v1 .nav-toggle{display:block!important;margin-left:auto}
}

/* ========== 3. TYPOGRAPHY ========== */
body.strict-template-v1{font-size:16px;line-height:1.6}
body.strict-template-v1 :where(h1,h2,h3,h4){max-width:100%;word-break:normal!important;overflow-wrap:break-word!important;hyphens:auto}
body.strict-template-v1 h1{font-size:var(--strict-h1)!important;line-height:1.04!important;max-width:18ch!important}
body.strict-template-v1 h2{font-size:var(--strict-h2)!important;line-height:1.12!important;max-width:26ch!important}
body.strict-template-v1 h3{font-size:var(--strict-h3)!important;line-height:1.28!important}
body.strict-template-v1 .lead{font-size:clamp(16px,1.5vw,19px)!important;line-height:1.7!important;max-width:var(--strict-reading)!important}
body.strict-template-v1 main :where(p,li){line-height:1.68}
body.strict-template-v1 .reader-intro,
body.strict-template-v1 .reader-copy{max-width:var(--strict-reading)!important}

html[lang="de"] body.strict-template-v1 main :where(h1,h2,h3,h4,p,li,dd,dt,figcaption,summary,b,strong,span){
  word-break:normal!important;overflow-wrap:break-word!important;-webkit-hyphens:auto;hyphens:auto
}
html[lang="de"] body.strict-template-v1 main :where(code,pre,.formula,.equation,.math-formal){hyphens:none!important;overflow-wrap:anywhere!important}

/* ========== 4. VERTICAL RHYTHM ========== */
body.strict-template-v1 main>section{padding-block:var(--strict-section)!important}
body.strict-template-v1 main>section.section-tight{padding-block:var(--strict-section-tight)!important}
body.strict-template-v1 .page-hero,
body.strict-template-v1 .reader-hero{padding-block:72px 54px!important}
body.strict-template-v1 .reader-section{border-top:1px solid var(--line)}
body.strict-template-v1 .reader-section h2{margin:10px 0 12px!important}
body.strict-template-v1 .reader-badges{margin-top:20px;gap:8px}
body.strict-template-v1 .hero-actions{margin-top:22px;padding-top:0!important}

/* ========== 5. CANONICAL CARD GRIDS ========== */
body.strict-template-v1 :where(.reader-grid,.cards,.about-grid-v3){
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:var(--strict-gap)!important;margin-top:24px
}
body.strict-template-v1 :where(.reader-card,.card,.about-card-v3){
  min-width:0!important;padding:var(--strict-card-pad)!important;border:1px solid var(--line)!important;background:rgba(111,255,126,.012)!important
}
body.strict-template-v1 .reader-card h3{margin:10px 0 8px!important;text-transform:none!important;letter-spacing:0!important}
body.strict-template-v1 .reader-card p{font-size:14px!important;line-height:1.62!important;max-width:62ch!important}

@media(max-width:980px){body.strict-template-v1 :where(.reader-grid,.cards,.about-grid-v3){grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:680px){body.strict-template-v1 :where(.reader-grid,.cards,.about-grid-v3){grid-template-columns:1fr!important}}


/* Buttons are atomic navigation controls; their labels never split. */
body.strict-template-v1 .btn{width:max-content;max-width:100%;white-space:nowrap}

/* ========== 6. COURSE MAP — FIXED CONTRACT ========== */
body.strict-template-v1 .course-map-section-v3{padding-block:56px!important}
body.strict-template-v1 .course-map-v3{margin:0!important;border:1px solid var(--line-strong)!important;background:rgba(111,255,126,.010)!important}
body.strict-template-v1 .course-map-head{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:24px!important;align-items:end!important;
  padding:22px 24px!important;border-bottom:1px solid var(--line)!important
}
body.strict-template-v1 .course-map-head p{max-width:68ch!important;margin:6px 0 0!important;font-size:14px!important;line-height:1.55!important;color:var(--muted)!important}
body.strict-template-v1 .course-map-status{align-self:start;white-space:nowrap;font-size:11px!important;letter-spacing:.08em;text-transform:uppercase;color:var(--phosphor)}
body.strict-template-v1 .module-rail{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;padding:16px!important
}
body.strict-template-v1 .module-tile{
  display:flex!important;flex-direction:column!important;min-width:0!important;min-height:142px!important;
  padding:18px!important;border:1px solid var(--line)!important;background:rgba(255,255,255,.006)!important
}
body.strict-template-v1 .module-tile:last-child{border-right:1px solid var(--line)!important}
body.strict-template-v1 .module-tile .module-no{display:block!important;margin:0 0 12px!important;font-size:11px!important;line-height:1!important;letter-spacing:.1em!important;color:rgba(111,255,126,.58)!important}
body.strict-template-v1 .module-tile b{display:block!important;margin:0 0 9px!important;font-size:15px!important;line-height:1.3!important;color:var(--white)!important;text-transform:none!important}
body.strict-template-v1 .module-tile>span:not(.module-no){display:block!important;margin-top:auto!important;font-size:12px!important;line-height:1.5!important;color:var(--muted)!important}
body.strict-template-v1 .module-tile.is-current{border-color:var(--phosphor)!important;background:rgba(111,255,126,.045)!important;box-shadow:inset 0 3px 0 var(--phosphor)!important}
body.strict-template-v1 .module-tile.is-published::after{right:12px!important;top:11px!important}
body.strict-template-v1 .module-tile.is-planned{opacity:.72}
body.strict-template-v1 .course-window{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;margin:16px 0 0!important}
body.strict-template-v1 .course-window-card{min-width:0!important;min-height:92px!important;padding:17px 18px!important;border:1px solid var(--line)!important;background:rgba(111,255,126,.01)!important}
body.strict-template-v1 .course-window-card small{display:block!important;margin-bottom:7px!important;font-size:10px!important;line-height:1.2!important;letter-spacing:.1em!important;text-transform:uppercase!important;color:var(--muted)!important}
body.strict-template-v1 .course-window-card b{display:block!important;font-size:14px!important;line-height:1.42!important;color:var(--white)!important;text-transform:none!important}
body.strict-template-v1 .course-window-card.current{border-color:var(--phosphor)!important;background:rgba(111,255,126,.038)!important}
body.strict-template-v1 .course-window-card.next{border-color:rgba(255,176,0,.38)!important}

@media(max-width:900px){
  body.strict-template-v1 .course-map-head{grid-template-columns:1fr!important;align-items:start!important}
  body.strict-template-v1 .course-map-status{white-space:normal}
  body.strict-template-v1 .module-rail{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.strict-template-v1 .course-window{grid-template-columns:1fr!important}
}
@media(max-width:620px){
  body.strict-template-v1 .module-rail{grid-template-columns:1fr!important;padding:12px!important}
  body.strict-template-v1 .module-tile{min-height:0!important;padding:16px!important}
  body.strict-template-v1 .course-map-head{padding:18px 16px!important}
}

/* ========== 7. COURSE ARCHIVE / LECTURE CONTEXT ========== */
body.strict-template-v1 .course-archive{display:grid!important;gap:10px!important;margin-top:24px!important}
body.strict-template-v1 .course-module-group{border:1px solid var(--line)!important;background:rgba(111,255,126,.006)!important}
body.strict-template-v1 .course-module-group>summary{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:18px!important;align-items:center!important;padding:16px 18px!important}
body.strict-template-v1 .lecture-list-v3{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.strict-template-v1 .lecture-item-v3{display:grid!important;grid-template-columns:46px minmax(0,1fr) auto!important;gap:12px!important;align-items:center!important;min-width:0!important;padding:14px 16px!important}
body.strict-template-v1 .course-context-v3{padding:18px 0!important;border-top:1px solid var(--line)!important;border-bottom:1px solid var(--line)!important}
body.strict-template-v1 .course-context-inner{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:20px!important;align-items:center!important}
body.strict-template-v1 .course-context-nav{display:flex!important;gap:8px!important;flex-wrap:wrap!important;justify-content:flex-end!important}

@media(max-width:760px){
 body.strict-template-v1 .lecture-list-v3{grid-template-columns:1fr!important}
 body.strict-template-v1 .lecture-item-v3{grid-template-columns:40px minmax(0,1fr)!important;border-right:0!important}
 body.strict-template-v1 .lecture-item-v3 a{grid-column:2}
 body.strict-template-v1 .course-context-inner{grid-template-columns:1fr!important}
 body.strict-template-v1 .course-context-nav{justify-content:flex-start!important}
}

/* ========== 8. LECTURE NOTES ========== */
body.strict-template-v1 .full-lecture-notes{padding-block:var(--strict-section)!important;border-top:1px solid var(--line)!important}
body.strict-template-v1 .lecture-notes-shell{max-width:var(--strict-frame)!important}
body.strict-template-v1 .lecture-notes-intro{max-width:var(--strict-reading)!important;color:var(--muted)}
body.strict-template-v1 .lecture-notes-source{margin:18px 0 30px!important}
body.strict-template-v1 .lecture-article{max-width:900px!important;margin:0!important;overflow:visible!important}
body.strict-template-v1 .lecture-article :where(p,li){font-size:16px!important;line-height:1.75!important}
body.strict-template-v1 .lecture-article h3{margin:34px 0 14px!important;font-size:21px!important;text-transform:none!important}
body.strict-template-v1 .lecture-article h4{margin:26px 0 12px!important;font-size:17px!important;text-transform:none!important}
body.strict-template-v1 .lecture-article pre,
body.strict-template-v1 .lecture-article table{max-width:100%!important;overflow-x:auto!important}

/* ========== 9. MATH / TABLES / CODE ========== */
body.strict-template-v1 :where(pre,.formula,.equation,.math-formal,mjx-container[display="true"]){max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important}
body.strict-template-v1 :where(table){max-width:100%}
body.strict-template-v1 .tech-table-wrap,
body.strict-template-v1 .exp02-matrix-scroll,
body.strict-template-v1 .exp03-matrix-scroll{max-width:100%!important;overflow-x:auto!important}

/* ========== 10. FOLDS ========== */
body.strict-template-v1 details.content-fold{width:100%!important;max-width:none!important;margin:0!important;border-left:0!important;border-right:0!important}
body.strict-template-v1 details.content-fold>summary,
body.strict-template-v1 .content-fold-body{width:min(calc(100% - 2 * var(--strict-gutter)),var(--strict-frame))!important;margin-inline:auto!important}
body.strict-template-v1 details.content-fold>summary{padding:16px 0!important;min-height:54px!important}
body.strict-template-v1 .content-fold-body{padding:34px 0 46px!important}

/* ========== 11. FOOTER ========== */
body.strict-template-v1 .site-footer{overflow-x:hidden}
body.strict-template-v1 .footer-grid{display:grid!important;grid-template-columns:1.3fr 1fr 1fr!important;gap:28px!important}
@media(max-width:760px){body.strict-template-v1 .footer-grid{grid-template-columns:1fr!important}}

/* ========== 12. MOBILE ========== */
@media(max-width:680px){
 :root{--strict-section:44px;--strict-section-tight:34px;--strict-card-pad:16px}
 body.strict-template-v1 .page-hero,body.strict-template-v1 .reader-hero{padding-block:48px 36px!important}
 body.strict-template-v1 h1{font-size:clamp(32px,9.4vw,40px)!important;line-height:1.08!important;max-width:100%!important}
 body.strict-template-v1 h2{font-size:clamp(23px,7vw,29px)!important;max-width:100%!important}
 body.strict-template-v1 .site-header::after{display:none!important}
 body.strict-template-v1 .brand-copy{width:142px;min-width:142px;max-width:142px;font-size:12px!important}
 body.strict-template-v1 .brand-copy small{font-size:10px!important;letter-spacing:.12em!important}
 body.strict-template-v1 .lang-switch a{min-width:27px!important}
}

/* ======================================================================
   STRICT TEMPLATE CONTRACT v2 — COLLISION / BORDER SAFETY
   2026-09-13
   Rule: text never sits on a border; navigation never competes for width.
   ====================================================================== */
:root{
  --strict-nav-frame:1480px;
}

/* Header has its own frame. The reading frame stays 1120px. */
body.strict-template-v1 .nav{
  width:min(calc(100% - 2 * var(--strict-gutter)),var(--strict-nav-frame))!important;
  max-width:none!important;
  margin-inline:auto!important;
  padding-inline:0!important;
  gap:12px!important;
}
body.strict-template-v1 .brand-copy{
  width:154px!important;
  min-width:154px!important;
  max-width:154px!important;
}
body.strict-template-v1 .nav-links{
  display:flex!important;
  flex:0 1 auto!important;
  margin-left:auto!important;
  gap:10px!important;
  min-width:0!important;
  align-items:center!important;
}
body.strict-template-v1 .nav-links a{
  flex:0 0 auto!important;
  white-space:nowrap!important;
  font-size:11px!important;
  letter-spacing:.035em!important;
}
body.strict-template-v1 .nav-cta{padding:8px 10px!important}
body.strict-template-v1 .lang-switch{
  flex:0 0 auto!important;
  display:flex!important;
  gap:4px!important;
}

/* Below this width the full menu is forbidden: use the hamburger. */
@media(max-width:1499px){
  body.strict-template-v1 .nav-links{
    display:none!important;
    position:absolute!important;
    top:72px!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    margin:0!important;
    padding:18px max(var(--strict-gutter),calc((100vw - var(--strict-frame))/2))!important;
    background:#030604!important;
    border-bottom:1px solid var(--line-strong)!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    gap:8px!important;
  }
  body.strict-template-v1 .nav-links.open{display:flex!important}
  body.strict-template-v1 .nav-links a{
    width:100%!important;
    padding:8px 0!important;
    font-size:12px!important;
  }
  body.strict-template-v1 .nav-toggle{
    display:block!important;
    flex:0 0 auto!important;
    margin-left:auto!important;
  }
}
@media(min-width:1500px){
  body.strict-template-v1 .nav-toggle{display:none!important}
}

/* No labels or captions are allowed to float ON a frame line. */
body.strict-template-v1 .site-header::after,
body.strict-template-v1 .equation-panel::before,
body.strict-template-v1 .cta::before,
body.strict-template-v1 .collab-cta::before{
  display:none!important;
  content:none!important;
}

/* Bordered components own their content. Nothing may escape into the frame. */
body.strict-template-v1 :where(
  .reader-card,.card,.about-card-v3,.module-tile,.course-window-card,
  .course-map-v3,.lecture-item-v3,.author-strip,.notice,.system-card,
  .equation-panel,.cta,.collab-cta
){
  min-width:0!important;
}
body.strict-template-v1 :where(
  .reader-card,.card,.about-card-v3,.module-tile,.course-window-card,
  .lecture-item-v3,.author-strip,.notice
){
  overflow:hidden!important;
}
body.strict-template-v1 :where(
  .reader-card,.card,.about-card-v3,.module-tile,.course-window-card,
  .lecture-item-v3,.author-strip,.notice
) :where(h1,h2,h3,h4,p,span,b,strong,small,a,li){
  max-width:100%!important;
  min-width:0!important;
  overflow-wrap:break-word!important;
  word-break:normal!important;
}

/* Reserve space for status glyphs rather than placing them over copy. */
body.strict-template-v1 .module-tile.is-published{padding-right:42px!important}
body.strict-template-v1 .module-tile.is-published::after{right:14px!important;top:14px!important}

/* Section labels live INSIDE the section, never on its edge. */
body.strict-template-v1 .eyebrow{
  display:block!important;
  max-width:100%!important;
  margin:0 0 12px!important;
  line-height:1.45!important;
  overflow-wrap:break-word!important;
}

/* Buttons remain atomic; on very narrow screens they may fill the row. */
@media(max-width:480px){
  body.strict-template-v1 .btn{
    width:100%!important;
    max-width:100%!important;
    white-space:normal!important;
    text-align:center!important;
    overflow-wrap:break-word!important;
  }
  body.strict-template-v1 .brand-copy{
    width:124px!important;
    min-width:124px!important;
    max-width:124px!important;
    font-size:11px!important;
  }
  body.strict-template-v1 .brand-copy small{font-size:9px!important}
  body.strict-template-v1 .nav{gap:8px!important}
}
