
/* =========================================
   MizfitXTM — Gruvbox Dark
   ========================================= */

:root {
  color-scheme: dark;

  --bg: #282828;
  --bg-hard: #1d2021;
  --bg-soft: #32302f;
  --surface: #3c3836;
  --surface-light: #504945;

  --fg: #ebdbb2;
  --fg-muted: #d5c4a1;
  --muted: #bdae93;
  --subtle: #928374;

  --red: #fb4934;
  --orange: #fe8019;
  --yellow: #fabd2f;
  --green: #b8bb26;
  --aqua: #8ec07c;
  --blue: #83a598;
  --purple: #d3869b;

  --border: #504945;
  --radius: 10px;
  --content-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", "Cascadia Code", "Fira Code",
    "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: var(--bg-hard);
  background: var(--yellow);
}

a {
  color: var(--aqua);
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease;
}

a:hover {
  color: var(--yellow);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
}

img {
  max-width: 100%;
  height: auto;
}

.site-container {
  width: min(var(--content-width), calc(100% - 40px));
  min-height: 100vh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}

/* Header and navigation */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  background: rgba(40, 40, 40, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.logo {
  flex-shrink: 0;
  color: var(--yellow);
  font-weight: 800;
  letter-spacing: -0.06em;
  font-size: 1.15rem;
}

.logo::before {
  content: ">";
  margin-right: 9px;
  color: var(--green);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--yellow);
}

/* Main content */

main {
  flex: 1;
  padding: 48px 0 72px;
  min-width: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--fg);
  line-height: 1.3;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(2.1rem, 6vw, 3.7rem);
}

h2 {
  margin-top: 52px;
  margin-bottom: 18px;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

h3 {
  font-size: 1.12rem;
}

p,
ul,
ol {
  color: var(--fg-muted);
}

li {
  padding-left: 4px;
  margin-bottom: 6px;
}

li::marker {
  color: var(--green);
}

hr {
  height: 1px;
  margin: 36px 0;
  border: 0;
  background: var(--border);
}

strong {
  color: var(--fg);
}

blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--yellow);
  color: var(--muted);
  background: var(--bg-soft);
}

small,
.text-muted {
  color: var(--muted);
}

/* Terminal-style hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 5vw, 54px);
  background:
    radial-gradient(ellipse at top right, rgba(184, 187, 38, 0.07), transparent 50%),
    var(--bg-hard);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--green);
  font-size: 0.82rem;
}

.eyebrow::before {
  content: "┌─ ";
  color: var(--subtle);
}

.hero h1 {
  margin-bottom: 12px;
}

.hero h1 span {
  color: var(--yellow);
}

.hero-subtitle {
  margin: 0 0 22px;
  color: var(--aqua);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.hero-description {
  max-width: 680px;
  margin-bottom: 28px;
  font-size: 0.96rem;
}

.prompt {
  color: var(--green);
}

.prompt::before {
  content: "misfit@security:~$ ";
  color: var(--yellow);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  font-size: 0.86rem;
  transition: transform 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--yellow);
  color: var(--yellow);
}

.button-primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--bg-hard);
  font-weight: 700;
}

.button-primary:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--bg-hard);
}

/* Sections and cards */

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 56px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
}

.section-link {
  font-size: 0.82rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  min-width: 0;
  padding: 22px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 160ms ease, transform 160ms ease;
}

.card:hover {
  border-color: var(--subtle);
  transform: translateY(-2px);
}

.card h3 {
  margin: 0 0 10px;
}

.card p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.card-icon {
  display: block;
  margin-bottom: 14px;
  color: var(--yellow);
  font-size: 1.25rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.tag-list li {
  margin: 0;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--aqua);
  font-size: 0.75rem;
}

/* Posts and technical writing */

.post-list {
  display: grid;
  gap: 0;
}

.post-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.post-item:first-child {
  border-top: 1px solid var(--border);
}

.post-item h3 {
  margin: 0 0 6px;
}

.post-meta {
  color: var(--subtle);
  font-size: 0.8rem;
}

.post-meta time {
  color: var(--yellow);
}

.post-excerpt {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

/* Code blocks */

code,
pre {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--bg-hard);
  color: var(--orange);
  font-size: 0.9em;
}

div.highlighter-rouge,
figure.highlight,
pre {
  max-width: 100%;
}

pre {
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-hard);
  color: var(--fg);
  line-height: 1.7;
  tab-size: 2;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.highlight {
  margin: 22px 0;
}

.highlight .c,
.highlight .c1,
.highlight .cm {
  color: var(--subtle);
}

.highlight .k,
.highlight .kd,
.highlight .kn {
  color: var(--red);
}

.highlight .s,
.highlight .s1,
.highlight .s2 {
  color: var(--green);
}

.highlight .nf,
.highlight .nb {
  color: var(--yellow);
}

/* Tables */

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

th {
  background: var(--surface);
  color: var(--yellow);
}

/* Footer */

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
  color: var(--subtle);
  font-size: 0.78rem;
}

/* Accessibility and responsive layout */

@media (max-width: 700px) {
  .site-container {
    width: min(100% - 28px, var(--content-width));
  }

  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 8px 16px;
  }

  main {
    padding-top: 28px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 24px 20px;
  }

  .site-footer {
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Branding and accessibility refinements */

:root {
  --focus-color: #fabd2f;
  --selection-bg: #504945;
}

::selection {
  background: var(--selection-bg);
  color: #ebdbb2;
}

html {
  scroll-behavior: smooth;
}

a {
  text-underline-offset: 0.22em;
  transition: color 140ms ease;
}

a:hover {
  color: var(--aqua);
}

:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 4px;
  border-radius: 3px;
}

/* Keep keyboard focus visible on navigation and buttons */
.site-nav a:focus-visible,
.button:focus-visible {
  outline-color: var(--yellow);
  outline-offset: 4px;
}

/* Respect visitors who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

