/* =============================================
   style.css � Portf�lio Misael Serafim
   Metodologia: BEM | Fonte: Poppins
   ============================================= */

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

/* -- TOKENS --------------------------------- */
:root {
  --color-bg:          #faf9f6;
  --color-surface:     #ffffff;
  --color-border:      #e4e3dd;
  --color-text:        #111118;
  --color-text-muted:  #64645d;
  --color-accent:      #151b79;
  --color-accent-soft: #e8ecff;
  --color-shadow:      rgba(17, 17, 24, 0.08);

  --font: 'Poppins', system-ui, sans-serif;

  --text-xs:   0.72rem;
  --text-sm:   0.9rem;
  --text-base: 1rem;
  --text-lg:  1.15rem;
  --text-xl:  1.45rem;
  --text-2xl: 2.3rem;
  --text-3xl: 3.4rem;
  --text-4xl: 4.2rem;

  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.5rem;
  --sp-6:  2rem;
  --sp-8:  2.5rem;
  --sp-10: 3.5rem;
  --sp-12: 4.5rem;
  --sp-16: 6rem;

  --radius-sm: 10px;
  --radius-md: 24px;
  --radius-lg: 40px;
  --shadow-sm: 0 8px 24px rgba(17, 17, 24, 0.06);
  --shadow-md: 0 18px 40px rgba(17, 17, 24, 0.08);

  --ease: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-slow: 420ms cubic-bezier(0.4, 0, 0.2, 1);

  --container-max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:          #0d1018;
    --color-surface:     #141b27;
    --color-border:      rgba(255, 255, 255, 0.08);
    --color-text:        #f5f6fb;
    --color-text-muted:  #a0a8bc;
    --color-accent:      #74819f;
    --color-accent-soft: rgba(116, 129, 159, 0.14);
    --color-shadow:      rgba(0, 0, 0, 0.32);
  }
}

body[data-theme='dark'] {
  --color-bg:          #0d1018;
  --color-surface:     #141b27;
  --color-border:      rgba(255, 255, 255, 0.08);
  --color-text:        #f5f6fb;
  --color-text-muted:  #a0a8bc;
  --color-accent:      #74819f;
  --color-accent-soft: rgba(116, 129, 159, 0.14);
  --color-shadow:      rgba(0, 0, 0, 0.32);
}

/* -- BASE ----------------------------------- */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  color-scheme: light;
}

body[data-theme='dark'] {
  color-scheme: dark;
}

body[data-theme='dark'] .sidebar {
  background: #131b27;
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme='dark'] .sidebar__nav-link,
body[data-theme='dark'] .sidebar__social-link,
body[data-theme='dark'] .sidebar__theme-toggle {
  color: var(--color-text);
}

body[data-theme='dark'] .sidebar__nav-link:hover,
body[data-theme='dark'] .sidebar__nav-link:focus-visible,
body[data-theme='dark'] .sidebar__theme-toggle:hover,
body[data-theme='dark'] .sidebar__theme-toggle:focus-visible {
  background: rgba(116, 129, 159, 0.28);
  color: #fff;
}

body[data-theme='dark'] .sidebar__social-link {
  background: rgba(255, 255, 255, 0.04);
  color: #f6d33f;
  text-decoration: underline;
}

body[data-theme='dark'] .sidebar__social-link:hover,
body[data-theme='dark'] .sidebar__social-link:focus-visible {
  background: rgba(246, 211, 63, 0.16);
  color: #f6d33f;
  transform: translateY(-2px);
}

body[data-theme='dark'] .hero__contact-line a,
body[data-theme='dark'] .hero__resume-link a {
  color: #f6d33f;
  text-decoration: underline;
}

body[data-theme='dark'] .hero__panel-title,
body[data-theme='dark'] .hero__eyebrow,
body[data-theme='dark'] .hero__contact-line {
  color: #fff;
}

body[data-theme='dark'] .about__topic {
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme='dark'] .about__topic strong,
body[data-theme='dark'] .about__formation-label {
  color: #fff;
  font-weight: 600;
}

body[data-theme='dark'] .about__topic p,
body[data-theme='dark'] .about__formation p:last-child {
  color: #e8ebff;
  font-weight: 500;
}

body[data-theme='dark'] .about__topic p {
  letter-spacing: 0.01em;
}

img { display: block; max-width: 100%; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
address { font-style: normal; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  background: var(--color-accent);
  color: #fff;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 9999;
  transition: top var(--ease);
}
.skip-link:focus {
  top: 0;
}

.container {
  width: min(100%, var(--container-max));
  margin-inline: auto;
  padding-inline: var(--sp-8);
}

.page-shell {
  display: block;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 300px;
  padding: var(--sp-8);
  background: #fff;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-8);
}

.main-content {
  margin-left: 300px;
  padding: 0 var(--sp-8) var(--sp-10);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  padding-inline: var(--sp-8);
  margin-bottom: var(--sp-8);
}

.topbar__action {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--color-accent);
  color: #fff;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform var(--ease), box-shadow var(--ease);
}

.topbar__action:hover,
.topbar__action:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.sidebar__brand {
  display: grid;
  gap: var(--sp-5);
}

.sidebar__avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 8px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.sidebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.sidebar__name {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.05;
}

.sidebar__role {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.sidebar__nav {
  display: grid;
  gap: var(--sp-3);
}

.sidebar__nav-link {
  color: var(--color-text);
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  transition: background var(--ease), color var(--ease), transform var(--ease);
}

.sidebar__nav-link:hover,
.sidebar__nav-link:focus-visible {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  transform: translateX(4px);
}

.sidebar__footer {
  display: grid;
  gap: var(--sp-6);
}

.sidebar__socials {
  display: flex;
  gap: var(--sp-2);
}

.sidebar__theme-toggle,
.sidebar__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform var(--ease), background var(--ease), color var(--ease);
}

.sidebar__theme-toggle {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 999;
}

.sidebar__theme-toggle:hover,
.sidebar__theme-toggle:focus-visible,
.sidebar__social-link:hover,
.sidebar__social-link:focus-visible {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
}

.sidebar__social-link svg {
  width: 20px;
  height: 20px;
}

.sidebar__contact-card {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  background: var(--color-accent-soft);
  border: 1px solid rgba(21, 27, 121, 0.12);
}

.sidebar__contact-card span {
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.sidebar__contact-card a {
  color: var(--color-accent);
  font-weight: 600;
}

.hero {
  display: flex;
  justify-content: center;
  padding: var(--sp-12) var(--sp-8);
  background: transparent;
}

.hero__center {
  max-width: 620px;
  width: 100%;
  text-align: center;
  display: grid;
  gap: var(--sp-4);
}

.hero__center--compact {
  padding: var(--sp-8) var(--sp-6);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hero__eyebrow {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--color-text-muted);
  margin: 0;
}

.hero__panel-title {
  font-size: clamp(3rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin: 0;
}

.hero__subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  line-height: 1.8;
  margin: 0;
}

.hero__contact-line {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.hero__contact-line a {
  color: var(--color-accent);
  text-decoration: none;
}

.hero__resume-link {
  margin-top: var(--sp-3);
}

.hero__resume-link a {
  display: inline;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  border-bottom: 1px solid rgba(21, 27, 121, 0.22);
}

.hero__panel-stacks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hero__panel-stacks li {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
}

.hero__subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  margin: 0;
}

.hero__contact-line {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.hero__contact-line a {
  color: var(--color-accent);
  text-decoration: none;
}

.hero__resume-link {
  margin-top: var(--sp-3);
}

.hero__resume-link a {
  display: inline;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  border-bottom: 1px solid rgba(21, 27, 121, 0.22);
}

.hero__icon-stacks {
  gap: 1rem;
}

.stack-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.stack-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--color-accent);
  flex-shrink: 0;
}

.stack-icon--nextjs {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M7 5h6l5 14h-4l-1-3H8l-1 3H3L7 5Zm6 6H9.5l-1.5 4h6l-1.5-4Zm2-5h-2v2h2V6Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60%;
}

.stack-icon--react {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 7a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 2a3 3 0 1 1 0 6 3 3 0 0 1 0-6z'/%3E%3Cpath fill='%23fff' d='M12 2.5c1.4 0 2.8.5 4.1 1.4-1.1 1.6-2.5 2.8-4.1 3.4C10.4 6.7 9 5.5 7.9 3.9 9.2 3 10.6 2.5 12 2.5zm0 19c-1.4 0-2.8-.5-4.1-1.4 1.1-1.6 2.5-2.8 4.1-3.4 1.7.6 3.1 1.8 4.2 3.4-1.3.9-2.7 1.4-4.2 1.4zM4.2 6.1C5.4 7.3 6.8 8 8.2 8.4 9 7.6 9.7 6.7 10.2 5.7c-2.3-.7-4 0-6 1.8zm11.6 11.8c-1.4.2-2.8-.1-4-.8-.5-1-1.2-1.9-2-2.7 1.4-.5 2.8-1.2 4-2.2 1.1 1.8 1.8 3.9 2 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60%;
}

.stack-icon--typescript {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3 3h18v18H3V3Zm9 4h-3v2h3v8h2V9h3V7h-5Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60%;
}

.about__topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-6);
  margin-top: var(--sp-6);
}

.about__topic {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid rgba(17, 17, 24, 0.08);
}

.about__topic strong {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-accent);
}

.about__topic p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.8;
}

.about__formation {
  margin-top: var(--sp-8);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid rgba(17, 17, 24, 0.08);
}

.about__formation-label {
  display: block;
  margin-bottom: var(--sp-3);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.about__formation p:last-child {
  margin: 0;
  color: var(--color-text-muted);
}

@media (max-width: 980px) {
  .about__topics,
  .skill-grid,
  .section__grid,
  .section__grid--education {
    grid-template-columns: 1fr;
  }
}

.about__wrapper {
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  gap: var(--sp-5);
}

.about__text {
  margin: 0 auto;
  max-width: 680px;
  color: var(--color-text-muted);
  line-height: 1.8;
}

.about__stacks {
  justify-content: center;
}

.section {
  padding-top: var(--sp-16);
  padding-bottom: var(--sp-16);
}

.section__header {
  display: grid;
  gap: var(--sp-3);
  max-width: 780px;
  margin: 0 auto 2rem;
  text-align: center;
}

.section-heading {
  font-size: 2.4rem;
  line-height: 1.05;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
}

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

.card,
.project-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  transition: transform var(--ease), box-shadow var(--ease);
}

.project-card {
  position: relative;
  overflow: hidden;
  min-height: 340px;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-2px);
}

.project-card__image {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
  display: block;
}

.project-card__meta {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  padding: 2rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.75) 100%);
}

.project-card__title {
  margin: 0;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1.05;
}

.project-card__hover {
  display: grid;
  gap: 1rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
  align-items: center;
}

.project-card:hover .project-card__hover,
.project-card:focus-within .project-card__hover {
  opacity: 1;
  transform: translateY(0);
}

.project-card__link {
  color: rgba(255,255,255,0.95);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.4px;
  text-underline-offset: 0.28rem;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  justify-self: end;
  transition: color 180ms var(--ease), transform 180ms var(--ease);
}

.project-card__link:hover,
.project-card__link:focus-visible {
  color: #fff;
  transform: translateY(-1px);
}

.project-card__stacks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0;
  margin: 0;
}

.project-card__stacks li {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-block {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease), color var(--ease);
}

.button--primary {
  background: var(--color-accent);
  color: #fff;
}

.button--ghost {
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.footer {
  border-top: 1px solid var(--color-border);
  background: transparent;
  padding: var(--sp-6) 0;
}

.footer__inner {
  width: min(100%, var(--container-max));
  margin-inline: auto;
  padding-inline: var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
}

.footer__copy {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.js-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js-reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .main-content {
    margin-left: 0;
    padding-top: var(--sp-6);
  }

  .hero__inner {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .topbar {
    justify-content: center;
  }
}

@media (max-width: 820px) {
  .container {
    padding-inline: var(--sp-5);
  }

  .sidebar {
    padding: var(--sp-5);
  }

  .sidebar__socials {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section__grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .hero__text {
    font-size: 2.4rem;
  }

  .hero__card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding-inline: var(--sp-4);
  }

  .hero__text {
    font-size: 2rem;
  }

  .sidebar__name {
    font-size: 1.75rem;
  }

  .sidebar__nav {
    gap: var(--sp-2);
  }
}

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