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

@font-face {
  font-family: 'Author';
  src: url('../assets/fonts/author/Author-Variable.woff2') format('woff2');
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #F2F2F2;
  --fg: #1c1a17;
  --muted: #666;
  --focus: #1c1a17;
  --tech-bg: #191919;
  --tech-fg: #f7f5e9;
  --icon-filter: brightness(0) invert(1);
  background: var(--bg);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191919;
  --fg: #f2f2f2;
  --muted: #a3a3a3;
  --focus: #f7f5e9;
  --tech-bg: #111111;
  --tech-fg: #f7f5e9;
  --icon-filter: brightness(0) invert(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #191919;
    --fg: #f2f2f2;
    --muted: #a3a3a3;
    --focus: #f7f5e9;
    --tech-bg: #111111;
    --tech-fg: #f7f5e9;
    --icon-filter: brightness(0) invert(1);
    background: var(--bg);
  }
}

.profile-image {
  display: block;
  width: 10rem;
  height: 10rem;
  margin: 0 0 1.25rem;
  object-fit: cover;
  border-radius: 1.25rem;
}

.intro {
  white-space: pre-line;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 3rem;
  box-sizing: border-box;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Author', sans-serif;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -1rem 0 1.25rem;
}

.theme-toggle {
  view-transition-name: theme-toggle;
  --card-face: var(--fg);
  --card-rim: #fff;
  --mark-fill: #fff;
  --mark-stroke: #111;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 73px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transform: rotate(-6deg);
  transition: transform 180ms ease;
}

[data-theme="dark"] .theme-toggle {
  --card-rim: #141414;
  --mark-fill: #141414;
  --mark-stroke: #fff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle {
    --card-rim: #141414;
    --mark-fill: #141414;
    --mark-stroke: #fff;
  }
}

.theme-toggle:hover {
  transform: rotate(0deg) scale(1.08);
}

.theme-toggle:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 4px;
}

.theme-toggle-mark {
  display: block;
  width: 52px;
  height: 73px;
}

.theme-toggle.is-reversing {
  animation: theme-reverse 200ms ease-in-out;
}

@keyframes theme-reverse {
  0% {
    transform: perspective(280px) rotate(-6deg) rotateY(0deg);
  }
  42% {
    transform: perspective(280px) rotate(70deg) rotateY(90deg);
  }
  84% {
    transform: perspective(280px) rotate(174deg) rotateY(0deg);
  }
  84.01%,
  100% {
    transform: rotate(-6deg);
  }
}

::view-transition-group(root) {
  animation-duration: 600ms;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 2;
}

html[data-theme="light"]::view-transition-new(root) {
  animation: wash-expand 600ms ease-out both;
}

html[data-theme="dark"]::view-transition-old(root) {
  z-index: 2;
  animation: wash-shrink 600ms ease-in both;
}

html[data-theme="dark"]::view-transition-new(root) {
  z-index: 1;
}

@keyframes wash-expand {
  from {
    clip-path: circle(0 at var(--wash-x) var(--wash-y));
  }
  to {
    clip-path: circle(var(--wash-r) at var(--wash-x) var(--wash-y));
  }
}

@keyframes wash-shrink {
  from {
    clip-path: circle(var(--wash-r) at var(--wash-x) var(--wash-y));
  }
  to {
    clip-path: circle(0 at var(--wash-x) var(--wash-y));
  }
}

:root:active-view-transition body {
  transition: none;
}

::view-transition-group(theme-toggle) {
  animation: none !important;
  z-index: 100;
  width: 52px !important;
  height: 73px !important;
  overflow: visible;
  transform: translate(var(--wash-x), var(--wash-y)) translate(-50%, -50%) !important;
}

::view-transition-image-pair(theme-toggle) {
  overflow: visible;
  transform-origin: center;
  animation: theme-reverse 200ms ease-in-out forwards;
}

::view-transition-old(theme-toggle),
::view-transition-new(theme-toggle) {
  animation: none;
  mix-blend-mode: normal;
  overflow: visible;
}

::view-transition-old(theme-toggle) {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  body,
  .theme-toggle {
    transition: none;
  }

  .theme-toggle:hover,
  .theme-toggle.is-reversing {
    animation: none;
    transform: rotate(-6deg);
  }

  ::view-transition-group(root),
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-group(theme-toggle),
  ::view-transition-image-pair(theme-toggle),
  ::view-transition-old(theme-toggle),
  ::view-transition-new(theme-toggle) {
    animation: none;
  }
}

h1,
h2,
p {
  font-family: 'Sora', sans-serif;
}

h1,
h2 {
  font-size: 20px;
  font-weight: 700;
}

p {
  font-size: 14px;
}

main {
  flex: 1;
}

section {
  margin-top: 3rem;
}

.projects-section h2 {
  margin-bottom: 0.75rem;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  max-width: 36rem;
  padding: 0.35rem 0;
}

.project-name {
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 600;
}

.project-desc {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

.project-card:hover .project-name,
.project-card:focus-visible .project-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-card:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 6px;
}


.companies-section h2 {
  margin-bottom: 1.25rem;
}

.stamp-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 1.6rem;
  margin: 0;
  padding: 0.2rem 0 0;
  list-style: none;
}

.stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: 120px;
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
  transform: translateY(8px);
  opacity: 0;
  animation: stamp-rise 0.55s ease forwards;
  animation-delay: calc(var(--stamp-i, 0) * 70ms + 60ms);
}

.stamp--incognia { --stamp-body: #47304D; }
.stamp--inmetrics { --stamp-body: #FE015E; }
.stamp--ifood { --stamp-body: #EA1D2C; }
.stamp--vale { --stamp-body: #007E7A; }

/*
  Perforated white rim from stamp-frame.svg.
  Brand color fills the inset; logos sit on top.
  Mask is not combined with drop-shadow — that would clip the shadow.
*/
.stamp-face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 150px;
  box-sizing: border-box;
  /* frame inset is 24/240 = 10% sides, 24/300 = 8% top/bottom */
  padding: 8% 10%;
  background: url("../assets/images/companies/stamp-frame.svg") center / 100% 100% no-repeat;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.22));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.stamp-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.35rem;
  background: var(--stamp-body);
  box-sizing: border-box;
}

.stamp-logo {
  display: block;
  width: 88%;
  max-width: 86px;
  height: auto;
  max-height: 72px;
  object-fit: contain;
}

.stamp-logo--vale {
  width: 96%;
  max-width: 96px;
  max-height: 44px;
}

.stamp-caption {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.stamp:hover .stamp-face,
.stamp:focus-visible .stamp-face {
  transform: translateY(-4px) rotate(-1deg);
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.26));
}

.stamp:focus-visible {
  outline: none;
}

.stamp:focus-visible .stamp-face {
  outline: 1px solid var(--focus);
  outline-offset: 4px;
}

@keyframes stamp-rise {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .stamp-grid {
    gap: 1rem 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stamp {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .stamp:hover .stamp-face,
  .stamp:focus-visible .stamp-face {
    transform: none;
  }
}

.tech-stack-section {
  margin-right: -3rem;
  margin-left: -3rem;
  padding: 3rem 3rem 2.5rem;
  overflow: hidden;
  border-radius: 56px 56px 0 0;
  background: var(--tech-bg);
  color: var(--tech-fg);
}

.tech-stack-section h2,
.tech-stack-section h3 {
  margin: 0;
  color: var(--tech-fg);
}

.tech-stack-section h2 {
  font-size: 20px;
  font-weight: 700;
  text-align: left;
}

.tech-carousel {
  overflow: hidden;
  margin: 2.5rem -3rem 0;
  padding: 0.5rem 0 2.5rem;
}

.tech-grid {
  display: flex;
  width: max-content;
  gap: 6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  animation: tech-carousel-right 50s linear infinite;
}

.tech-carousel:hover .tech-grid,
.tech-carousel:focus-within .tech-grid {
  animation-play-state: paused;
}

.tech-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  height: 56px;
  flex: 0 0 auto;
  gap: 0.7rem;
  cursor: default;
}

.tech-item:focus-visible {
  outline: 1px solid var(--tech-fg);
  outline-offset: 8px;
}

.tech-icon {
  display: block;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  filter: var(--icon-filter);
}

.tech-icon--light {
  filter: var(--icon-filter);
}

.tech-icon--color {
  filter: none;
}

.tech-icon--wide {
  width: 42px;
}

.tech-name {
  color: var(--tech-fg);
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

@keyframes tech-carousel-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .tech-grid {
    animation: none;
  }
}

@media (max-width: 600px) {
  .tech-stack-section {
    margin-right: -3rem;
    margin-left: -3rem;
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }
}

footer {
  display: flex;
  gap: 1rem;
  padding-top: 3rem;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
}

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

footer a {
  text-decoration: underline;
}

.post-meta {
  color: var(--muted);
  font-size: 12px;
}

.videos-section h2 {
  margin-bottom: 0.75rem;
}

.video-status {
  color: var(--muted);
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.video-list[hidden] {
  display: none;
}

.video-row {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  max-width: 42rem;
}

.video-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  width: 18rem;
  flex: 0 0 18rem;
}

.video-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.75rem;
  background: var(--muted);
}

.video-title {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.video-card:hover .video-title,
.video-card:focus-visible .video-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.video-card:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 4px;
}

.transcript-side {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
  padding-top: 0.15rem;
}

.transcript-button {
  align-self: flex-start;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.transcript-button:disabled {
  color: var(--muted);
  text-decoration: none;
  cursor: default;
}

.transcript-button:focus-visible,
.transcript-panel:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 4px;
}

.transcript-panel {
  margin: 0;
  max-height: 12rem;
  overflow: auto;
  padding-left: 0.75rem;
  border-left: 1px solid var(--muted);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .video-row {
    flex-direction: column;
  }

  .video-card {
    width: 100%;
    flex-basis: auto;
    max-width: 20rem;
  }
}
