/* ==========================================================================
   Modern theme refresh — overrides theme "terminal" defaults.
   Loaded after the theme CSS (see partials/head.html), so plain selectors
   here win the cascade without needing !important almost anywhere.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --accent: #ff8c42;
  --accent-2: #ffb37a;
  --background: #0b0d10;
  --surface: #12151a;
  --surface-2: #171b21;
  --color: #e9ebee;
  --color-secondary: #9aa1ab;
  --border-color: rgba(255, 255, 255, 0.09);
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px -12px rgba(0, 0, 0, 0.55);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', Monaco, Consolas, 'Ubuntu Mono', monospace;
}

/* ---- base ---------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(255, 140, 66, 0.07), transparent 40%),
    radial-gradient(circle at 100% 20%, rgba(255, 140, 66, 0.05), transparent 35%);
  background-attachment: fixed;
  font-family: var(--font-sans);
  letter-spacing: normal;
  line-height: 1.7;
}

::selection {
  background: rgba(255, 140, 66, 0.35);
  color: #fff;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--background);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 999px;
  border: 3px solid var(--background);
}
::-webkit-scrollbar-thumb:hover {
  background: #23282f;
}

.container {
  border-right: none;
  max-width: 900px;
}

/* flex items don't shrink below their content's intrinsic size by default,
   which lets a wide image (e.g. a post cover) push the whole card past the
   viewport on narrow screens; min-width:0 lets them shrink normally. */
.container, .content, .posts, .post {
  min-width: 0;
}

.post-cover {
  width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5, h6,
.post-title, .post-meta, .post-tags, .logo,
.header__logo, .menu, .footer, .post-date, .post-author, .post-reading-time {
  font-family: var(--font-mono);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.01em;
}

a {
  transition: color 0.15s ease, opacity 0.15s ease;
}

/* ---- header ---------------------------------------------------------- */

.header {
  padding: 6px 0 0;
}

.header__logo:after {
  display: none;
}

.logo {
  background: var(--surface);
  border: 1px solid var(--border-color);
  color: var(--color);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.logo:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.header .menu {
  margin: 22px 1px 34px;
}

.header .menu__inner li a {
  position: relative;
  color: var(--color-secondary);
  font-weight: 500;
  padding: 4px 2px;
}

.header .menu__inner li a:hover {
  color: var(--color);
}

.header .menu__inner li a:after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: right 0.2s ease;
}

.header .menu__inner li a:hover:after {
  right: 0;
}

.header .menu-trigger,
.header .menu__sub-inner-more-trigger {
  border-radius: var(--radius-sm);
  border-color: var(--border-color);
  color: var(--color-secondary);
}

.header .menu__sub-inner-more,
.header .menu .language-selector__more {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
}

.header .menu__sub-inner-more li {
  padding: 6px 0;
}

.header .menu__sub-inner-more li a:hover,
.header .menu .language-selector__more li a:hover {
  color: var(--accent);
}

@media (max-width: 684px) {
  .header .menu {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 16px;
  }
}

/* ---- prose / content --------------------------------------------------- */

p, li, .post-content, blockquote, td, th {
  color: var(--color);
}

.post-content {
  color: var(--color-secondary);
}
.post-content > div > *,
.post-content p {
  color: var(--color);
}

a.read-more, a.read-more:hover, a.read-more:active {
  color: var(--accent);
  font-weight: 600;
}

code, kbd {
  background: rgba(255, 140, 66, 0.12);
  border-radius: 6px;
  border: 1px solid rgba(255, 140, 66, 0.18);
}

pre, .code-toolbar {
  background: var(--surface) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius) !important;
  padding: 20px !important;
}

:not(pre) > code[class*="language-"], pre[class*="language-"] {
  background: transparent;
}

blockquote {
  border: none;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 32px 0;
}

blockquote p:first-of-type:before {
  display: none;
}

table {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

table, td, th {
  border: 1px solid var(--border-color);
  border-top: none;
  border-left: none;
}

th {
  background: var(--surface);
  color: var(--accent);
  text-align: left;
}

hr {
  background: var(--border-color);
  margin: 40px 0;
}

img, .post-cover {
  border-radius: var(--radius-lg);
}

.post-cover {
  background: var(--surface);
  border: 1px solid var(--border-color);
  padding: 12px;
}

figure figcaption {
  background: var(--surface);
  color: var(--color-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

mark {
  background: var(--accent);
  color: #10120f;
  border-radius: 4px;
  padding: 0 2px;
}

.hanchor {
  color: var(--accent);
}

.framed {
  border: 1px solid var(--border-color);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ---- post list / cards -------------------------------------------------- */

.posts {
  margin-top: 10px;
}

.post.on-list {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  margin: 0 0 22px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.post.on-list:not(:last-of-type) {
  border-bottom: 1px solid var(--border-color);
}

.post.on-list:hover {
  border-color: rgba(255, 140, 66, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.post-title {
  --border: none;
  border-bottom: none;
  color: var(--color);
  font-size: 1.5rem;
  padding-bottom: 6px;
}

.post-title:after {
  display: none;
}

.post.on-list .post-title {
  font-size: 1.35rem;
}

.post-title a:hover {
  color: var(--accent);
}

.post-meta {
  color: var(--color-secondary);
  opacity: 1;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.post-meta .post-date {
  color: var(--accent);
}

.post-tags {
  opacity: 1;
  margin: 10px 0 18px;
}

.post-tags a {
  display: inline-block;
  background: rgba(255, 140, 66, 0.1);
  border: 1px solid rgba(255, 140, 66, 0.25);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.78rem;
  margin: 0 6px 6px 0;
  transition: background 0.15s ease;
}

.post-tags a:hover {
  background: rgba(255, 140, 66, 0.22);
}

/* ---- tags/terms index page ------------------------------------------------ */

.terms h1 {
  color: var(--color);
  margin-bottom: 24px;
}

.terms ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 10px;
}

.terms li {
  margin: 0;
}

.terms li:before {
  content: none;
}

.terms-title {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border-color);
  color: var(--color);
  border-radius: 999px;
  padding: 8px 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.terms-title:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* single post header gets a little more room to breathe */
.post:not(.on-list) > .post-title {
  font-size: 2rem;
  margin-top: 10px;
}

/* ---- buttons & pagination ------------------------------------------------ */

.button, a.button, button {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: #14100b;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover, a.button:hover, button:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.button.outline, a.button.outline, button.outline {
  background: transparent;
  color: var(--accent);
}

.button.outline:hover, a.button.outline:hover, button.outline:hover {
  background: rgba(255, 140, 66, 0.1);
}

a.read-more.button {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--accent);
  padding: 0;
}
a.read-more.button:hover {
  background: none;
  transform: none;
  box-shadow: none;
  opacity: 0.8;
}

.pagination__title-h {
  background: var(--background);
  color: var(--color-secondary);
}

input, select, textarea {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--color);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

/* ---- footer -------------------------------------------------------------- */

.footer {
  opacity: 1;
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
  color: var(--color-secondary);
  font-size: 0.85rem;
}

.footer a:hover {
  color: var(--accent);
}

/* ---- responsive polish ---------------------------------------------------- */

@media (max-width: 684px) {
  .post.on-list {
    padding: 20px 18px;
  }

  .post:not(.on-list) > .post-title {
    font-size: 1.5rem;
  }
}
