/*
 * Terminal theme for Webstead.
 * Loaded after the default theme's theme.css: it swaps the palette, type,
 * and radii through the same custom properties, then adds terminal details.
 */

/* ---------- Light (paper terminal) ---------- */
:root {
  color-scheme: light;
  --ink: #1b241d;
  --muted: #5a6a5e;
  --inverse-text: #f4f1e8;
  --paper: #f4f1e8;
  --panel: #fbfaf4;
  --surface-cream: #fbfaf4;
  --surface-warm: #ece8db;
  --surface-accent-soft: #e3efe3;
  --surface-accent-soft-alt: #e3efe3;
  --surface-accent-hover: #d4e8d6;
  --activity-surface: #fbfaf4;
  --activity-border: #d3cfc0;
  --interaction-surface: #f7f5ec;
  --map-surface: #ece8db;
  --photo-dark: #0b0f0c;
  --accent: #0f8a4a;
  --accent-deep: #0b6b39;
  --line: #d3cfc0;
  --shadow: transparent;
  --accent-shadow: transparent;
  --accent-shadow-strong: transparent;
  --interaction-shadow: transparent;
  --input-shadow: transparent;
  --focus-shadow: rgba(15, 138, 74, 0.25);
  --scrollbar-shadow: rgba(27, 36, 29, 0.25);
  --glass-light: rgba(251, 250, 244, 0.6);
  --glass-lighter: rgba(251, 250, 244, 0.85);
  --photo-dot: rgba(0, 0, 0, 0.18);
  --photo-dot-active: rgba(0, 0, 0, 0.6);
  --site-admin-bar-bg: #ece8db;
  --site-admin-bar-hamburger-bg: #5a6a5e;
  --bg-start: #f4f1e8;
  --bg-end: #f4f1e8;
  --bg-pattern: none;
  --term-red: #e0443e;
  --term-yellow: #d9a514;
  --term-green: #1f9d55;

  --font-body: "JetBrains Mono", "IBM Plex Mono", "Menlo", "Consolas", monospace;
  --font-heading: "JetBrains Mono", "IBM Plex Mono", "Menlo", "Consolas", monospace;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "Menlo", "Consolas", monospace;
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 3px;
  --radius-xl: 3px;
  --radius-pill: 2px;
}

/* ---------- Dark (phosphor) ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #d8e0d0;
  --muted: #8a9a8e;
  --inverse-text: #0b0f0c;
  --paper: #0b0f0c;
  --panel: #111712;
  --surface-cream: #121a14;
  --surface-warm: #17201a;
  --surface-accent-soft: #13251a;
  --surface-accent-soft-alt: #13251a;
  --surface-accent-hover: #1a3323;
  --activity-surface: #111712;
  --activity-border: #26342b;
  --interaction-surface: #0f1511;
  --map-surface: #17201a;
  --photo-dark: #000000;
  --accent: #a3f7bf;
  --accent-deep: #4ade80;
  --line: #26342b;
  --focus-shadow: rgba(74, 222, 128, 0.25);
  --scrollbar-shadow: rgba(216, 224, 208, 0.25);
  --glass-light: rgba(17, 23, 18, 0.6);
  --glass-lighter: rgba(17, 23, 18, 0.85);
  --photo-dot: rgba(255, 255, 255, 0.25);
  --photo-dot-active: rgba(255, 255, 255, 0.7);
  --site-admin-bar-bg: #111712;
  --site-admin-bar-hamburger-bg: #8a9a8e;
  --bg-start: #0b0f0c;
  --bg-end: #0b0f0c;
  --term-red: #ff5f56;
  --term-yellow: #ffbd2e;
  --term-green: #27c93f;
}

/* ---------- Base ---------- */
body {
  background: var(--paper);
  background-image: none;
  line-height: 1.65;
  font-size: 0.95rem;
  font-variant-ligatures: none;
}

::selection {
  background: var(--accent-deep);
  color: var(--inverse-text);
}

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

button,
input,
select,
textarea {
  font-family: var(--font-mono);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0;
}

/* CRT scanlines (opt-in, dark mode only) */
html[data-theme="dark"] body.has-scanlines::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.18) 3px
  );
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  padding: 1.5rem 6vw 1.5rem;
  border-bottom: 1px dashed var(--line);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.term-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--line);
}

.term-dot--close { background: var(--term-red); }
.term-dot--min { background: var(--term-yellow); }
.term-dot--max { background: var(--term-green); }

.term-bar__title {
  margin-left: 0.75rem;
}

.site-title a {
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 2.6vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}

.site-title .prompt {
  color: var(--accent-deep);
  font-weight: 500;
  margin-right: 0.25ch;
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 0.35ch;
  vertical-align: text-bottom;
  background: var(--accent-deep);
  animation: term-blink 1.1s steps(1) infinite;
}

html[data-motion="reduced"] .cursor {
  animation: none;
}

@keyframes term-blink {
  50% {
    opacity: 0;
  }
}

.site-tagline {
  margin-top: 0.75rem;
}

.site-tagline::before {
  content: "# ";
}

.site-nav {
  margin-top: 1.25rem;
  gap: 1.25rem;
}

.site-nav a {
  padding: 0.15rem 0.1rem;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
}

.site-nav a::before {
  content: "[";
  color: var(--muted);
}

.site-nav a::after {
  content: "]";
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--accent-deep);
  background: var(--surface-accent-soft);
}

.theme-toggle {
  position: absolute;
  top: 1.25rem;
  right: 6vw;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--accent-deep);
  border-color: var(--accent-deep);
}

@media (max-width: 640px) {
  .theme-toggle {
    position: static;
    display: block;
    margin-bottom: 1rem;
  }
}

/* ---------- Entries ---------- */
.author-card,
.entry-article,
.entry-activity,
.entry-note,
.entry-summary,
.entry-photo,
.entry-like,
.entry-bookmark,
.entry-reply,
.entry-repost,
.photo-slider,
.page-entry {
  box-shadow: none;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-deep);
}

.page-entry {
  background: var(--panel);
  padding: 2rem;
  border-radius: var(--radius-lg);
}

.entry-header h1.p-name::before,
.entry-header h3.p-name::before {
  content: "> ";
  color: var(--accent-deep);
}

.entry-header a,
.entry-header a:hover {
  color: var(--ink);
}

.entry-header a:hover h1,
.entry-header a:hover h3 {
  color: var(--accent-deep);
}

.entry-meta {
  font-size: 0.8rem;
}

.e-content h2::before {
  content: "## ";
  color: var(--muted);
}

.e-content h3::before {
  content: "### ";
  color: var(--muted);
}

.e-content a,
.author-bio a,
.p-summary a {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.e-content blockquote {
  margin: 1.25rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 2px solid var(--accent-deep);
  color: var(--muted);
}

.e-content :not(pre) > code,
.p-content :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  font-size: 0.9em;
}

.e-content pre,
.p-content pre {
  background: var(--surface-warm);
  border-color: var(--line);
}

.e-content hr {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 2rem 0;
}

.tags a {
  background: transparent;
  border: 1px solid var(--line);
}

.tags a:hover {
  border-color: var(--accent-deep);
}

.author-media img {
  border: 1px solid var(--line);
}

.section-header h1::before,
.section-header h2::before {
  content: "$ ";
  color: var(--accent-deep);
}

/* ---------- Maps: darken the tiles in dark mode ---------- */
html[data-theme="dark"] .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px dashed var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer::before {
  content: "-- EOF --";
  color: var(--muted);
}

.footer-nav a::before {
  content: "./";
  color: var(--muted);
}
