/* Textbook of Linux — page + header background patterns
 * Subtle terminal-themed SVG pattern behind the whole site (body)
 * and a denser variant inside the Oxford-blue header banner.
 * Patterns are low-contrast so text remains fully legible.
 */

/* Page background — very faint monospace motif on the grey outer frame */
body {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='120' viewBox='0 0 240 120'%3E%3Cg font-family='ui-monospace,Menlo,monospace' font-size='12' fill='%23002147' opacity='0.14'%3E%3Ctext x='10' y='22'%3E%24 whoami%3C/text%3E%3Ctext x='110' y='22'%3Eroot%3C/text%3E%3Ctext x='10' y='46'%3E%24 uname -a%3C/text%3E%3Ctext x='10' y='70'%3E%23!/bin/bash%3C/text%3E%3Ctext x='10' y='94'%3E%24 ssh linux%3C/text%3E%3Ctext x='130' y='94'%3E~/%3C/text%3E%3Ctext x='10' y='116'%3E0x7fff%3C/text%3E%3C/g%3E%3C/svg%3E") !important;
  background-repeat: repeat !important;
  background-size: 240px 120px !important;
}

.site-header {
  background-image:
    linear-gradient(rgba(0, 33, 71, 0.92), rgba(0, 33, 71, 0.92)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='120' viewBox='0 0 240 120'><g font-family='ui-monospace,Menlo,monospace' font-size='11' fill='%23ffffff'><text x='10' y='20'>$ ls -la /usr/bin</text><text x='10' y='40'>$ cat /etc/os-release</text><text x='10' y='60'>$ grep -r TODO src/</text><text x='10' y='80'>$ systemctl status nginx</text><text x='10' y='100'>$ ssh root@linux</text><text x='160' y='30' fill='%2300FF41'>&gt;_</text><text x='160' y='70' fill='%2300FF41'>&gt;_</text></g></svg>");
  background-size: auto, 240px 120px;
  background-repeat: no-repeat, repeat;
  background-position: center;
}

/* Two-column intro: author photo left, app mockup right */
.intro-columns {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-bottom: -0.5rem;
}

.introduction .flourish {
  margin-top: 0.75rem;
}

.intro-author {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 200px;
}

.intro-app {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.intro-app-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

/* CSS iPhone frame */
.phone-frame {
  position: relative;
  width: 105px;
  padding: 7px 5px;
  background: #1a1a1a;
  border-radius: 20px;
  box-shadow:
    0 0 0 2px #333,
    0 8px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  flex-shrink: 0;
}

.phone-notch {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 12px;
  background: #1a1a1a;
  border-radius: 0 0 10px 10px;
  z-index: 2;
}

.phone-screen {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.app-tagline {
  text-align: left !important;
  font-style: italic;
  color: var(--color-meta, #666);
  font-size: var(--text-sm, 0.875rem);
  margin: 0;
}

.app-store-badge {
  display: inline-block;
  width: 120px;
  transition: opacity 0.15s ease;
}

.app-store-badge:hover {
  opacity: 0.8;
}

.app-store-badge svg {
  display: block;
  width: 100%;
  height: auto;
}

/* App footer on every page */
.app-footer {
  max-width: 42rem;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border, #ddd);
}

.app-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.phone-frame-sm {
  width: 70px;
  padding: 5px 4px;
  border-radius: 14px;
}

.phone-frame-sm .phone-notch {
  width: 30px;
  height: 8px;
  top: 3px;
  border-radius: 0 0 6px 6px;
}

.phone-frame-sm .phone-screen {
  border-radius: 10px;
}

.app-footer-text {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.app-footer-tagline {
  font-style: italic;
  color: var(--color-meta, #666);
  font-size: var(--text-sm, 0.875rem);
  margin: 0;
}

@media (max-width: 600px) {
  .intro-columns {
    flex-direction: column;
    gap: 1.5rem;
  }
  .intro-app {
    justify-content: center;
  }
  .phone-frame {
    width: 100px;
  }
}
