/* ===== WillTech desktop/mobile fixes (append at END of css.css) ===== */

/* 1) Define theme vars here so both pages have them */
* { /* cross-browser consistency above all */
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	-ms-box-sizing: border-box;
	-o-box-sizing: border-box;
	box-sizing: border-box;
	line-height: 1.25em;
	padding: 0; margin: 0; border: 0;
	-webkit-tab-size: 4;
	-moz-tab-size: 4;
	-ms-tab-size: 4;
	-o-tab-size: 4;
	tab-size: 4;
}
html { background: #000; color: #7F7F70; font-family: sans-serif; }
body {
	overflow-x: hidden; font-size: 15pt;
	-webkit-animation: fade .4s;
	-moz-animation: fade .4s;
	-ms-animation: fade .4s;
	-o-animation: fade .4s;
	animation: fade .4s;
}
img { vertical-align: middle; margin-bottom: 3px; }
@-webkit-keyframes fade {
	0% { opacity: 0; } /* give enough time for the menu to hide */
	70% { opacity: 0; } /* bad hack, but hey */
	100% { opacity: 1; }
}
@-moz-keyframes fade {
	0% { opacity: 0; } /* give enough time for the menu to hide */
	70% { opacity: 0; } /* bad hack, but hey */
	100% { opacity: 1; }
}
@-ms-keyframes fade {
	0% { opacity: 0; } /* give enough time for the menu to hide */
	70% { opacity: 0; } /* bad hack, but hey */
	100% { opacity: 1; }
}
@-o-keyframes fade {
	0% { opacity: 0; } /* give enough time for the menu to hide */
	70% { opacity: 0; } /* bad hack, but hey */
	100% { opacity: 1; }
}
@keyframes fade {
	0% { opacity: 0; } /* give enough time for the menu to hide */
	70% { opacity: 0; } /* bad hack, but hey */
	100% { opacity: 1; }
}
#menu dt { padding-top: 0; padding-bottom: .1em; text-align: left; }
#menu {
	font-size: 2em;
	line-height: 2.5em;
	text-align: right;
	position: fixed;
	top: 0; left: 0; background: rgba(0, 0, 0, .9);
	border: 1px solid #3F3F38;
	-webkit-transform-origin: top left;
	-moz-transform-origin: top left;
	-ms-transform-origin: top left;
	-o-transform-origin: top left;
	transform-origin: top left;
	-webkit-transform: rotate(95deg) translatey(-1.35em);
	-moz-transform: rotate(95deg) translatey(-1.35em);
	-ms-transform: rotate(95deg) translatey(-1.35em);
	-o-transform: rotate(95deg) translatey(-1.35em);
	transform: rotate(95deg) translatey(-1.35em);
	-webkit-animation: hide .2s;
	-moz-animation: hide .2s;
	-ms-animation: hide .2s;
	-o-animation: hide .2s;
	animation: hide .2s;
}
dl#menu:hover, dl#menu.show {
	-webkit-transform: rotate(5deg) translate(-.1em, -1.75em);
	-moz-transform: rotate(5deg) translate(-.1em, -1.75em);
	-ms-transform: rotate(5deg) translate(-.1em, -1.75em);
	-o-transform: rotate(5deg) translate(-.1em, -1.75em);
	transform: rotate(5deg) translate(-.1em, -1.75em);
	-webkit-animation: show .2s;
	-moz-animation: show .2s;
	-ms-animation: show .2s;
	-o-animation: show .2s;
	animation: show .2s;
	box-shadow: 0 0 .5em 0 #000;
}
@-webkit-keyframes show {
	0% { -webkit-transform: rotate(95deg) translatey(-1.35em); box-shadow: 0 0 0 0 #000; }
	100% { -webkit-transform: rotate(5deg) translate(-.1em, -1.75em); box-shadow: 0 0 .5em 0 #000; }
}
@-moz-keyframes show {
	0% { -moz-transform: rotate(95deg) translatey(-1.35em); box-shadow: 0 0 0 0 #000; }
	100% { -moz-transform: rotate(5deg) translate(-.1em, -1.75em); box-shadow: 0 0 .5em 0 #000; }
}
@-ms-keyframes show {
	0% { -ms-transform: rotate(95deg) translatey(-1.35em); box-shadow: 0 0 0 0 #000; }
	100% { -ms-transform: rotate(5deg) translate(-.1em, -1.75em); box-shadow: 0 0 .5em 0 #000; }
}
@-o-keyframes show {
	0% { -o-transform: rotate(95deg) translatey(-1.35em); box-shadow: 0 0 0 0 #000; }
	100% { -o-transform: rotate(5deg) translate(-.1em, -1.75em); box-shadow: 0 0 .5em 0 #000; }
}
@keyframes show {
	0% { transform: rotate(95deg) translatey(-1.35em); box-shadow: 0 0 0 0 #000; }
	100% { transform: rotate(5deg) translate(-.1em, -1.75em); box-shadow: 0 0 .5em 0 #000; }
}

@-webkit-keyframes hide {
	0% { -webkit-transform: rotate(5deg) translate(-.1em, -1.75em); box-shadow: 0 0 .5em 0 #000; }
	100% { -webkit-transform: rotate(95deg) translatey(-1.35em); box-shadow: 0 0 0 0 #000; }
}
@-moz-keyframes hide {
	0% { -moz-transform: rotate(5deg) translate(-.1em, -1.75em); box-shadow: 0 0 .5em 0 #000; }
	100% { -moz-transform: rotate(95deg) translatey(-1.35em); box-shadow: 0 0 0 0 #000; }
}
@-ms-keyframes hide {
	0% { -ms-transform: rotate(5deg) translate(-.1em, -1.75em); box-shadow: 0 0 .5em 0 #000; }
	100% { -ms-transform: rotate(95deg) translatey(-1.35em); box-shadow: 0 0 0 0 #000; }
}
@-o-keyframes hide {
	0% { -o-transform: rotate(5deg) translate(-.1em, -1.75em); box-shadow: 0 0 .5em 0 #000; }
	100% { -o-transform: rotate(95deg) translatey(-1.35em); box-shadow: 0 0 0 0 #000; }
}
@keyframes hide {
	0% { transform: rotate(5deg) translate(-.1em, -1.75em); box-shadow: 0 0 .5em 0 #000; }
	100% { transform: rotate(95deg) translatey(-1.35em); box-shadow: 0 0 0 0 #000; }
}
#menu dd { border: 1px solid #44443B; }
a { color: #44443B; text-decoration: none; }
a.down { text-decoration: line-through; }
#menu a { color: #747470; }
dd a { padding: 2px 5px; display: block; }
dl.log dd { padding-bottom: 1em; }
dl.log a { display: inline; padding: 0; }
a:hover, #menu a:hover { color: #000; background: #44443B; }
a.down:hover { background: #440000; }
#copy {
	font-size: .75em; color: #44443B;
	position: fixed; bottom: 0;
	-webkit-transform-origin: bottom left;
	-moz-transform-origin: bottom left;
	-ms-transform-origin: bottom left;
	-o-transform-origin: bottom left;
	transform-origin: bottom left;
	-webkit-transform: rotate(-85deg) translate(.7em, 2.35em);
	-moz-transform: rotate(-85deg) translate(.7em, 2.35em);
	-ms-transform: rotate(-85deg) translate(.7em, 2.35em);
	-o-transform: rotate(-85deg) translate(.7em, 2.35em);
	transform: rotate(-85deg) translate(.7em, 2.35em);
}
#content { margin-left: 3em; text-align: justify; padding-right: .5em; }
#content p, #content dl, #content dt { margin: 1em 0; }
li { margin-left: 2em; }
h1, h2, h3, #content dt {
	font-size: 1.5em;
	border-bottom: 2px solid #7F7F70;
	text-align: center;
	position: relative;
	width: 50%;
	margin: .8em auto;
}
hr { height: 2px; background: #7F7F70; margin: .8em auto; width: 10%; }


code {
	font-size: .8em;
	white-space: pre-wrap;
	counter-reset: code;
	background: #111;
	color: #fff;
	display: block;
}
code div {
	counter-increment: code;
	margin-left: 3em;
	padding-left: .25em;
	border-left: 2px solid #fff;
}
code div:before {
	content: counter(code)".";
	display: inline-block;
	width: 3em;
	margin-left: -3em;
	text-align: right;
}
code div:nth-child(6n+1),
code div:nth-child(6n+2),
code div:nth-child(6n+3) { background: #000; }
table { width: 100%; margin: 1em; }

pre.header { padding: 1em; }
:root {
  --accent:#e6e6b0;
  --ink:#e6e6b0;       /* text color on dark backgrounds */
  --panel:#111;        /* cards/hero surface */
  --muted:#44443B;     /* borders, subtle lines */
}

/* 2) Force dark background on both html and body (desktop needs body) */
html, body {
  background: #000 !important;
  color: var(--ink) !important;
}

/* 3) Surface elements */
.card, .hero, pre.banner {
  background: var(--panel);
  border: 1px solid var(--muted);
  color: var(--ink);
}

/* 4) Link contrast (fix black-on-dark hover) */
a { color: var(--accent); text-decoration: none; }
a:hover, #menu a:hover {
  color: #000;                   /* black text */
  background: var(--accent);     /* on a LIGHT accent background → readable */
}

/* 5) Menu + copy text always readable */
#menu, #menu a, #copy, #copy a, footer, footer pre { color: var(--ink); }

/* 6) Banner image: don’t stretch, don’t use percentage height */
.banner-img {
  display: block;
  margin: 0.75rem auto 1rem;
  width: auto;                       /* natural width, not 100% of window */
  max-width: clamp(240px, 70vw, 520px);
  height: auto;                      /* keep aspect */
  object-fit: contain;
  background: #000;
  border: 1px solid var(--muted);
  border-radius: 10px;
}

/* 7) Mobile breathing room: remove left margin from content */
@media (max-width: 640px) {
  #content { margin-left: 0; padding: 0 1rem; }
  .hero h1 { font-size: 1.35rem; }
  .sub { font-size: 0.95rem; }
  .btn { padding: .5em .8em; font-size: 0.95rem; }
  .badge { font-size: 0.9rem; padding: .3em .5em; }
  .grid { grid-template-columns: 1fr; }
  input, textarea, select { font-size: 16px; } /* avoid iOS zoom-on-focus */
}

/* 8) Desktop can keep the side margin */
@media (min-width: 641px) {
  #content { margin-left: 3em; padding-right: .5em; }
}
