/* ── TOKENS ── */
:root {
  --bg:          #F7F6F3;
  --text-1:      #0A0A0A;
  --text-2:      #2E2E2E;
  --text-3:      #6B6B6B;
  --text-4:      #A0A0A0;
  --border:      #E2E0DA;
  --card-bg:     #EFEDE8;
  --accent:      #0D9488;
  --max-w:       640px;
  --gap-section: 64px;
  --font-mono:   'DM Mono', monospace;
  --font-sans:   'DM Sans', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg:       #0E0E0C;
  --text-1:   #F0EFE9;
  --text-2:   #C8C6BE;
  --text-3:   #7A7870;
  --text-4:   #4A4844;
  --border:   #222220;
  --card-bg:  #191917;
}

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  transition: background 0.2s, color 0.2s;
}

a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
a:hover { opacity: 0.7; }

.hero__bio a,
.connect__text a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.hero__bio a:hover,
.connect__text a:hover {
  opacity: 0.7;
}

.empty-state {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-4);
  padding: 24px 0;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ── SITE HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

[data-theme="dark"] .site-header {
  background: var(--bg);
}

.site-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header__rss {
  display: flex;
  align-items: center;
  color: var(--text-4);
  transition: color 0.15s;
}

.site-header__rss:hover {
  color: var(--accent);
  opacity: 1;
}

.site-header__rss svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.site-header__nav {
  display: flex;
  gap: 24px;
}

.site-header__link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}

.site-header__link:hover {
  color: var(--text-1);
  opacity: 1;
}

.site-header__link--active {
  color: var(--accent);
  opacity: 1;
}

/* ── LAYOUT ── */
.portfolio {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-section);
}

/* ── HERO ── */
.hero__name {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.hero__name::after {
  content: "_";
  color: var(--accent);
  animation: blink 1.1s step-start infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero__role {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 24px;
}

.hero__bio {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text-2);
}

/* ── SECTION LABEL ── */
.section__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.section__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.section__rule {
  flex: 1;
  border: none;
  border-top: 1px solid var(--border);
}

.section__link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

.section__link:hover {
  color: var(--accent);
  opacity: 1;
}

.section__subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 20px;
}


/* ── STACK ── */
.stack-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stack-group {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.stack-group__label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  letter-spacing: 0.06em;
  min-width: 140px;
  white-space: nowrap;
}

.stack-group__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 8px;
  transition: border-color 0.15s, color 0.15s;
}

.tool-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── PROJECTS ── */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project-item {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: padding-left 0.2s;
}

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

.project-item:hover {
  padding-left: 6px;
}

.project-item__index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  min-width: 24px;
  transition: color 0.15s;
}

.project-item:hover .project-item__index {
  color: var(--accent);
}

.project-item__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-item__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}

.project-item__desc {
  font-size: 13px;
  color: var(--text-3);
}

.project-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.project-item__arrow {
  font-size: 14px;
  color: var(--text-4);
  transition: color 0.15s, transform 0.15s;
  text-decoration: none;
}

.project-item:hover .project-item__arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ── TAG FILTERS ── */
.tag-filters {
  margin-bottom: 24px;
}

.tag-select {
  position: relative;
  display: inline-block;
}

.tag-select__trigger {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 5px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s, color 0.15s;
}

.tag-select__trigger:hover,
.tag-select--open .tag-select__trigger {
  border-color: var(--text-4);
  color: var(--text-1);
}

.tag-select__arrow {
  color: var(--text-4);
  font-size: 10px;
  transition: transform 0.15s;
}

.tag-select--open .tag-select__arrow {
  transform: scaleY(-1);
}

.tag-select__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 0;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tag-select--open .tag-select__dropdown {
  display: block;
}

.tag-option {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s, background 0.15s;
}

.tag-option__count {
  font-size: 10px;
  color: var(--text-4);
  margin-left: auto;
}

.tag-option:hover {
  color: var(--text-1);
  background: var(--card-bg);
}

.tag-option--active {
  color: var(--accent);
}

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

/* ── FILTER STATUS ── */
.filter-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  min-height: 20px;
}

.filter-status__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  letter-spacing: 0.04em;
}

/* ── WRITING ── */
.writing-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Estilo original (mantido para compatibilidade) */
.writing-item {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  padding-left: 0;
  transition: border-color 0.15s, padding-left 0.2s;
}

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

.writing-item:hover {
  border-left-color: var(--accent);
  padding-left: 12px;
}

/* Novo estilo em linha — data + título + tempo de leitura */
.writing-item--row {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding-left: 0;
}

.writing-item--row:hover {
  padding-left: 6px;
}

.writing-item__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
  line-height: 1.2;
  flex-shrink: 0;
}

.writing-item__day {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.writing-item__month {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.writing-item--row .writing-item__title {
  flex: 1;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-1);
}

.writing-item__featured {
  font-size: 12px;
  color: #F59E0B;
  flex-shrink: 0;
}

.writing-item__readtime {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Campos não usados no estilo row */
.writing-item__top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.writing-item__top .writing-item__date {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  flex-shrink: 0;
}

.writing-item__badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--card-bg);
  border-radius: 3px;
  padding: 2px 6px;
  letter-spacing: 0.04em;
}

.writing-item__desc {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}

/* ── CONNECT ── */
.connect__text {
  color: var(--text-2);
  margin-bottom: 20px;
}

.connect__socials {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.social-pill svg {
  width: 13px;
  height: 13px;
  vertical-align: middle;
  margin-bottom: 2px;
}

.social-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 7px 14px;
  text-decoration: none;
  color: var(--text-2);
  letter-spacing: 0.04em;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.social-pill:hover {
  background: var(--card-bg);
  border-color: var(--text-4);
  color: var(--text-1);
  opacity: 1;
}

/* ── PAGINATION ── */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  font-size: 14px;
  color: var(--text-3);
}

.pagination a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 6px 14px;
  transition: background 0.15s;
}

.pagination a:hover {
  background: var(--card-bg);
}

/* ── POST ── */
.post__title {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.post__excerpt {
  font-size: 15px;
  color: var(--text-3);
  margin-bottom: 12px;
  line-height: 1.6;
}

.post__header {
  display: flex;
  flex-direction: column;
}

.post__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-4);
  margin-bottom: 12px;
}

.post__meta-sep {
  color: var(--border);
}

.post__feature-image {
  margin: 0 0 40px;
}

.post__feature-image img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
}

.post__image-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  text-align: center;
  margin-top: 8px;
}

.post__content {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.8;
}

.post__content h1,
.post__content h2,
.post__content h3,
.post__content h4 {
  font-family: var(--font-mono);
  color: var(--text-1);
  margin: 2em 0 0.6em;
  line-height: 1.3;
}

.post__content h2 { font-size: 18px; }
.post__content h3 { font-size: 15px; }

.post__content p  { margin-bottom: 1.2em; }

.post__content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post__content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
}

.post__content pre {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 1.4em;
}

.post__content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
}

.post__content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  color: var(--text-3);
  margin: 1.4em 0;
  font-style: italic;
}

.post__content img {
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.post__content ul,
.post__content ol {
  padding-left: 20px;
  margin-bottom: 1.2em;
}

.post__content li { margin-bottom: 4px; }

.post__footer {
  margin-top: 2rem;
}

.post__footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post__top-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

.post__top-link:hover {
  color: var(--accent);
  opacity: 1;
}

.post__authors {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-4);
}

.post__authors a {
  color: var(--text-3);
  text-decoration: none;
}

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

.post__home-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-align: center;
  transition: color 0.15s;
}

.post__home-link:hover {
  color: var(--accent);
  opacity: 1;
}

/* ── POST NAV ── */
.post__nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.post__nav-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  max-width: 48%;
}

.post__nav-item--right {
  align-items: flex-end;
  text-align: right;
}

.post__nav-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  letter-spacing: 0.06em;
}

.post__nav-title {
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.15s;
}

.post__nav-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  letter-spacing: 0.02em;
}

.post__nav-item:hover .post__nav-title {
  color: var(--accent);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .portfolio { padding: 60px 20px; }
  .site-header__inner { padding: 0 20px; }
}

@media (max-width: 500px) {
  :root { --gap-section: 40px; }
  .portfolio { padding: 48px 20px; }
  .hero__name { font-size: 26px; }
  .stack-group { flex-direction: column; gap: 8px; }
  .stack-group__label { min-width: unset; }
  .post__title { font-size: 22px; }
  .post__nav { flex-direction: column; }
  .post__nav-item { max-width: 100%; }
  .post__nav-item--right { align-items: flex-start; text-align: left; }
}