/* ==========================================================================
   Manuel Taveira — main stylesheet
   Plain, list-based typesetting. No card grids, no button chrome,
   no pill filters — just a document with sections.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.link {
  color: var(--accent);
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
}
.link:hover { text-decoration-color: var(--accent); }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}

.label {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: var(--container-wide); margin: 0 auto; padding: 0 24px; }

/* ---------------------------------- Header ---------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.nav { display: flex; align-items: center; gap: 24px; }

.nav__links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.94rem;
}

.nav__links a { color: var(--ink-soft); border-bottom: 1px solid transparent; padding-bottom: 2px; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink-faint); }

.theme-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  width: 30px; height: 30px;
  border: 1px solid var(--line-strong);
  background: none;
  cursor: pointer;
  color: var(--ink);
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 15px; height: 15px; }

/* ---------------------------------- Hero ---------------------------------- */

.hero { padding: 64px 0 48px; border-bottom: 1px solid var(--line); }

.hero .label { display: block; margin-bottom: 16px; }

.hero h1 { font-size: clamp(2rem, 4.4vw, 2.7rem); }

.hero__lede {
  margin-top: 14px;
  max-width: 52ch;
  font-size: 1.08rem;
  color: var(--ink-soft);
}

.hero__actions {
  margin-top: 24px;
  font-size: 0.96rem;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.hero__actions a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--line-strong); }
.hero__actions a:hover { text-decoration-color: var(--accent); }
.hero__actions .sep { color: var(--ink-faint); }

.btn-cv {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--ink);
  color: var(--ink) !important;
  text-decoration: none !important;
  font-size: 0.92rem;
  font-weight: 500;
}
.btn-cv:hover { background: var(--ink); color: var(--paper) !important; }

/* ---------------------------------- Sections ---------------------------------- */

section.block { padding: 48px 0; border-bottom: 1px solid var(--line); }
section.block:last-of-type { border-bottom: none; }

.block__head { margin-bottom: 24px; }
.block__head h2 { margin-top: 6px; font-size: 1.3rem; }

/* About / portrait */

.about { display: grid; grid-template-columns: 168px 1fr; gap: 36px; align-items: start; }

.portrait {
  width: 176px;
  height: 220px;
  overflow: hidden;
  background: var(--paper-raised);
  padding: 6px;
  border: 1px solid var(--line-strong);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(1) contrast(1.05) brightness(1.02);
}
.portrait--placeholder {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--ink-faint);
}

.about__body p { color: var(--ink-soft); margin: 0 0 14px; }
.about__body p:last-child { margin-bottom: 0; }

/* Plain fact rows — used for languages, skills, misc key/value data */

.fact-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.fact-row:first-child { border-top: 1px solid var(--line); }
.fact-row dt { color: var(--ink-faint); }
.fact-row dd { margin: 0; color: var(--ink-soft); }

/* Entry list — experience, education, certifications, projects */

.entry-list { border-top: 1px solid var(--line-strong); }

.entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.entry__date { font-size: 0.82rem; color: var(--ink-faint); white-space: nowrap; }

.entry__main h3 { font-size: 1.02rem; font-weight: 600; font-family: var(--font-body); }
.entry__org { color: var(--accent); font-size: 0.92rem; margin-top: 2px; }
.entry__desc { margin-top: 6px; color: var(--ink-soft); font-size: 0.93rem; max-width: 58ch; }
.entry__desc ul { margin: 6px 0 0; padding-left: 1.1em; }
.entry__desc li + li { margin-top: 3px; }
.entry__link { margin-top: 6px; font-size: 0.9rem; }

/* Simple link list — projects grouped by category, blog previews */

.link-list { border-top: 1px solid var(--line-strong); }
.link-list__item {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.link-list__item h3 { font-size: 1rem; font-weight: 600; font-family: var(--font-body); }
.link-list__item .meta { color: var(--ink-faint); font-size: 0.82rem; margin-left: 8px; }
.link-list__item p { color: var(--ink-soft); font-size: 0.92rem; margin: 4px 0 0; }
a.link-list__item:hover h3 { color: var(--accent); }

.group-label { margin: 32px 0 4px; }
.group-label:first-child { margin-top: 0; }

.section-cta { margin-top: 20px; font-size: 0.94rem; }

/* Footer */

.site-footer { padding: 48px 0 36px; }

.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.footer__prompt h2 { font-size: 1.4rem; max-width: 20ch; }
.footer__prompt p { color: var(--ink-soft); margin-top: 10px; max-width: 42ch; }

.social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
}
.social-list a { color: var(--ink-soft); }
.social-list a:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--line-strong); }

.footer__bottom {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------------------------------- Page header (projects/blog) ---------------------------------- */

.page-hero { padding: 48px 0 36px; border-bottom: 1px solid var(--line); }
.page-hero h1 { margin-top: 6px; font-size: clamp(1.7rem, 3.6vw, 2.2rem); }
.page-hero p { margin-top: 12px; color: var(--ink-soft); max-width: 56ch; font-size: 1rem; }

/* Blog list */

.post-list { border-top: 1px solid var(--line-strong); padding-bottom: 60px; }
.post-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.post-row time { font-size: 0.82rem; color: var(--ink-faint); padding-top: 3px; }
.post-row h3 { font-size: 1.1rem; font-family: var(--font-body); font-weight: 600; }
.post-row p { color: var(--ink-soft); margin-top: 5px; font-size: 0.92rem; }
.post-row .tags { margin-top: 6px; font-size: 0.8rem; color: var(--brass); }

/* ---------------------------------- Responsive ---------------------------------- */

@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  .portrait { width: 148px; height: 185px; }
  .footer__top { flex-direction: column; }
}

@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav-toggle { display: inline-flex; }
  .entry { grid-template-columns: 1fr; gap: 4px; }
  .fact-row { grid-template-columns: 1fr; gap: 2px; }
  .post-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 48px 0 36px; }
  section.block { padding: 40px 0; }
}

/* Mobile nav drawer */

.nav-drawer { display: none; position: fixed; inset: 0; z-index: 50; background: var(--paper); }
.nav-drawer.is-open { display: block; }
.nav-drawer__inner { padding: 20px 24px; }
.nav-drawer__close {
  width: 30px; height: 30px;
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-left: auto;
}
.nav-drawer ul { list-style: none; margin: 56px 0 0; padding: 0; display: flex; flex-direction: column; gap: 24px; }
.nav-drawer a { font-family: var(--font-display); font-size: 1.6rem; }
