/*
Theme Name: Tinker Terminal
Theme URI: https://onlytinker.com
Author: Andrew
Description: Dark terminal-modern theme for onlytinker.com. JetBrains Mono chrome, Inter prose, emerald accent on near-black. Custom build from the winning "Dark Terminal Modern" sketch.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
License: MIT
Text Domain: tinker-terminal
*/

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0e12;
  --surface: #11161c;
  --surface-2: #161d25;
  --border: #1f2933;
  --text: #d7e0ea;
  --muted: #7b8a99;
  --accent: #4ee1a0;
  --accent-dim: rgba(78, 225, 160, 0.12);
  --amber: #ffc857;
  --amber-dim: rgba(255, 200, 87, 0.08);
  --radius: 10px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html { scrollbar-color: #26303b var(--bg); }
::selection { background: rgba(78, 225, 160, 0.25); }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: #7cf0bd; }
.mono, .post-date, .tag, .section-label, .hero-line, .hero-stats .stat, .single-meta, .back-link, .pagination, footer .foot-inner {
  font-family: var(--mono);
}

/* ---------- nav ---------- */
nav.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
nav.site-nav.overlaid {
  position: absolute; left: 0; right: 0; top: 0;
  background: linear-gradient(rgba(6, 9, 12, 0.72), rgba(6, 9, 12, 0));
  border-bottom: none;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.logo:hover { color: var(--text); }
.logo .prompt { color: var(--accent); }
.nav-links ul { display: flex; gap: 4px; align-items: center; list-style: none; margin: 0; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-family: var(--mono);
  padding: 8px 14px; border-radius: 6px; transition: color .15s, background .15s;
  display: inline-block;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links .current-menu-item a,
.nav-links a.active { color: var(--accent); background: var(--accent-dim); }

/* ---------- Felt-style hero ---------- */
.felt-hero {
  position: relative;
  height: 100svh; min-height: 560px;
  overflow: hidden;
  background: var(--bg);
}
.felt-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 1s ease;
  pointer-events: none;
}
.felt-slide.active { opacity: 1; pointer-events: auto; }
.felt-slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  animation: kenburns 9s ease-out forwards;
  transform-origin: center;
}
@keyframes kenburns {
  from { transform: scale(1.02); }
  to   { transform: scale(1.12); }
}
.felt-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(6,9,12,0.55) 0%, rgba(6,9,12,0.1) 40%, rgba(6,9,12,0.55) 78%, rgba(6,9,12,0.88) 100%),
    linear-gradient(90deg, rgba(6,9,12,0.55) 0%, rgba(6,9,12,0.15) 55%, rgba(6,9,12,0) 100%);
}

.felt-copy {
  position: absolute; left: 24px; right: 24px; bottom: 18vh;
  max-width: 1100px; margin: 0 auto;
}
.felt-copy .hero-line { font-size: 13px; margin-bottom: 14px; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.felt-copy h1.hero-title {
  font-size: clamp(30px, 5.5vw, 58px);
  max-width: 16ch; text-shadow: 0 2px 24px rgba(0,0,0,.55);
}
.felt-copy .hero-sub { font-size: 15.5px; max-width: 48ch; }
.felt-copy .hero-sub, .felt-copy .hero-line { color: #c9d4de; }
.felt-copy .hero-sub b { color: #fff; }
.hero-cta { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { animation: rise .8s cubic-bezier(.2,.7,.3,1) forwards; }
.reveal:nth-child(2).in { animation-delay: .08s; }
.reveal:nth-child(3).in { animation-delay: .16s; }
.reveal:nth-child(4).in { animation-delay: .24s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.felt-counter {
  position: absolute; top: 84px; right: 28px;
  font-size: 13px; color: #fff; letter-spacing: .08em;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
.felt-counter .sep { color: var(--accent); margin: 0 4px; }

.felt-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(10, 14, 18, 0.55); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; font-size: 18px; cursor: pointer; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); transition: background .15s, border-color .15s;
}
.felt-arrow:hover { background: rgba(78, 225, 160, 0.35); border-color: var(--accent); }
.felt-arrow.prev { left: 22px; }
.felt-arrow.next { right: 22px; }

.felt-tabs {
  position: absolute; right: 28px; bottom: 26px;
  display: flex; gap: 10px; z-index: 5;
}
.felt-tab {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  background: none; border: none; padding: 0; cursor: pointer;
  opacity: .55; transition: opacity .2s;
}
.felt-tab:hover { opacity: .85; }
.felt-tab.active { opacity: 1; }
.felt-tab .num { font-size: 12px; color: #fff; letter-spacing: .1em; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.felt-tab.active .num { color: var(--accent); }
.felt-tab .thumb {
  width: 58px; height: 40px; object-fit: cover; border-radius: 6px; display: block;
  border: 1px solid rgba(255,255,255,0.3); transition: border-color .2s;
}
.felt-tab.active .thumb { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.felt-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.12); }
.felt-progress .bar { height: 100%; width: 0; background: var(--accent); }

.felt-scroll {
  position: absolute; left: 28px; bottom: 26px;
  font-size: 12px; color: #c9d4de; text-decoration: none; letter-spacing: .08em;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
.felt-scroll:hover { color: var(--accent); }

@media (max-width: 640px) {
  .felt-copy { bottom: 21vh; }
  .felt-arrow { display: none; }
  .felt-tabs { right: 20px; bottom: 20px; }
  .felt-tab .thumb { width: 44px; height: 30px; }
  .felt-scroll { display: none; }
  .felt-counter { top: 70px; right: 20px; }
}

/* ---------- hero (non-slider pages) ---------- */
header.hero { max-width: 1100px; margin: 0 auto; padding: 72px 24px 48px; }
.hero-line { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.hero-line .ok { color: var(--accent); }
h1.hero-title {
  font-size: clamp(34px, 5vw, 52px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
  max-width: 720px;
}
h1.hero-title .dim { color: var(--muted); font-weight: 300; }
.hero-sub { color: var(--muted); font-size: 17px; margin-top: 18px; max-width: 560px; }
.hero-sub b { color: var(--text); font-weight: 600; }
.hero-stats { display: flex; gap: 28px; margin-top: 36px; flex-wrap: wrap; }
.hero-stats .stat { font-size: 13px; color: var(--muted); }
.hero-stats .stat b { color: var(--accent); font-size: 20px; font-weight: 700; display: block; }

header.hero.hero-small { padding: 48px 24px 24px; }
.hero-small .hero-title { font-size: clamp(24px, 3.5vw, 34px); }

/* ---------- post list ---------- */
main.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px 80px; }
.section-label {
  font-size: 12.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em;
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.section-label .hash { color: var(--accent); }

.btn {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  border-radius: 8px; padding: 10px 18px; cursor: pointer;
  text-decoration: none; display: inline-block;
  transition: background .15s, border-color .15s;
}
.btn.primary {
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(78,225,160,.4);
}
.btn.primary:hover { background: rgba(78,225,160,.22); color: var(--accent); }
.btn.ghost {
  background: rgba(255,255,255,0.06); color: #c9d4de;
  border: 1px solid rgba(255,255,255,0.25);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-row {
  display: grid; grid-template-columns: 96px 110px 1fr auto; gap: 20px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .15s, background .15s;
}
.post-row:hover { border-color: rgba(78, 225, 160, 0.45); transform: translateY(-2px); background: var(--surface-2); }
.post-row .row-thumb {
  width: 96px; height: 64px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border); display: block;
}
.post-row.no-thumb { grid-template-columns: 110px 1fr auto; }
.row-main { min-width: 0; }
.post-date { font-size: 12.5px; color: var(--muted); }
.post-date .d { color: var(--text); font-weight: 600; font-size: 15px; display: block; }
.post-title { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.post-row:hover .post-title { color: var(--accent); }
.post-excerpt {
  font-size: 13.5px; color: var(--muted); margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.tag {
  font-size: 11px; padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.tag.solved { color: var(--accent); border-color: rgba(78, 225, 160, 0.4); background: var(--accent-dim); }
.tag.warn { color: var(--amber); border-color: rgba(255, 200, 87, 0.4); background: var(--amber-dim); }

.empty-state { color: var(--muted); font-family: var(--mono); padding: 40px 0; }

/* ---------- pagination ---------- */
.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
  font-size: 12.5px; padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--border); color: var(--muted); text-decoration: none;
}
.pagination a.page-numbers:hover { color: var(--text); background: var(--surface-2); }
.pagination .page-numbers.current { color: var(--accent); background: var(--accent-dim); border-color: rgba(78,225,160,.4); }

/* ---------- single ---------- */
article.single-wrap { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }
.back-link {
  display: inline-block; font-size: 13px; color: var(--muted); text-decoration: none;
  margin-bottom: 28px; padding: 6px 12px 6px 8px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface);
}
.back-link:hover { color: var(--accent); border-color: rgba(78,225,160,.4); }
h1.single-title {
  font-size: clamp(28px, 4.5vw, 40px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
}
.single-meta { font-size: 12.5px; color: var(--muted); margin: 16px 0 36px; }
.single-meta .dot { margin: 0 8px; color: var(--border); }
.single-meta .cat a { color: var(--accent); text-decoration: none; }

.post-nav {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 56px;
  border-top: 1px solid var(--border); padding-top: 24px;
}
.post-nav a {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted); text-decoration: none;
  max-width: 48%; line-height: 1.5;
}
.post-nav a:hover { color: var(--accent); }
.post-nav .next { text-align: right; margin-left: auto; }
.post-nav .dir { color: var(--accent); display: block; font-size: 11px; }

/* ---------- prose ---------- */
.prose { font-size: 16.5px; line-height: 1.75; color: #c4cfdc; }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { color: var(--text); line-height: 1.3; letter-spacing: -0.01em; margin-top: 1.6em; }
.prose h2 { font-size: 24px; }
.prose h3 { font-size: 19px; }
.prose h4 { font-size: 16.5px; }
.prose a { color: var(--accent); text-decoration-color: rgba(78,225,160,.35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--accent); font-family: var(--mono); }
.prose blockquote {
  border-left: 2px solid var(--accent); background: var(--surface);
  padding: 14px 20px; border-radius: 0 8px 8px 0; color: var(--muted);
}
.prose code {
  font-family: var(--mono); font-size: .86em; color: #8be0b8;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 5px;
}
.prose pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; overflow-x: auto; line-height: 1.6; font-size: 13.5px;
}
.prose pre code { background: none; border: none; padding: 0; color: #a9d8c2; font-size: inherit; }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); max-width: 100%; height: auto; }
.prose figcaption, .prose .wp-element-caption, .prose .wp-caption-text {
  font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center;
}
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface); font-family: var(--mono); font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.prose .wp-block-image.alignwide, .prose .alignwide { width: 100%; }
.prose .wp-block-image figcaption { margin-top: 8px; }

/* ---------- comments ---------- */
.comments-area { margin-top: 56px; border-top: 1px solid var(--border); padding-top: 28px; }
.comments-area h2 { font-size: 16px; margin-bottom: 20px; }
.comment-list { list-style: none; }
.comment-list .comment {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 12px;
}
.comment-list .children { list-style: none; margin-top: 12px; padding-left: 20px; }
.comment-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.comment-meta b { color: var(--accent); }
.comment-body { font-size: 14.5px; color: #c4cfdc; }
.comment-reply-link { font-family: var(--mono); font-size: 12px; }
.comment-form label { display: block; font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: var(--sans); font-size: 14.5px; padding: 10px 12px; margin-bottom: 16px;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: rgba(78,225,160,.5); }
.comment-form .submit, .btn {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(78,225,160,.4); border-radius: 8px;
  padding: 10px 18px; cursor: pointer; transition: background .15s;
}
.comment-form .submit:hover, .btn:hover { background: rgba(78,225,160,.22); }
.comment-form-cookies-consent { display: flex; align-items: center; gap: 8px; }
.comment-form-cookies-consent label { margin: 0; font-family: var(--sans); font-size: 12.5px; }

/* ---------- footer ---------- */
footer.site-footer { border-top: 1px solid var(--border); padding: 32px 24px; margin-top: 40px; }
.foot-inner {
  max-width: 1100px; margin: 0 auto; display: flex;
  justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.foot-inner, .foot-inner a { font-size: 12.5px; color: var(--muted); }
.foot-inner a { text-decoration: none; margin-left: 18px; }
.foot-inner a:hover { color: var(--accent); }

/* ---------- 404 ---------- */
.err404 .error-terminal {
  max-width: 760px; margin: 0 auto; padding: 48px 24px 80px;
  font-family: var(--mono);
}
.err404 .error-terminal .code { color: var(--accent); font-size: 64px; font-weight: 700; }
.err404 .error-terminal p { color: var(--muted); margin: 12px 0 28px; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .post-row { grid-template-columns: 1fr; gap: 10px; }
  .post-row.no-thumb { grid-template-columns: 1fr; }
  .post-row .row-thumb { width: 100%; height: 140px; }
  .tag { justify-self: start; }
  .nav-links li:not(.current-menu-item) { display: none; }
  header.hero { padding: 48px 24px 32px; }
}

/* TurnKey appliance credit — restyle to match */
#turnkey-credit {
  font-family: var(--mono) !important;
  font-size: 11px !important;
  color: var(--muted) !important;
  text-align: center;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
#turnkey-credit a { color: var(--muted) !important; text-decoration: none !important; }
#turnkey-credit a:hover { color: var(--accent) !important; }

/* admin bar overlap fix */
body.admin-bar nav.site-nav { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar nav.site-nav { top: 46px; } }
