/* System 7 overrides keyed solely off html[data-theme="system7"] */

/* Base: palette, typography, reset of modern effects */
html[data-theme="system7"] {
  --bg-color: #c0c0c0;
  --text-color: #000;
  --muted-color: #333;
  --link-color: #0000ee;
  --link-hover-color: #0000ee;
  --accent-color: #0f1f8f;
  --border-color: #808080;
  --nav-hover-bg: #dcdcdc;
  --nav-active-bg: #c0c0c0;
  --surface-color: #e0e0e0;
  --surface-raised: #e0e0e0;
  --focus-color: #0f1f8f;
  --overlay-bg: rgba(0, 0, 0, 0.45);
  --footer-bg: #dcdcdc;
  --shadow-soft: none;
  --shadow-lift: none;
  font-family: Chicago, Geneva, Helvetica, Arial, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.3;
}

html[data-theme="system7"] * {
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  transition: none !important;
  animation: none !important;
  border-radius: 0 !important;
}

html[data-theme="system7"] body {
  background: #c0c0c0;
  color: var(--text-color);
  cursor: default;
}

/* Links */
html[data-theme="system7"] a {
  color: #0000ee;
  text-decoration: underline;
}

html[data-theme="system7"] a:visited {
  color: #551a8b;
}

html[data-theme="system7"] a:hover,
html[data-theme="system7"] a:focus-visible {
  text-decoration: underline;
}

/* Menu Bar */
html[data-theme="system7"] .site-header {
  background: #e0e0e0;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  border-radius: 0;
  padding: 2px 8px;
  min-height: 22px;
  align-items: center;
  gap: 8px;
}

html[data-theme="system7"] .brand-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

html[data-theme="system7"] .brand-subtitle {
  font-size: 12px;
  opacity: 0.7;
  color: #000;
}

html[data-theme="system7"] .site-nav ul {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  gap: 0;
}

html[data-theme="system7"] .site-nav li + li::before {
  content: " ";
  border-left: 1px solid #808080;
  margin: 0 8px;
}

html[data-theme="system7"] .site-nav a {
  border-radius: 0;
  padding: 2px 6px;
  color: #000;
  font-size: 13px;
  line-height: 1.3;
}

html[data-theme="system7"] .site-nav a:hover,
html[data-theme="system7"] .site-nav a:focus-visible {
  background: #000;
  color: #fff;
  text-decoration: none;
}

html[data-theme="system7"] .site-nav a.active,
html[data-theme="system7"] .site-nav a[aria-current="page"] {
  background: #a9a9a9;
  color: #000;
  font-weight: 700;
  text-decoration: underline;
}

/* Window Chrome */
html[data-theme="system7"] .hero,
html[data-theme="system7"] .page,
html[data-theme="system7"] .card,
html[data-theme="system7"] .post-body {
  position: relative;
  background: #e0e0e0;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  outline: 1px solid #404040;
  outline-offset: -2px;
  padding: 28px var(--space-4) var(--space-6);
}

html[data-theme="system7"] .hero::before,
html[data-theme="system7"] .page::before,
html[data-theme="system7"] .card::before,
html[data-theme="system7"] .post-body::before {
  content: attr(data-s7title);
  position: absolute;
  left: 8px;
  top: 6px;
  right: 8px;
  height: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #000;
  display: flex;
  align-items: center;
  padding-left: 24px;
  background: repeating-linear-gradient(
    90deg,
    #e6e6e6,
    #e6e6e6 2px,
    #dedede 2px,
    #dedede 4px
  );
  border-bottom: 1px solid #808080;
}

/* Fallback titles */
html[data-theme="system7"] .hero::before { content: "Welcome"; }
html[data-theme="system7"] .page::before { content: "Window"; }
html[data-theme="system7"] .card::before { content: "Window"; }
html[data-theme="system7"] .post-body::before { content: "Document"; }

html[data-theme="system7"] .hero::after,
html[data-theme="system7"] .page::after,
html[data-theme="system7"] .card::after,
html[data-theme="system7"] .post-body::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 7px;
  width: 11px;
  height: 11px;
  background: #dcdcdc;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  box-sizing: border-box;
  background-image:
    linear-gradient(45deg, transparent 40%, #404040 40%, #404040 60%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, #404040 40%, #404040 60%, transparent 60%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 1px, 10px 1px;
}

html[data-theme="system7"] .hero:active::after,
html[data-theme="system7"] .page:active::after,
html[data-theme="system7"] .card:active::after,
html[data-theme="system7"] .post-body:active::after {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  transform: translateY(1px);
}

html[data-theme="system7"] .hero-panel::before,
html[data-theme="system7"] .hero-card::before,
html[data-theme="system7"] .hero-panel::after,
html[data-theme="system7"] .hero-card::after {
  content: none;
}

/* Buttons and controls */
html[data-theme="system7"] .theme-toggle,
html[data-theme="system7"] .menu-toggle,
html[data-theme="system7"] .chip,
html[data-theme="system7"] button,
html[data-theme="system7"] input[type="button"],
html[data-theme="system7"] input[type="submit"] {
  font-family: Chicago, Geneva, Helvetica, Arial, system-ui, sans-serif;
  text-transform: none;
  letter-spacing: 0;
  background: #e0e0e0;
  color: #000;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  box-shadow: none;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.3;
  outline: none;
}

html[data-theme="system7"] .theme-toggle:focus-visible,
html[data-theme="system7"] .menu-toggle:focus-visible,
html[data-theme="system7"] button:focus-visible,
html[data-theme="system7"] input[type="button"]:focus-visible,
html[data-theme="system7"] input[type="submit"]:focus-visible {
  outline: 1px dotted #000;
  outline-offset: 2px;
}

html[data-theme="system7"] .theme-toggle:active,
html[data-theme="system7"] .theme-toggle:focus-visible:active,
html[data-theme="system7"] .menu-toggle:active,
html[data-theme="system7"] button:active,
html[data-theme="system7"] input[type="button"]:active,
html[data-theme="system7"] input[type="submit"]:active {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  background: #c0c0c0;
  transform: translateY(1px);
}

/* Text elements */
html[data-theme="system7"] h1,
html[data-theme="system7"] h2,
html[data-theme="system7"] h3,
html[data-theme="system7"] h4,
html[data-theme="system7"] p {
  color: #000;
  letter-spacing: 0;
  margin-bottom: var(--space-3);
}

/* Teletype */
html[data-theme="system7"] .teletype {
  text-align: center;
  color: #000;
}

/* Cursor */
html[data-theme="system7"] #cursor-dot {
  opacity: 0;
}

/* Mobile tweaks */
@media (max-width: 720px) {
  html[data-theme="system7"] .site-header {
    padding: 6px 8px;
    min-height: auto;
  }

  html[data-theme="system7"] .site-nav {
    background: #c0c0c0;
  }

  html[data-theme="system7"] .site-nav ul {
    padding: var(--space-4);
    gap: var(--space-2);
  }

  html[data-theme="system7"] .site-nav a {
    padding: var(--space-3);
    font-size: 14px;
  }

  html[data-theme="system7"] .hero::before,
  html[data-theme="system7"] .page::before,
  html[data-theme="system7"] .card::before,
  html[data-theme="system7"] .post-body::before {
    height: 14px;
    padding-left: 22px;
  }

  html[data-theme="system7"] .hero,
  html[data-theme="system7"] .page,
  html[data-theme="system7"] .card,
  html[data-theme="system7"] .post-body {
    padding-top: 24px;
  }
}
